[cfe-commits] r166271 - /cfe/trunk/docs/AddressSanitizer.html

Kostya Serebryany kcc at google.com
Fri Oct 19 00:00:46 PDT 2012


Author: kcc
Date: Fri Oct 19 02:00:46 2012
New Revision: 166271

URL: http://llvm.org/viewvc/llvm-project?rev=166271&view=rev
Log:
[asan] update asan docs to explain more about linking and to mention full support for i386 Linux

Modified:
    cfe/trunk/docs/AddressSanitizer.html

Modified: cfe/trunk/docs/AddressSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/AddressSanitizer.html?rev=166271&r1=166270&r2=166271&view=diff
==============================================================================
--- cfe/trunk/docs/AddressSanitizer.html (original)
+++ cfe/trunk/docs/AddressSanitizer.html Fri Oct 19 02:00:46 2012
@@ -49,6 +49,11 @@
 
 <h2 id="usage">Usage</h2>
 Simply compile and link your program with <tt>-faddress-sanitizer</tt> flag. <BR>
+The AddressSanitizer run-time library should be linked to the final executable,
+so make sure to use <tt>clang</tt> (not <tt>ld</tt>) for the final link step.<BR>
+When linking shared libraries, the AddressSanitizer run-time is not linked,
+so <tt>-Wl,-z,defs</tt> may cause link errors (don't use it with AddressSanitizer). <BR>
+
 To get a reasonable performance add <tt>-O1</tt> or higher. <BR>
 To get nicer stack traces in error messages add
 <tt>-fno-omit-frame-pointer</tt>. <BR>
@@ -65,8 +70,16 @@
 </pre>
 
 <pre>
+# Compile and link
 % clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer example_UseAfterFree.cc
 </pre>
+OR
+<pre>
+# Compile
+% clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer -c example_UseAfterFree.cc
+# Link
+% clang -g -faddress-sanitizer example_UseAfterFree.o
+</pre>
 
 If a bug is detected, the program will print an error message to stderr and exit with a
 non-zero exit code.
@@ -116,10 +129,10 @@
 
 <h2 id="platforms">Supported Platforms</h2>
 AddressSanitizer is supported on
-<ul><li>Linux x86_64 (tested on Ubuntu 10.04).
+<ul><li>Linux i386/x86_64 (tested on Ubuntu 10.04 and 12.04).
 <li>MacOS 10.6, 10.7 and 10.8 (i386/x86_64).
 </ul>
-Support for Linux i386/ARM is in progress
+Support for Linux ARM (and Android ARM) is in progress
 (it may work, but is not guaranteed too).
 
 





More information about the cfe-commits mailing list