https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85924

--- Comment #1 from Jason Vas Dias <jason.vas.dias at gmail dot com> ---
Aha! Sorry, it appears that when run from command line, just the -fPIC
option appears, not the -DPIC, but in my make.log for the original
GCC build, I do see:

checking for shl_load in -ldld... libtool: compile: 
/home/devel/OS/gcc-6-branch/host-x86_64-linux-gnu/gcc/xgcc -shared-libgcc
-B/home/devel/OS/gcc-6-branch/host-x86_64-linux-gnu/gcc -nostdinc++
-L/home/devel/OS/gcc-6-branch/x86_64-linux-gnu/libstdc++-v3/src
-L/home/devel/OS/gcc-6-branch/x86_64-linux-gnu/libstdc++-v3/src/.libs
-L/home/devel/OS/gcc-6-branch/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/usr/local/x86_64-linux-gnu/bin/ -B/usr/local/x86_64-linux-gnu/lib/ -isystem
/usr/local/x86_64-linux-gnu/include -isystem
/usr/local/x86_64-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-DASAN_HAS_EXCEPTIONS=1 -DASAN_NEEDS_SEGV=1 -DCAN_SANITIZE_UB=0
-D_OBSTACK_SIZE_T=SIZE_T -I. -I../../.././libsanitizer/asan -I.. -I
../../.././libsanitizer/include -I ../../.././libsanitizer -Wall -W
-Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC
-fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables
-fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf
-I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-linux-gnu
-I../../.././libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -g -O2
-D_GNU_SOURCE -MT asan_linux.lo -MD -MP -MF .deps/asan_linux.Tpo -c
../../.././libsanitizer/asan/asan_linux.cc  -fPIC -DPIC -o asan_linux.o
>/dev/null 2>&1
no
checking for dlopen... no


So the asan/asan_linux.o object IS getting built with -fPIC -DPIC !

this means instant infinite recursion for every syscall if -static-libasan
used.

Reply via email to