https://gcc.gnu.org/g:224b568580ac7717733caa9784232cda2cb47b98

commit 224b568580ac7717733caa9784232cda2cb47b98
Author: Alexandre Oliva <[email protected]>
Date:   Mon Nov 17 21:03:15 2025 -0300

    set up gnattools to use -cross

Diff:
---
 gnattools/configure    | 10 ++++++++++
 gnattools/configure.ac | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/gnattools/configure b/gnattools/configure
index b3b6aab1b72e..a089a034ca16 100755
--- a/gnattools/configure
+++ b/gnattools/configure
@@ -3683,6 +3683,16 @@ fi
 # ../gcc/ada/gcc-interface/config-lang.in as well.
 if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then
   default_gnattools_target="gnattools-native"
+  # When natively-building x86_64-*-gnum32 tools without bootstrap,
+  # use the native toolchain to build gnattools, expecting its
+  # libraries to be compatible with whichever multilib was used to
+  # build other tools.  This requires the compiler being built to be
+  # gnatbind-compatible with the one used for the build.
+  case $enable_bootstrap/$target in
+    no/x86_64-*-gnum32)
+      default_gnattools_target="gnattools-cross"
+      ;;
+  esac
 else
   default_gnattools_target="gnattools-cross"
 fi
diff --git a/gnattools/configure.ac b/gnattools/configure.ac
index ff07179b3ba8..adbdc8996db6 100644
--- a/gnattools/configure.ac
+++ b/gnattools/configure.ac
@@ -125,6 +125,16 @@ AC_SUBST(LD_PICFLAG)
 # ../gcc/ada/gcc-interface/config-lang.in as well.
 if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then
   default_gnattools_target="gnattools-native"
+  # When natively-building x86_64-*-gnum32 tools without bootstrap,
+  # use the native toolchain to build gnattools, expecting its
+  # libraries to be compatible with whichever multilib was used to
+  # build other tools.  This requires the compiler being built to be
+  # gnatbind-compatible with the one used for the build.
+  case $enable_bootstrap/$target in
+    no/x86_64-*-gnum32)
+      default_gnattools_target="gnattools-cross"
+      ;;
+  esac
 else
   default_gnattools_target="gnattools-cross"
 fi

Reply via email to