https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65639
Bug ID: 65639 Summary: -nostdlib/-nodefaultlibs should not affect ASan runtime Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: earthdok at google dot com CC: jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, samsonov at google dot com In GCC trunk, if -nostdlib/-nodefaultlibs is passed together with -fsanitize=address, the ASan runtime is not linked. Clang had the same behavior briefly but ended up reverting to the old behavior (i.e. those flags do not affect the ASan runtime): http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141020/117217.html https://code.google.com/p/address-sanitizer/issues/detail?id=344 One use case where GCC's behavior is problematic is building an ASan-instrumented glibc. Some executables are linked with -nostdlib and explicitly linked against the just-built libc.so.6; -fsanitize=address causes those build steps to fail due to unresolved ASan symbols.