GCC currently uses -xarch=generic/-xarch=generic64 with Solaris/x86 as
to select either 32 or 64-bit output. However, -xarch isn't even
documented any longer, but still accepted for compatibility. Even for
-xchip, only generic is documented, not generic64.
This patch uses -m32/-m64 instead, which is already used in
gcc/configure.ac.
Bootstrapped without regressions on i386-pc-solaris2.11 and
amd64-pc-solaris2.11.
Committed to trunk.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2026-01-14 Rainer Orth <[email protected]>
gcc:
* config/i386/sol2.h [!HAVE_GNU_AS] (ASM_CPU32_DEFAULT_SPEC): Use -m32.
(ASM_CPU64_DEFAULT_SPEC): Use -m64.
# HG changeset patch
# Parent 76a3d9d250272fdd91590c4dfef368b4fef58fda
Use -m32/-m64 with Solaris/x86 as
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
@@ -59,13 +59,13 @@ along with GCC; see the file COPYING3.
" %{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. */
+ assembler requires -m32 or -m64 instead. */
#if HAVE_GNU_AS
#define ASM_CPU32_DEFAULT_SPEC "--32"
#define ASM_CPU64_DEFAULT_SPEC "--64"
#else
-#define ASM_CPU32_DEFAULT_SPEC "-xarch=generic"
-#define ASM_CPU64_DEFAULT_SPEC "-xarch=generic64"
+#define ASM_CPU32_DEFAULT_SPEC "-m32"
+#define ASM_CPU64_DEFAULT_SPEC "-m64"
#endif
#if !HAVE_GNU_AS