[Bug c/56682] New: -fsanitize documentation

edwin+gccbugs at etorok dot net gcc-bugzilla@gcc.gnu.org
Thu Mar 21 17:02:00 GMT 2013


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: unassigned@gcc.gnu.org
        ReportedBy: edwin+gccbugs@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.



More information about the Gcc-bugs mailing list