Configuring glibc with CFLAGS="-g1" causes glibc to be built without the --noexecstack option: $ ../libc/configure | grep noexecstack checking whether --noexecstack is desirable for .S files... yes $ ../libc/configure CFLAGS="-g1" | grep noexecstack checking whether --noexecstack is desirable for .S files... no Other variants of the -g option (-g, -g0, -g2) give the correct behaviour. This happens because the configure script is doing an invocation of gcc like the following: $ gcc -g1 -S conftest.c $ gcc -g1 -c conftest.s -Wa,--noexecstack test.s: Assembler messages: test.s:79: Error: file number 1 already allocated This fails for a reason other than the -Wa,--noexecstack argument, but it causes configure to conclude that --noexecstack is not available. I filed a bug on gcc (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35925) because it was not clear whether passing -g1 to both invocations should be expected to work. One way to fix this is not to pass CFLAGS to the second invocation; using ASFLAGS brings this into line with other compilations of .s files. Suggested patches attached.
Created attachment 2704 [details] configure script patch
Created attachment 2705 [details] slightly different patch to the configure script
I applied the second patch to cvs.