http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56682
Bug #: 56682 Summary: -fsanitize documentation Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: edwin+gccb...@etorok.net Please update the -fsanitize=address and -fsanitize=thread documentation to specify what additional flags are required. >From my tests: -fsanitize=thread requires -fPIC for compilation and -pie or -shared for linking. -fsanitize=address doesn't require any special flags They both need -g for meaningful output (i.e. if you want to run asan_symbolize on it), and I've seen asan's wiki recommend -fno-omit-frame-pointer too. If you have an older binutils then -gdwarf-3 is required too, otherwise asan_symbolize (which invokes addr2line) can't resolve the symbol addresses to sourcefile:linenumber locations.