This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/56682] New: -fsanitize documentation
- From: "edwin+gccbugs at etorok dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Mar 2013 17:01:56 +0000
- Subject: [Bug c/56682] New: -fsanitize documentation
- Auto-submitted: auto-generated
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.