http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56781
Bug #: 56781 Summary: boostrap-asan failure: fixincl fails to link (missing -lasan) Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: build Severity: normal Priority: P3 Component: sanitizer AssignedTo: unassig...@gcc.gnu.org ReportedBy: al...@gcc.gnu.org CC: do...@gcc.gnu.org, dvyu...@gcc.gnu.org, ja...@gcc.gnu.org, k...@gcc.gnu.org bootstrap on x86_64-linux-gnu fails with: /scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc -B/scratch/obj.x86_64/gcc-4.9.mine/./gcc/ -B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/bin/ -B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/lib/ -isystem /opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/include -isystem /opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/sys-include -Og -g3 -ggdb3 -static-libstdc++ -static-libgcc -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a ../libiberty/libiberty.a(regex.o): In function `byte_compile_range': /scratch/obj.x86_64/gcc-4.9.mine/libiberty/../../../src/gcc-4.9.mine/libiberty/regex.c:4499: undefined reference to `__asan_report_store1' /scratch/obj.x86_64/gcc-4.9.mine/libiberty/../../../src/gcc-4.9.mine/libiberty/regex.c:4499: undefined reference to `__asan_report_load1' [snip] we would obviously need to link against asan but it is not immediately obvious to me how to pass POSTSTAGE1_LDFLAGS to fixincludes/ $ /scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc -B/scratch/obj.x86_64/gcc-4.9.mine/./gcc/ -B/scratch/obj.x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/libsanitizer/asan -B/scratch/obj.x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/libsanitizer/asan/.libs -B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/bin/ -B/opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/lib/ -isystem /opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/include -isystem /opt/x86_64/gcc-4.9.mine/x86_64-unknown-linux-gnu/sys-include -Og -g3 -ggdb3 -static-libstdc++ -static-libgcc -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a -fsanitize=address -static-libasan produces the desired fixincl $ /scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc -v Using built-in specs. COLLECT_GCC=/scratch/obj.x86_64/gcc-4.9.mine/./gcc/xgcc Target: x86_64-unknown-linux-gnu Configured with: ../../src/gcc-4.9.mine/configure -v --enable-languages=c,lto,fortran,c++,go LD=/usr/bin/ld.bfd CFLAGS='-O2 -g3 -ggdb3' CXXFLAGS='-O2 -g3 -ggdb3' 'BOOT_CFLAGS=-O2 -g3 -ggdb3' 'BOOT_CXXFLAGS=-O2 -g3 -ggdb3' 'CFLAGS_FOR_TARGET=-Og -g3 -ggdb3' 'CXXFLAGS_FOR_TARGET=-Og -g3 -ggdb3' --prefix=/opt/x86_64/gcc-4.9.mine// --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.9.mine-HEAD --with-build-config=bootstrap-asan --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --disable-werror --enable-checking=yes --enable-debug -C --disable-intermodule --enable-multilib --disable-libstdcxx-pch --enable-bootstrap --enable-checking=release --with-cpu=native --with-tune=native --enable-plugin Thread model: posix gcc version 4.9.0 20130327 (experimental) [vnhoist revision 32ddde1:a851c38:065ec6e627efa59b32f9fb743368a4a55c4ac310] (GCC)