On Mon, Jul 20, 2015 at 1:57 PM, H.J. Lu <[email protected]> wrote:
> On Mon, Jul 20, 2015 at 5:42 AM, Ilya Enkovich <[email protected]> wrote:
>> Hi,
>>
>> This patch adds a target filter for '-z bndplt' linker option. Bootstrapped
>> and regtested for x86_64-unknown-linux-gnu. MPX tests at lto.exp are not
>> marked as unsupported for 32bit any more. Going to commit it to trunk in a
>> few days if no obections appear.
>>
>> Thanks,
>> Ilya
>> --
>> gcc/
>>
>> 2015-07-20 Ilya Enkovich <[email protected]>
>>
>> PR target/66737
>> * config/i386/linux-common.h (MPX_SPEC): Use linker option
>> for 64bit target only.
>>
>>
>> diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
>> index 63dd8d8..da09d3d 100644
>> --- a/gcc/config/i386/linux-common.h
>> +++ b/gcc/config/i386/linux-common.h
>> @@ -72,7 +72,7 @@ along with GCC; see the file COPYING3. If not see
>>
>> #ifndef MPX_SPEC
>> #define MPX_SPEC "\
>> - %{mmpx:%{fcheck-pointer-bounds:%{!static:" LINK_MPX "}}}"
>> + %{mmpx:%{fcheck-pointer-bounds:%{!static:%{" SPEC_64 ":" LINK_MPX "}}}}"
>> #endif
>>
>> #ifndef LIBMPX_SPEC
>
> This doesn't build on Linux/ia32:
>
> In file included from ./tm.h:36:0,
> from /export/gnu/import/git/sources/gcc/gcc/gcc.c:34:
> /export/gnu/import/git/sources/gcc/gcc/config/i386/linux-common.h:75:47:
> error: expected ‘,’ or ‘;’ before ‘SPEC_64’
> %{mmpx:%{fcheck-pointer-bounds:%{!static:%{" SPEC_64 ":" LINK_MPX "}}}}"
>
> SPEC_64 may not be defined. You should use
>
> #ifndef MPX_SPEC
> #ifdef SPEC_64
> #define MPX_SPEC "\
> %{mmpx:%{fcheck-pointer-bounds:%{!static:%{" SPEC_64 ":" LINK_MPX "}}}}"
> #else
> #define MPX_SPEC "\
> %{mmpx:%{fcheck-pointer-bounds}}"
> #endif
> #endif
This won't work either.. Here is a working one:
#ifndef MPX_SPEC
#ifdef SPEC_64
#define MPX_SPEC "\
%{mmpx:%{fcheck-pointer-bounds:%{!static:%{" SPEC_64 ":" LINK_MPX "}}}}"
#else
#define MPX_SPEC ""
#endif
#endif
--
H.J.