https://gcc.gnu.org/g:dd3ffd00892d6e43621eab29c84741243f03e11e

commit dd3ffd00892d6e43621eab29c84741243f03e11e
Author: Olivier Hainque <[email protected]>
Date:   Fri Oct 24 14:32:51 2025 -0300

    Introduce x86_64-linux-gnum32
    
    Enable a 32-bit "native" toolchain to be built on x86_64-linux-gnu,
    i.e., one that targets -m32 despite running in 64-bit mode.  Neither
    multilibs nor -m64 support are desired for this configuration (a
    multilibbed x86_64-linux-gnu native, defaulting to -m32 through self
    specs would accomplish those).
    
    for  gcc/ChangeLog
    
            * config.gcc [x86_64-*-*]: Match *m32 target, default to m32
            abi and multilib.  Accept 32 or m32 for --with-abi.

Diff:
---
 gcc/config.gcc | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index c678b801f705..8d96ef00005a 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -676,6 +676,29 @@ i[34567]86-*-*)
 x86_64-*-darwin*)
        ;;
 x86_64-*-*)
+        # Pick a default with_abi and with_multilib_list for m32
+        # restricted toolchains
+        case ${target} in
+        *m32)
+               case ${with_abi} in
+               "" | 32 | m32)
+                       with_abi=m32
+                       ;;
+               *)
+                       echo "Invalid --with-abi=$with_abi for m32 target"
+                       exit 1
+              esac
+              case ${with_multilib_list} in
+              default | m32)
+                       with_multilib_list=m32
+                       ;;
+              *)
+                       echo "Invalid multilib list for m32 target"
+                       exit 1
+              esac
+              ;;
+       esac
+
        case ${with_abi} in
        "")
                if test "x$with_multilib_list" = xmx32; then
@@ -690,6 +713,8 @@ x86_64-*-*)
        x32 | mx32)
                tm_file="i386/biarchx32.h ${tm_file}"
                ;;
+       32 | m32)
+               ;;
        *)
                echo "Unknown ABI used in --with-abi=$with_abi"
                exit 1

Reply via email to