From e246d908b661ed9b5725e8d4b5566204ee39ca99 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 6 Nov 2012 16:19:11 +0000 Subject: [PATCH] Use -fsanitize= flag in docs for ASan/TSan git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167465 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/AddressSanitizer.html | 8 ++++---- docs/ThreadSanitizer.html | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/AddressSanitizer.html b/docs/AddressSanitizer.html index 4939079917..397eafc2d5 100644 --- a/docs/AddressSanitizer.html +++ b/docs/AddressSanitizer.html @@ -49,7 +49,7 @@ Follow the clang build instructions. CMake build is supported.

Usage

-Simply compile and link your program with -faddress-sanitizer flag.
+Simply compile and link your program with -fsanitize=address flag.
The AddressSanitizer run-time library should be linked to the final executable, so make sure to use clang (not ld) for the final link step.
When linking shared libraries, the AddressSanitizer run-time is not linked, @@ -72,14 +72,14 @@ int main(int argc, char **argv) {
 # Compile and link
-% clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer example_UseAfterFree.cc
+% clang -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
 
OR
 # Compile
-% clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer -c example_UseAfterFree.cc
+% clang -O1 -g -fsanitize=address -fno-omit-frame-pointer -c example_UseAfterFree.cc
 # Link
-% clang -g -faddress-sanitizer example_UseAfterFree.o
+% clang -g -fsanitize=address example_UseAfterFree.o
 
If a bug is detected, the program will print an error message to stderr and exit with a diff --git a/docs/ThreadSanitizer.html b/docs/ThreadSanitizer.html index 64a28eb809..aa251c1153 100644 --- a/docs/ThreadSanitizer.html +++ b/docs/ThreadSanitizer.html @@ -48,8 +48,8 @@ Support for 32-bit platforms is problematic and not yet planned.

Usage

-Simply compile your program with -fthread-sanitizer -fPIE and link it -with -fthread-sanitizer -pie.
+Simply compile your program with -fsanitize=thread -fPIE and link it +with -fsanitize=thread -pie.
To get a reasonable performance add -O1 or higher.
Use -g to get file names and line numbers in the warning messages.
@@ -72,7 +72,7 @@ int main() {
-% clang -fthread-sanitizer -g -O1 tiny_race.c -fPIE -pie
+% clang -fsanitize=thread -g -O1 tiny_race.c -fPIE -pie
 
If a bug is detected, the program will print an error message to stderr. -- 2.40.0