This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove --as-needed configure test


On Wed, 2012-04-25 at 14:18 +0000, Joseph S. Myers wrote:
> As discussed lately, we'd like to avoid the glibc build depending on
> libgcc_s (or more generally on any bit of libgcc that requires
> anything from glibc to be installed in order to build) in order to
> make bootstraps easier.
> 
> One dependency is that the configure test for ld --as-needed uses
> -lgcc_s, and there isn't really anything else it could use; testing
> --as-needed requires a shared library to link with using that option.
> But --as-needed was added to ld in 2004, long before any version now
> supported for building glibc, so this configure test is unnecessary
> (and we don't need to use a more complicated process involving
> building a shared library just to link with it with --as-needed).

In my test build of glibc master, this change appears to have had the
contrary effect, I can no longer (cross) build glibc without libgcc_s. A
small excerpt from the build log is at the end of the mail.

From a mailing list thread about the original --as-needed patch, it
seems the reason why -lgcc_s was added to the configure test was to make
sure that libgcc_s is available - and not as an arbitrary shared library
to test --as-needed with. With your change we now unconditionally depend
not only on --as-needed (which is fine) but also on libgcc_s.

Is there a concrete case where your change fixes the build or was this
just cleanup in preparation for dropping the libgcc_s build dependency?

Regards,
JÃrg

 http://sourceware.org/ml/libc-alpha/2004-04/msg00028.html

--

x86_64-unknown-linux-gnu-gcc -nostdlib -nostartfiles -o /stage2/src/glibc-build/iconv/iconv_prog  -Wl,-dynamic-linker=/stage2/lib/ld-linux-x86-64.so.2 -Wl,-O1  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /stage2/src/glibc-build/csu/crt1.o /stage2/src/glibc-build/csu/crti.o `x86_64-unknown-linux-gnu-gcc  --print-file-name=crtbegin.o` /stage2/src/glibc-build/iconv/iconv_prog.o /stage2/src/glibc-build/iconv/iconv_charmap.o /stage2/src/glibc-build/iconv/charmap.o /stage2/src/glibc-build/iconv/charmap-dir.o /stage2/src/glibc-build/iconv/linereader.o /stage2/src/glibc-build/iconv/dummy-repertoire.o /stage2/src/glibc-build/iconv/simple-hash.o /stage2/src/glibc-build/iconv/xstrdup.o /stage2/src/glibc-build/iconv/xmalloc.o  -Wl,-rpath-link=/stage2/src/glibc-build:/stage2/src/glibc-build/math:/stage2/src/glibc-build/elf:/stage2/src/glibc-build/dlfcn:/stage2/src/glibc-build/nss:/stage2/src/glibc-build/nis:/stage2/src/glibc-build/rt:/stage2/src/glibc-build/resolv:/stage2/src/glibc-build/crypt:/stage2/src/glibc-build/nptl /stage2/src/glibc-build/libc.so.6 /stage2/src/glibc-build/libc_nonshared.a -Wl,--as-needed /stage2/src/glibc-build/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `x86_64-unknown-linux-gnu-gcc  --print-file-name=crtend.o` /stage2/src/glibc-build/csu/crtn.o
/upkg/stage1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lgcc_s
make[2]: *** [/stage2/src/glibc-build/iconv/iconv_prog] Error 1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]