]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc: Support -mcall-ms2sysv-xlogues on FreeBSD/x86
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 29 May 2026 14:24:40 +0000 (16:24 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 29 May 2026 14:24:40 +0000 (16:24 +0200)
With the bulk of the gcc.target/x86_64/abi tests fixed on FreeBSD/amd64,
a couple remain:

FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O2 "-DGEN_ARGS=-p0\ --omit-rbp-clobbers" (test for excess errors)

and five more.  They all fail to link like

gld-2.46: /tmp//ccXprYoX.o: in function `msabi_00_0':
ms-sysv.c:(.text+0x30): undefined reference to `__sse_savms64f_12'

and many more missing symbols.  Those are usually provided in libgcc.a
by i386/t-msabi, so this patch includes them on FreeBSD/x86, too.  As
with the previous fixes, the resms64*.h and savms64*.h files need to
include .note.GNU-stack, too.

Bootstrapped without regressions on amd64-pc-freebsd15.0 with both gld
and /usr/bin/ld (lld), and x86_64-pc-linux-gnu.

2026-03-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libgcc:
* config.host <i[34567]86-*-freebsd*> (tmake_file): Add
i386/t-msabi.
<x86_64-*-freebsd*>: Likewise.
* config/i386/i386-asm.h: Update comment.

* config/i386/resms64.h: Use .note.GNU-stack on FreeBSD, too.
* config/i386/resms64f.h: Likewise.
* config/i386/resms64fx.h: Likewise.
* config/i386/resms64x.h: Likewise.
* config/i386/savms64.h: Likewise.
* config/i386/savms64f.h: Likewise.

libgcc/config.host
libgcc/config/i386/i386-asm.h
libgcc/config/i386/resms64.h
libgcc/config/i386/resms64f.h
libgcc/config/i386/resms64fx.h
libgcc/config/i386/resms64x.h
libgcc/config/i386/savms64.h
libgcc/config/i386/savms64f.h

index cb4c512ada3b82fd1c3e4e1347843631f779c351..046156fa5e786b4391491695703fbfaaa1f3149d 100644 (file)
@@ -766,11 +766,11 @@ x86_64-*-dragonfly*)
        md_unwind_header=i386/dragonfly-unwind.h
        ;;
 i[34567]86-*-freebsd*)
-       tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
+       tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff i386/t-msabi"
        md_unwind_header=i386/freebsd-unwind.h
        ;;
 x86_64-*-freebsd*)
-       tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
+       tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff i386/t-msabi"
        md_unwind_header=i386/freebsd-unwind.h
        ;;
 i[34567]86-*-netbsdelf*)
index e761cba64ab6e2af134a01bade708c61019acb3f..091547dd6476b775565d9ed97be922e4dc76aced 100644 (file)
@@ -58,7 +58,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define PASTE2(a, b) PASTE2a(a, b)
 #define PASTE2a(a, b) a ## b
 
-/* These macros currently support GNU/Linux, Solaris and Darwin.  */
+/* These macros currently support GNU/Linux, Solaris, FreeBSD, and Darwin.  */
 
 #ifdef __ELF__
 # define FN_TYPE(fn) .type fn,@function
index 380c2c7193ba48f4fa7b8c3fbf52ee9074d053bc..8785fafb7d95fd5350d356308906cafeefb3249f 100644 (file)
@@ -58,7 +58,7 @@ MS2SYSV_STUB_END(resms64_18)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif
index d098b0f91e0e46e49353a645ff52ae710bc01321..b78c3cd09473099b39c163372f6e69f6f93b2874 100644 (file)
@@ -56,7 +56,7 @@ MS2SYSV_STUB_END(resms64f_17)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif
index 698de382c895889daf14f5893528f7c76f097d44..45817b19af550c23892184ca1b09afa2bd670cfa 100644 (file)
@@ -63,7 +63,7 @@ MS2SYSV_STUB_END(resms64fx_17)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif
index 39e42c8e0aab1ebd492e76fef434282b97c1036d..23dc3a5ee43a208995f7d1db3c51021fc03d46f5 100644 (file)
@@ -64,7 +64,7 @@ MS2SYSV_STUB_END(resms64x_18)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif
index 8ae8f12606ac4c3834ec2748af9795bb1efb7c03..2331f06f132160cdbafbc51f6183cf7f492eae7b 100644 (file)
@@ -58,7 +58,7 @@ MS2SYSV_STUB_END(savms64_18)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif
index 9bdd3c9944ebbe9f414c165ca6f2620d9882505d..0a9ec8e0827c4339f258165bf113aedae97a6cee 100644 (file)
@@ -56,7 +56,7 @@ MS2SYSV_STUB_END(savms64f_17)
 
 #endif /* __x86_64__ */
 
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__))
        .section .note.GNU-stack,"",@progbits
        .previous
 #endif