The machinery would still consider them as 64-bit targets in a few cases.
Tested on x86-64/Linux, approved by Alex O. privately, and applied on the
mainline. Unless there are objections, I'd like to backport it onto the
16 branch since the abi32 targets are broken there too.
2026-06-19 Eric Botcazou <[email protected]>
* acinclude.m4 (gcc_GAS_FLAGS): Set to --32 for abi32 targets.
* configure.ac (TLS support): Use 32-bit sequence for abi32 targets.
* configure: Regenerate.
--
Eric Botcazoudiff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index 135a66a91ba..354e37791fa 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -511,6 +511,9 @@ AC_DEFUN([gcc_GAS_FLAGS],
x86_64-*-linux-gnux32*)
gcc_cv_as_flags=--x32
;;
+ x86_64-*-linux-gnuabi32 | x86_64-*-mingw32abi32)
+ gcc_cv_as_flags=--32
+ ;;
x86_64-*-* | sparcv9-*-* | sparc64-*-*)
gcc_cv_as_flags=--64
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 4360cb95566..4e8269d03b6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4005,7 +4005,7 @@ changequote(,)dnl
conftest_s='
.section .tdata,"aw'$tls_section_flag'",@progbits'
case "$target" in
- i?86-*-*)
+ i?86-*-* | x86_64-*-linux-gnuabi32 | x86_64-*-mingw32abi32)
tls_as_opt="$tls_as_opt $as_32_opt"
conftest_s="$conftest_s
foo: .long 25