common.opt: Change faddress-sanitizer to fsanitize=address.
authorWei Mi <wmi@google.com>
Wed, 21 Nov 2012 17:46:00 +0000 (17:46 +0000)
committerWei Mi <wmi@gcc.gnu.org>
Wed, 21 Nov 2012 17:46:00 +0000 (17:46 +0000)
* 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

gcc/ChangeLog
gcc/common.opt
gcc/doc/invoke.texi
gcc/gcc.c
gcc/testsuite/lib/asan-dg.exp
gcc/toplev.c

index 7853c37ff140d49f27530d6532a32fde2a92d63a..25dda30062c76f2d53e1aab577f311e835a128a8 100644 (file)
@@ -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
index be6fe4f35d2ed894697b39cdcbe9decc454e8d63..d3ad5ab588bc4d2165f0b9bb10d1ca034f1d8c05 100644 (file)
@@ -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
 
index 885bf66c1a698faaae2107c82fcfee0458852ecd..a1c59f005c89d5b9483065eca5a14b2cb9f64356 100644 (file)
@@ -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
index 3d515665f7ac8533c4a0613c446451d7c05f6f64..0f8bcea81ded3be50c68985b249dc0e75a54a2ff 100644 (file)
--- 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
index b58a91f50e3bdac79032faca1b44c379834b3cff..9a435d2dc0c162ede7aea35bd28e7ae5db2be867 100644 (file)
 # 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"
        }
     }
 }
index f7e20998069caf7a2d5162045aee990ad4eaec16..fcdbd1aea5462f368241c59a47d24e5f13cebba7 100644 (file)
@@ -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;
     }