This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [asan] PATCH: PR driver/55379: Issue an error for -static with fsanitize=address
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Nov 2012 16:09:03 +0100
- Subject: Re: [asan] PATCH: PR driver/55379: Issue an error for -static with fsanitize=address
- References: <20121122143910.GA23803@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 22, 2012 at 06:39:11AM -0800, H.J. Lu wrote:
> fsanitize=address doesn't work with static link. This patch issues
> an error when both are specified. OK to install?
> 2012-11-22 H.J. Lu <hongjiu.lu@intel.com>
>
> PR driver/55379
Replace driver/ with sanitizer/
> * gcc.c (LINK_COMMAND_SPEC): Issue an error for -static with
> -fsanitize=address.
Ok with that change.
> diff --git a/gcc/gcc.c b/gcc/gcc.c
> index 0f8bcea..41474aa 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}\
> - %{fsanitize=address:" LIBASAN_SPEC "}\
> + %{fsanitize=address:" LIBASAN_SPEC "%{static:%ecannot specify -static with -fsanitize=address}}\
> %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
> %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
> #endif
Jakub