http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58427
Bug ID: 58427 Summary: xgcc target compilation depends on installed libgcc_s.so Product: gcc Version: 4.5.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: rose.garcia-eggl2fk at yopmail dot com during target compilation (for example libssp or libstdc++) xgcc is invoked with the usual specs: /src/build/gcc454/gcc-4.5.4/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/src/build/gcc454/gcc-4.5.4/host-x86_64-unknown-linux-gnu/gcc/ ... conftest.c specs: %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared- libgcc:-lgcc_s%{!shared: -lgcc}}}} in case binutils ld decides for some reason that libgcc_s is needed, it will hardcode a reference to libgcc_s into DT_NEEDED. binutils itself finds the libgcc_s.so in the -B path, and adds it, but launching the resulting executable will fail because the *dynamic linker* has no way of knowing that it should look for the .so in host-x86_64-unknown-linux-gnu/gcc. this causes the configure check for libssp and libstdc++ to fail with "C compiler cannot create working executables". possible solutions: 1) the spec file used by xgcc to compile target libraries should use libgcc_eh.a instead of libgcc_s.so 2) LD_LIBRARY_PATH has to be set to host-x86_64-unknown-linux-gnu/gcc (the -B path) so the dynamic linker can find libgcc_s.so imo, 1) is preferable.