aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2012-11-21 17:46:00 +0000
committerWei Mi <wmi@gcc.gnu.org>2012-11-21 17:46:00 +0000
commitdde19676a42bf503b1a3ab3c901fc9d39740e569 (patch)
tree395e60bc75ff67ffb087dd4dbf356ef284d9d21f
parenteb20b7788fe0a9f43657668207677833e3881741 (diff)
downloadgcc-dde19676a42bf503b1a3ab3c901fc9d39740e569.zip
gcc-dde19676a42bf503b1a3ab3c901fc9d39740e569.tar.gz
gcc-dde19676a42bf503b1a3ab3c901fc9d39740e569.tar.bz2
common.opt: Change faddress-sanitizer to fsanitize=address.
* common.opt: Change faddress-sanitizer to fsanitize=address. * toplev.c (process_options): Likewise. * gcc.c (LINK_COMMAND_SPEC): Likewise. * testsuite/lib/asan-dg.exp (check_effective_target_faddress_sanitizer): Likewise. (asan_init): Likewise. * doc/invoke.texi (-fsanitize=address): Document. From-SVN: r193702
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/common.opt2
-rw-r--r--gcc/doc/invoke.texi7
-rw-r--r--gcc/gcc.c2
-rw-r--r--gcc/testsuite/lib/asan-dg.exp10
-rw-r--r--gcc/toplev.c2
6 files changed, 22 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7853c37..25dda30 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2012-11-21 Wei Mi <wmi@google.com>
+
+ * common.opt: Change faddress-sanitizer to fsanitize=address.
+ * toplev.c (process_options): Likewise.
+ * gcc.c (LINK_COMMAND_SPEC): Likewise.
+ * testsuite/lib/asan-dg.exp
+ (check_effective_target_faddress_sanitizer): Likewise.
+ (asan_init): Likewise.
+ * doc/invoke.texi (-fsanitize=address): Document.
+
2012-11-21 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_node_params): Rename clone_for_all_contexts to
diff --git a/gcc/common.opt b/gcc/common.opt
index be6fe4f..d3ad5ab 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -840,7 +840,7 @@ fargument-noalias-anything
Common Ignore
Does nothing. Preserved for backward compatibility.
-faddress-sanitizer
+fsanitize=address
Common Report Var(flag_asan)
Enable AddressSanitizer, a memory error detector
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 885bf66..a1c59f0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -289,7 +289,8 @@ Objective-C and Objective-C++ Dialects}.
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
--faddress-sanitizer -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
+-fsanitize=@var{style} @gol
+-fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
-fdisable-ipa-@var{pass_name} @gol
-fdisable-rtl-@var{pass_name} @gol
-fdisable-rtl-@var{pass-name}=@var{range-list} @gol
@@ -6855,7 +6856,7 @@ assumptions based on that.
The default is @option{-fzero-initialized-in-bss}.
-@item -faddress-sanitizer
+@item -fsanitize=address
Enable AddressSanitizer, a fast memory error detector.
Memory access instructions will be instrumented to detect
out-of-bounds and use-after-free bugs. So far only heap bugs will be detected.
@@ -9938,7 +9939,7 @@ for the languages used in the program, or using the option
@file{libgcc}.
@item -static-libasan
-When the @option{-faddress-sanitizer} option is used to link a program,
+When the @option{-fsanitize=address} option is used to link a program,
the GCC driver automatically links against @option{libasan}. If
@file{libasan} is available as a shared library, and the @option{-static}
option is not used, then this links against the shared version of
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 3d51566..0f8bcea 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -696,7 +696,7 @@ proper position among the other output files. */
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
%(mflib) " STACK_SPLIT_SPEC "\
%{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
- %{faddress-sanitizer:" LIBASAN_SPEC "}\
+ %{fsanitize=address:" LIBASAN_SPEC "}\
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
#endif
diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp
index b58a91f..9a435d2 100644
--- a/gcc/testsuite/lib/asan-dg.exp
+++ b/gcc/testsuite/lib/asan-dg.exp
@@ -14,13 +14,13 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Return 1 if compilation with -faddress-sanitizer is error-free for trivial
+# Return 1 if compilation with -fsanitize=address is error-free for trivial
# code, 0 otherwise.
proc check_effective_target_faddress_sanitizer {} {
return [check_no_compiler_messages faddress_sanitizer object {
void foo (void) { }
- } "-faddress-sanitizer"]
+ } "-fsanitize=address"]
}
#
@@ -83,12 +83,12 @@ proc asan_init { args } {
}
if [info exists ALWAYS_CXXFLAGS] {
set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS]
- set ALWAYS_CXXFLAGS [concat "{additional_flags=-faddress-sanitizer -g}" $ALWAYS_CXXFLAGS]
+ set ALWAYS_CXXFLAGS [concat "{additional_flags=-fsanitize=address -g}" $ALWAYS_CXXFLAGS]
} else {
if [info exists TEST_ALWAYS_FLAGS] {
- set TEST_ALWAYS_FLAGS "$link_flags -faddress-sanitizer -g $TEST_ALWAYS_FLAGS"
+ set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -g $TEST_ALWAYS_FLAGS"
} else {
- set TEST_ALWAYS_FLAGS "$link_flags -faddress-sanitizer -g"
+ set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -g"
}
}
}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index f7e2099..fcdbd1a 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1549,7 +1549,7 @@ process_options (void)
&& (targetm.asan_shadow_offset == NULL
|| !FRAME_GROWS_DOWNWARD))
{
- warning (0, "-faddress-sanitizer not supported for this target");
+ warning (0, "-fsanitize=address not supported for this target");
flag_asan = 0;
}