https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Ilya Enkovich from comment #4) > OK then. Testing this patch now: > > diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h > index 63dd8d8..232acea 100644 > --- a/gcc/config/i386/linux-common.h > +++ b/gcc/config/i386/linux-common.h > @@ -70,9 +70,15 @@ along with GCC; see the file COPYING3. If not see > #endif > #endif > > +#if TARGET_64BIT_DEFAULT > +#define MPX_ARCH_64 "!m32:" > +#else > +#define MPX_ARCH_64 "m64:" > +#endif > + > #ifndef MPX_SPEC > #define MPX_SPEC "\ > - %{mmpx:%{fcheck-pointer-bounds:%{!static:" LINK_MPX "}}}" > + %{mmpx:%{fcheck-pointer-bounds:%{!static:%{" MPX_ARCH_64 LINK_MPX "}}}}" > #endif > > #ifndef LIBMPX_SPEC I don't think it is correct. Please see SPEC_64 and SPEC_32 defined in gnu-user64.h. You should define MPX_SPEC with SPEC_64 and SPEC_32.