With current trunk (r150327, but has been broken for a couple months at least) bootstrap fails if LDFLAGS contains -Wl,--as-needed.
x86_64-unknown-linux-gnu-gcc -O -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -Wl,--as-needed -Wl,--hash-style=gnu -o cc1-dummy c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o c-pch.o c-parser.o i386-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o \ dummy-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -Lyes/lib -lcloog -Lyes/lib -lppl_c -lppl -lgmpxx -lmpc -lmpfr -lgmp -rdynamic libbackend.a(plugin.o): In function `init_one_plugin': plugin.c:(.text+0x447): undefined reference to `dlopen' plugin.c:(.text+0x454): undefined reference to `dlerror' plugin.c:(.text+0x474): undefined reference to `dlerror' plugin.c:(.text+0x483): undefined reference to `dlsym' plugin.c:(.text+0x48d): undefined reference to `dlerror' plugin.c:(.text+0x4b5): undefined reference to `dlsym' plugin.c:(.text+0x4bd): undefined reference to `dlerror' collect2: ld returned 1 exit status make[3]: *** [cc1-dummy] Error 1 rm gfdl.pod cpp.pod gcc.pod gcov.pod fsf-funding.pod make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.0_pre9999/work/build/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.0_pre9999/work/build' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.5.0_pre9999/work/build' make: *** [bootstrap] Error 2 /var/tmp/portage/sys-devel/gcc-4.5.0_pre9999/work/gcc-4.5.0-9999/configure --prefix=/usr --bindir=/usr/x86_64-unknown-linux-gnu/gcc-bin/4.5.0-pre9999 --includedir=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0-pre9999/include --datadir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.0-pre9999 --mandir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.0-pre9999/man --infodir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/4.5.0-pre9999/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0-pre9999/include/g++-v4 --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-nls --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --disable-libmudflap --disable-libssp --enable-libgomp --enable-cld --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion=Gentoo SVN -- Summary: build failure w/ -Wl,--as-needed - undefined references in plugin.c Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dirtyepic at gentoo dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40928