Inspired by one of Iain's patches for PR target/82920, this patch rejects -mx32 on Solaris/x86, too: x32 won't be implemented on Solaris and the failure if one tries to use it isn't very helpful otherwise:
$ gcc -mx32 -o hello hello.c In file included from /vol/gcc-9/lib/gcc/i386-pc-solaris2.11/9.1.0/include-fixed/sys/feature_tests.h:32, from /vol/gcc-9/lib/gcc/i386-pc-solaris2.11/9.1.0/include-fixed/stdio.h:24, from hello.c:1: /usr/include/sys/isa_defs.h:461:2: error: #error "Both _ILP32 and _LP64 are defined" 461 | #error "Both _ILP32 and _LP64 are defined" | ^~~~~ Bootstrapped without regressions on i386-pc-solaris2.11, installed on mainline. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2019-05-19 Rainer Orth <r...@cebitec.uni-bielefeld.de> * config/i386/sol2.h (CC1_SPEC): Reject -mx32.
# HG changeset patch # Parent d206c777312bc2a8211d734e485031f191dce352 Reject -mx32 on Solaris/x86 diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -55,7 +55,8 @@ along with GCC; see the file COPYING3. #define CPP_SPEC "%(cpp_subtarget)" #undef CC1_SPEC -#define CC1_SPEC "%(cc1_cpu) " ASAN_CC1_SPEC +#define CC1_SPEC "%(cc1_cpu) " ASAN_CC1_SPEC \ + " %{mx32:%e-mx32 is not supported on Solaris}" /* GNU as understands --32 and --64, but the native Solaris assembler requires -xarch=generic or -xarch=generic64 instead. */