Commit dde19676 by Wei Mi Committed by Wei Mi

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
parent eb20b778
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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"
}
}
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment