On Sun, Nov 18, 2012 at 7:28 AM, Paolo Bonzini <bonz...@gnu.org> wrote: > Il 18/11/2012 00:54, H.J. Lu ha scritto: >> +@if gcc-bootstrap >> +ifneq ($(filter bootstrap-asan,$(BUILD_CONFIG)),) >> +LIBASAN_LIBS=-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs >> +endif >> +@endif gcc-bootstrap > > Do you need this to be here? POSTSTAGE1_*_EXPORT is only used when > bootstrapping, and they are defined with "=" so the definition could be > placed (or so it seems at first look) in bootstrap-asan.mk. >
It turns out to be quite tricky: 1. We can't use -faddress-sanitizer in libcpp due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55380 2. We can't use -faddress-sanitizer in libiberty since it will make all host binaries depend on libasan. 3. We can't use -faddress-sanitizer in lto-plugin since it will make linker depends on libasan. So basically we can only use -faddress-sanitizer in the gcc directory, which isn't easy to do. Also I have to mark libsanitizer as bootstrap otherwise multilib libsanitizer will get -funconfigured-libstcd++-v3. I checked my patches into hjl/asan git branch: http://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/hjl/asan I will submit them after running some tests. -- H.J.