Page MenuHomeFreeBSD

D58116.id181573.diff
No OneTemporary

D58116.id181573.diff

diff --git a/lang/gcc12/files/patch-gcc_config_rs6000_rs6000.cc b/lang/gcc12/files/patch-gcc_config_rs6000_rs6000.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc12/files/patch-gcc_config_rs6000_rs6000.cc
@@ -0,0 +1,10 @@
+--- gcc/config/rs6000/rs6000.cc.orig
++++ gcc/config/rs6000/rs6000.cc
+@@ -28124,6 +28124,7 @@
+
+ /* Map long double built-in functions if long double is IEEE 128-bit. */
+ if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
++ && glibc_supports_ieee_128bit ()
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_IS_UNDECLARED_BUILTIN (decl)
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
diff --git a/lang/gcc12/files/patch-gcc_fortran_trans-types.cc b/lang/gcc12/files/patch-gcc_fortran_trans-types.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc12/files/patch-gcc_fortran_trans-types.cc
@@ -0,0 +1,12 @@
+--- gcc/fortran/trans-types.cc.orig
++++ gcc/fortran/trans-types.cc
+@@ -512,7 +512,8 @@
+ precision. For libgfortran calls pretend the IEEE 754 quad TFmode has
+ kind 17 rather than 16 and use kind 16 for the IBM extended format
+ TFmode. */
+- if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode))
++ if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode)
++ && TARGET_GLIBC_MAJOR >= 2)
+ {
+ for (int i = 0; i < r_index; ++i)
+ if (gfc_real_kinds[i].kind == 16)
diff --git a/lang/gcc12/files/patch-libgcc_config.host b/lang/gcc12/files/patch-libgcc_config.host
--- a/lang/gcc12/files/patch-libgcc_config.host
+++ b/lang/gcc12/files/patch-libgcc_config.host
@@ -5,7 +5,7 @@
tmake_file="${tmake_file} rs6000/t-freebsd64"
md_unwind_header=rs6000/freebsd-unwind.h
+ if test $libgcc_cv_powerpc_float128 = yes; then
-+ tmake_file="${tmake_file} rs6000/t-float128"
++ tmake_file="${tmake_file} rs6000/t-float128 rs6000/t-float128-freebsd"
+ fi
+ if test $libgcc_cv_powerpc_float128_hw = yes; then
+ tmake_file="${tmake_file} rs6000/t-float128-hw"
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h b/lang/gcc12/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy from lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy to lang/gcc12/files/patch-libgcc_config_rs6000_freebsd-unwind.h
--- a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
+++ b/lang/gcc12/files/patch-libgcc_config_rs6000_freebsd-unwind.h
@@ -1,18 +1,21 @@
---- libgcc/config/rs6000/freebsd-unwind.h.orig
+--- libgcc/config/rs6000/freebsd-unwind.h.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config/rs6000/freebsd-unwind.h
-@@ -33,6 +33,11 @@
- const unsigned int *pc = (const unsigned int *) context->ra;
+@@ -24,6 +24,14 @@
- #ifdef __powerpc64__
+ #define R_LR 65
+
++#ifdef __powerpc64__
+#if _CALL_ELF == 2
+#define TOC_SAVE_SLOT 24
+#else
+#define TOC_SAVE_SLOT 40
+#endif
- if (fs->regs.how[2] == REG_UNSAVED)
- {
- /* If the current unwind info (FS) does not contain explicit info
-@@ -40,9 +45,9 @@
++#endif
++
+ #define MD_FROB_UPDATE_CONTEXT frob_update_context
+
+ static void
+@@ -40,9 +48,9 @@ frob_update_context (struct _Unwind_Context *context,
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
@@ -24,7 +27,7 @@
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
-@@ -51,17 +56,17 @@
+@@ -51,17 +59,17 @@ frob_update_context (struct _Unwind_Context *context,
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
diff --git a/lang/gcc12/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver b/lang/gcc12/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
new file mode 100644
--- /dev/null
+++ b/lang/gcc12/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
@@ -0,0 +1,38 @@
+--- /dev/null
++++ libgcc/config/rs6000/libgcc-freebsd-float128.ver
+@@ -0,0 +1,35 @@
++# IEEE-128 (__float128 / KFmode) software helpers exported from libgcc_s.so on
++# FreeBSD, where there is no float128 IFUNC. Attached to GCC_7.0.0, the version
++# where PowerPC __float128 support was introduced.
++GCC_7.0.0 {
++ __addkf3
++ __subkf3
++ __mulkf3
++ __divkf3
++ __negkf2
++ __unordkf2
++ __eqkf2
++ __gekf2
++ __lekf2
++ __extendsfkf2
++ __extenddfkf2
++ __trunckfsf2
++ __trunckfdf2
++ __fixkfsi
++ __fixkfdi
++ __fixunskfsi
++ __fixunskfdi
++ __floatsikf
++ __floatdikf
++ __floatunsikf
++ __floatundikf
++ __floattikf
++ __floatuntikf
++ __fixkfti
++ __fixunskfti
++ __extendkftf2
++ __trunctfkf2
++ __mulkc3
++ __divkc3
++ __powikf2
++}
diff --git a/lang/gcc12/files/patch-libgcc_config_rs6000_t-float128-freebsd b/lang/gcc12/files/patch-libgcc_config_rs6000_t-float128-freebsd
new file mode 100644
--- /dev/null
+++ b/lang/gcc12/files/patch-libgcc_config_rs6000_t-float128-freebsd
@@ -0,0 +1,18 @@
+--- /dev/null
++++ libgcc/config/rs6000/t-float128-freebsd
+@@ -0,0 +1,15 @@
++# On FreeBSD there is no float128 IFUNC (rs6000/t-float128-hw needs the Linux
++# AT_PLATFORM auxv entry, absent on FreeBSD), so the software __float128/KFmode
++# helpers built by rs6000/t-float128 would only land in the static libgcc.a
++# (hidden) via LIB2ADD_ST. Put them in the shared libgcc_s.so and export them
++# (see libgcc-freebsd-float128.ver) so gcc-built DSOs -- notably libstdc++.so,
++# which references e.g. __eqkf2 for IEEE-128 long double -- resolve them.
++#
++# Exclude __mulkc3/__divkc3: under -mabi=ieeelongdouble libgcc2.c's __multc3/
++# __divtc3 are already mangled to those names in libgcc_s.so, so adding rs6000's
++# own copies to the shared library would multiply-define them. They stay
++# static-only; the .ver exports the libgcc2.c-provided ones.
++fp128_shared_src := $(filter-out %/_mulkc3.c %/_divkc3.c,$(fp128_src))
++LIB2ADD_ST := $(filter-out $(fp128_shared_src),$(LIB2ADD_ST))
++LIB2ADD += $(fp128_shared_src)
++SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-freebsd-float128.ver
diff --git a/lang/gcc12/files/patch-libgcc_configure b/lang/gcc12/files/patch-libgcc_configure
new file mode 100644
--- /dev/null
+++ b/lang/gcc12/files/patch-libgcc_configure
@@ -0,0 +1,19 @@
+--- libgcc/configure.orig
++++ libgcc/configure
+@@ -5216,7 +5216,7 @@
+ # check if we have VSX (ISA 2.06) support to build the software libraries, and
+ # whether the assembler can handle xsaddqp for hardware support. Also check if
+ # a new glibc is being used so that __builtin_cpu_supports can be used.
+-powerpc*-*-linux*)
++powerpc*-*-linux* | powerpc*-*-freebsd*)
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+@@ -5227,6 +5227,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ vector double dadd (vector double a, vector double b) { return a + b; }
++__ibm128 conftest_ibm128;
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ libgcc_cv_powerpc_float128=yes
diff --git a/lang/gcc13/files/patch-gcc_config_rs6000_rs6000.cc b/lang/gcc13/files/patch-gcc_config_rs6000_rs6000.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc13/files/patch-gcc_config_rs6000_rs6000.cc
@@ -0,0 +1,10 @@
+--- gcc/config/rs6000/rs6000.cc.orig
++++ gcc/config/rs6000/rs6000.cc
+@@ -28283,6 +28283,7 @@
+
+ /* Map long double built-in functions if long double is IEEE 128-bit. */
+ if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
++ && glibc_supports_ieee_128bit ()
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_IS_UNDECLARED_BUILTIN (decl)
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
diff --git a/lang/gcc13/files/patch-gcc_fortran_trans-types.cc b/lang/gcc13/files/patch-gcc_fortran_trans-types.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc13/files/patch-gcc_fortran_trans-types.cc
@@ -0,0 +1,12 @@
+--- gcc/fortran/trans-types.cc.orig
++++ gcc/fortran/trans-types.cc
+@@ -513,7 +513,8 @@
+ precision. For libgfortran calls pretend the IEEE 754 quad TFmode has
+ kind 17 rather than 16 and use kind 16 for the IBM extended format
+ TFmode. */
+- if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode))
++ if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode)
++ && TARGET_GLIBC_MAJOR >= 2)
+ {
+ for (int i = 0; i < r_index; ++i)
+ if (gfc_real_kinds[i].kind == 16)
diff --git a/lang/gcc13/files/patch-libgcc_config.host b/lang/gcc13/files/patch-libgcc_config.host
--- a/lang/gcc13/files/patch-libgcc_config.host
+++ b/lang/gcc13/files/patch-libgcc_config.host
@@ -5,7 +5,7 @@
tmake_file="${tmake_file} rs6000/t-freebsd64"
md_unwind_header=rs6000/freebsd-unwind.h
+ if test $libgcc_cv_powerpc_float128 = yes; then
-+ tmake_file="${tmake_file} rs6000/t-float128"
++ tmake_file="${tmake_file} rs6000/t-float128 rs6000/t-float128-freebsd"
+ fi
+ if test $libgcc_cv_powerpc_float128_hw = yes; then
+ tmake_file="${tmake_file} rs6000/t-float128-hw"
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h b/lang/gcc13/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy from lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy to lang/gcc13/files/patch-libgcc_config_rs6000_freebsd-unwind.h
--- a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
+++ b/lang/gcc13/files/patch-libgcc_config_rs6000_freebsd-unwind.h
@@ -1,18 +1,21 @@
---- libgcc/config/rs6000/freebsd-unwind.h.orig
+--- libgcc/config/rs6000/freebsd-unwind.h.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config/rs6000/freebsd-unwind.h
-@@ -33,6 +33,11 @@
- const unsigned int *pc = (const unsigned int *) context->ra;
+@@ -24,6 +24,14 @@
- #ifdef __powerpc64__
+ #define R_LR 65
+
++#ifdef __powerpc64__
+#if _CALL_ELF == 2
+#define TOC_SAVE_SLOT 24
+#else
+#define TOC_SAVE_SLOT 40
+#endif
- if (fs->regs.how[2] == REG_UNSAVED)
- {
- /* If the current unwind info (FS) does not contain explicit info
-@@ -40,9 +45,9 @@
++#endif
++
+ #define MD_FROB_UPDATE_CONTEXT frob_update_context
+
+ static void
+@@ -40,9 +48,9 @@ frob_update_context (struct _Unwind_Context *context,
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
@@ -24,7 +27,7 @@
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
-@@ -51,17 +56,17 @@
+@@ -51,17 +59,17 @@ frob_update_context (struct _Unwind_Context *context,
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
diff --git a/lang/gcc13/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver b/lang/gcc13/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
new file mode 100644
--- /dev/null
+++ b/lang/gcc13/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
@@ -0,0 +1,38 @@
+--- /dev/null
++++ libgcc/config/rs6000/libgcc-freebsd-float128.ver
+@@ -0,0 +1,35 @@
++# IEEE-128 (__float128 / KFmode) software helpers exported from libgcc_s.so on
++# FreeBSD, where there is no float128 IFUNC. Attached to GCC_7.0.0, the version
++# where PowerPC __float128 support was introduced.
++GCC_7.0.0 {
++ __addkf3
++ __subkf3
++ __mulkf3
++ __divkf3
++ __negkf2
++ __unordkf2
++ __eqkf2
++ __gekf2
++ __lekf2
++ __extendsfkf2
++ __extenddfkf2
++ __trunckfsf2
++ __trunckfdf2
++ __fixkfsi
++ __fixkfdi
++ __fixunskfsi
++ __fixunskfdi
++ __floatsikf
++ __floatdikf
++ __floatunsikf
++ __floatundikf
++ __floattikf
++ __floatuntikf
++ __fixkfti
++ __fixunskfti
++ __extendkftf2
++ __trunctfkf2
++ __mulkc3
++ __divkc3
++ __powikf2
++}
diff --git a/lang/gcc13/files/patch-libgcc_config_rs6000_t-float128-freebsd b/lang/gcc13/files/patch-libgcc_config_rs6000_t-float128-freebsd
new file mode 100644
--- /dev/null
+++ b/lang/gcc13/files/patch-libgcc_config_rs6000_t-float128-freebsd
@@ -0,0 +1,18 @@
+--- /dev/null
++++ libgcc/config/rs6000/t-float128-freebsd
+@@ -0,0 +1,15 @@
++# On FreeBSD there is no float128 IFUNC (rs6000/t-float128-hw needs the Linux
++# AT_PLATFORM auxv entry, absent on FreeBSD), so the software __float128/KFmode
++# helpers built by rs6000/t-float128 would only land in the static libgcc.a
++# (hidden) via LIB2ADD_ST. Put them in the shared libgcc_s.so and export them
++# (see libgcc-freebsd-float128.ver) so gcc-built DSOs -- notably libstdc++.so,
++# which references e.g. __eqkf2 for IEEE-128 long double -- resolve them.
++#
++# Exclude __mulkc3/__divkc3: under -mabi=ieeelongdouble libgcc2.c's __multc3/
++# __divtc3 are already mangled to those names in libgcc_s.so, so adding rs6000's
++# own copies to the shared library would multiply-define them. They stay
++# static-only; the .ver exports the libgcc2.c-provided ones.
++fp128_shared_src := $(filter-out %/_mulkc3.c %/_divkc3.c,$(fp128_src))
++LIB2ADD_ST := $(filter-out $(fp128_shared_src),$(LIB2ADD_ST))
++LIB2ADD += $(fp128_shared_src)
++SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-freebsd-float128.ver
diff --git a/lang/gcc13/files/patch-libgcc_configure b/lang/gcc13/files/patch-libgcc_configure
new file mode 100644
--- /dev/null
+++ b/lang/gcc13/files/patch-libgcc_configure
@@ -0,0 +1,19 @@
+--- libgcc/configure.orig
++++ libgcc/configure
+@@ -5217,7 +5217,7 @@
+ # check if we have VSX (ISA 2.06) support to build the software libraries, and
+ # whether the assembler can handle xsaddqp for hardware support. Also check if
+ # a new glibc is being used so that __builtin_cpu_supports can be used.
+-powerpc*-*-linux*)
++powerpc*-*-linux* | powerpc*-*-freebsd*)
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+@@ -5228,6 +5228,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ vector double dadd (vector double a, vector double b) { return a + b; }
++__ibm128 conftest_ibm128;
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ libgcc_cv_powerpc_float128=yes
diff --git a/lang/gcc14/files/patch-gcc_config_rs6000_rs6000.cc b/lang/gcc14/files/patch-gcc_config_rs6000_rs6000.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc14/files/patch-gcc_config_rs6000_rs6000.cc
@@ -0,0 +1,10 @@
+--- gcc/config/rs6000/rs6000.cc.orig
++++ gcc/config/rs6000/rs6000.cc
+@@ -28563,6 +28563,7 @@
+
+ /* Map long double built-in functions if long double is IEEE 128-bit. */
+ if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
++ && glibc_supports_ieee_128bit ()
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_IS_UNDECLARED_BUILTIN (decl)
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
diff --git a/lang/gcc14/files/patch-gcc_fortran_trans-types.cc b/lang/gcc14/files/patch-gcc_fortran_trans-types.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc14/files/patch-gcc_fortran_trans-types.cc
@@ -0,0 +1,12 @@
+--- gcc/fortran/trans-types.cc.orig
++++ gcc/fortran/trans-types.cc
+@@ -513,7 +513,8 @@
+ precision. For libgfortran calls pretend the IEEE 754 quad TFmode has
+ kind 17 rather than 16 and use kind 16 for the IBM extended format
+ TFmode. */
+- if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode))
++ if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode)
++ && TARGET_GLIBC_MAJOR >= 2)
+ {
+ for (int i = 0; i < r_index; ++i)
+ if (gfc_real_kinds[i].kind == 16)
diff --git a/lang/gcc14/files/patch-libgcc_config.host b/lang/gcc14/files/patch-libgcc_config.host
--- a/lang/gcc14/files/patch-libgcc_config.host
+++ b/lang/gcc14/files/patch-libgcc_config.host
@@ -5,7 +5,7 @@
tmake_file="${tmake_file} rs6000/t-freebsd64"
md_unwind_header=rs6000/freebsd-unwind.h
+ if test $libgcc_cv_powerpc_float128 = yes; then
-+ tmake_file="${tmake_file} rs6000/t-float128"
++ tmake_file="${tmake_file} rs6000/t-float128 rs6000/t-float128-freebsd"
+ fi
+ if test $libgcc_cv_powerpc_float128_hw = yes; then
+ tmake_file="${tmake_file} rs6000/t-float128-hw"
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h b/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
--- a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
+++ b/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
@@ -1,18 +1,21 @@
---- libgcc/config/rs6000/freebsd-unwind.h.orig
+--- libgcc/config/rs6000/freebsd-unwind.h.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config/rs6000/freebsd-unwind.h
-@@ -33,6 +33,11 @@
- const unsigned int *pc = (const unsigned int *) context->ra;
+@@ -24,6 +24,14 @@
- #ifdef __powerpc64__
+ #define R_LR 65
+
++#ifdef __powerpc64__
+#if _CALL_ELF == 2
+#define TOC_SAVE_SLOT 24
+#else
+#define TOC_SAVE_SLOT 40
+#endif
- if (fs->regs.how[2] == REG_UNSAVED)
- {
- /* If the current unwind info (FS) does not contain explicit info
-@@ -40,9 +45,9 @@
++#endif
++
+ #define MD_FROB_UPDATE_CONTEXT frob_update_context
+
+ static void
+@@ -40,9 +48,9 @@ frob_update_context (struct _Unwind_Context *context,
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
@@ -24,7 +27,7 @@
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
-@@ -51,17 +56,17 @@
+@@ -51,17 +59,17 @@ frob_update_context (struct _Unwind_Context *context,
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver b/lang/gcc14/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
new file mode 100644
--- /dev/null
+++ b/lang/gcc14/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
@@ -0,0 +1,38 @@
+--- /dev/null
++++ libgcc/config/rs6000/libgcc-freebsd-float128.ver
+@@ -0,0 +1,35 @@
++# IEEE-128 (__float128 / KFmode) software helpers exported from libgcc_s.so on
++# FreeBSD, where there is no float128 IFUNC. Attached to GCC_7.0.0, the version
++# where PowerPC __float128 support was introduced.
++GCC_7.0.0 {
++ __addkf3
++ __subkf3
++ __mulkf3
++ __divkf3
++ __negkf2
++ __unordkf2
++ __eqkf2
++ __gekf2
++ __lekf2
++ __extendsfkf2
++ __extenddfkf2
++ __trunckfsf2
++ __trunckfdf2
++ __fixkfsi
++ __fixkfdi
++ __fixunskfsi
++ __fixunskfdi
++ __floatsikf
++ __floatdikf
++ __floatunsikf
++ __floatundikf
++ __floattikf
++ __floatuntikf
++ __fixkfti
++ __fixunskfti
++ __extendkftf2
++ __trunctfkf2
++ __mulkc3
++ __divkc3
++ __powikf2
++}
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_t-float128-freebsd b/lang/gcc14/files/patch-libgcc_config_rs6000_t-float128-freebsd
new file mode 100644
--- /dev/null
+++ b/lang/gcc14/files/patch-libgcc_config_rs6000_t-float128-freebsd
@@ -0,0 +1,18 @@
+--- /dev/null
++++ libgcc/config/rs6000/t-float128-freebsd
+@@ -0,0 +1,15 @@
++# On FreeBSD there is no float128 IFUNC (rs6000/t-float128-hw needs the Linux
++# AT_PLATFORM auxv entry, absent on FreeBSD), so the software __float128/KFmode
++# helpers built by rs6000/t-float128 would only land in the static libgcc.a
++# (hidden) via LIB2ADD_ST. Put them in the shared libgcc_s.so and export them
++# (see libgcc-freebsd-float128.ver) so gcc-built DSOs -- notably libstdc++.so,
++# which references e.g. __eqkf2 for IEEE-128 long double -- resolve them.
++#
++# Exclude __mulkc3/__divkc3: under -mabi=ieeelongdouble libgcc2.c's __multc3/
++# __divtc3 are already mangled to those names in libgcc_s.so, so adding rs6000's
++# own copies to the shared library would multiply-define them. They stay
++# static-only; the .ver exports the libgcc2.c-provided ones.
++fp128_shared_src := $(filter-out %/_mulkc3.c %/_divkc3.c,$(fp128_src))
++LIB2ADD_ST := $(filter-out $(fp128_shared_src),$(LIB2ADD_ST))
++LIB2ADD += $(fp128_shared_src)
++SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-freebsd-float128.ver
diff --git a/lang/gcc14/files/patch-libgcc_configure b/lang/gcc14/files/patch-libgcc_configure
new file mode 100644
--- /dev/null
+++ b/lang/gcc14/files/patch-libgcc_configure
@@ -0,0 +1,19 @@
+--- libgcc/configure.orig
++++ libgcc/configure
+@@ -5216,7 +5216,7 @@
+ # check if we have VSX (ISA 2.06) support to build the software libraries, and
+ # whether the assembler can handle xsaddqp for hardware support. Also check if
+ # a new glibc is being used so that __builtin_cpu_supports can be used.
+-powerpc*-*-linux*)
++powerpc*-*-linux* | powerpc*-*-freebsd*)
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+@@ -5227,6 +5227,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ vector double dadd (vector double a, vector double b) { return a + b; }
++__ibm128 conftest_ibm128;
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ libgcc_cv_powerpc_float128=yes
diff --git a/lang/gcc15/files/patch-gcc_config_rs6000_rs6000.cc b/lang/gcc15/files/patch-gcc_config_rs6000_rs6000.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc15/files/patch-gcc_config_rs6000_rs6000.cc
@@ -0,0 +1,10 @@
+--- gcc/config/rs6000/rs6000.cc.orig
++++ gcc/config/rs6000/rs6000.cc
+@@ -28581,6 +28581,7 @@
+
+ /* Map long double built-in functions if long double is IEEE 128-bit. */
+ if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
++ && glibc_supports_ieee_128bit ()
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_IS_UNDECLARED_BUILTIN (decl)
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
diff --git a/lang/gcc15/files/patch-gcc_fortran_trans-types.cc b/lang/gcc15/files/patch-gcc_fortran_trans-types.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc15/files/patch-gcc_fortran_trans-types.cc
@@ -0,0 +1,12 @@
+--- gcc/fortran/trans-types.cc.orig
++++ gcc/fortran/trans-types.cc
+@@ -595,7 +595,8 @@
+ precision. For libgfortran calls pretend the IEEE 754 quad TFmode has
+ kind 17 rather than 16 and use kind 16 for the IBM extended format
+ TFmode. */
+- if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode))
++ if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode)
++ && TARGET_GLIBC_MAJOR >= 2)
+ {
+ for (int i = 0; i < r_index; ++i)
+ if (gfc_real_kinds[i].kind == 16)
diff --git a/lang/gcc15/files/patch-libgcc_config.host b/lang/gcc15/files/patch-libgcc_config.host
--- a/lang/gcc15/files/patch-libgcc_config.host
+++ b/lang/gcc15/files/patch-libgcc_config.host
@@ -5,7 +5,7 @@
tmake_file="${tmake_file} rs6000/t-freebsd64"
md_unwind_header=rs6000/freebsd-unwind.h
+ if test $libgcc_cv_powerpc_float128 = yes; then
-+ tmake_file="${tmake_file} rs6000/t-float128"
++ tmake_file="${tmake_file} rs6000/t-float128 rs6000/t-float128-freebsd"
+ fi
+ if test $libgcc_cv_powerpc_float128_hw = yes; then
+ tmake_file="${tmake_file} rs6000/t-float128-hw"
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h b/lang/gcc15/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy from lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy to lang/gcc15/files/patch-libgcc_config_rs6000_freebsd-unwind.h
--- a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
+++ b/lang/gcc15/files/patch-libgcc_config_rs6000_freebsd-unwind.h
@@ -1,18 +1,21 @@
---- libgcc/config/rs6000/freebsd-unwind.h.orig
+--- libgcc/config/rs6000/freebsd-unwind.h.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config/rs6000/freebsd-unwind.h
-@@ -33,6 +33,11 @@
- const unsigned int *pc = (const unsigned int *) context->ra;
+@@ -24,6 +24,14 @@
- #ifdef __powerpc64__
+ #define R_LR 65
+
++#ifdef __powerpc64__
+#if _CALL_ELF == 2
+#define TOC_SAVE_SLOT 24
+#else
+#define TOC_SAVE_SLOT 40
+#endif
- if (fs->regs.how[2] == REG_UNSAVED)
- {
- /* If the current unwind info (FS) does not contain explicit info
-@@ -40,9 +45,9 @@
++#endif
++
+ #define MD_FROB_UPDATE_CONTEXT frob_update_context
+
+ static void
+@@ -40,9 +48,9 @@ frob_update_context (struct _Unwind_Context *context,
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
@@ -24,7 +27,7 @@
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
-@@ -51,17 +56,17 @@
+@@ -51,17 +59,17 @@ frob_update_context (struct _Unwind_Context *context,
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
diff --git a/lang/gcc15/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver b/lang/gcc15/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
new file mode 100644
--- /dev/null
+++ b/lang/gcc15/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
@@ -0,0 +1,38 @@
+--- /dev/null
++++ libgcc/config/rs6000/libgcc-freebsd-float128.ver
+@@ -0,0 +1,35 @@
++# IEEE-128 (__float128 / KFmode) software helpers exported from libgcc_s.so on
++# FreeBSD, where there is no float128 IFUNC. Attached to GCC_7.0.0, the version
++# where PowerPC __float128 support was introduced.
++GCC_7.0.0 {
++ __addkf3
++ __subkf3
++ __mulkf3
++ __divkf3
++ __negkf2
++ __unordkf2
++ __eqkf2
++ __gekf2
++ __lekf2
++ __extendsfkf2
++ __extenddfkf2
++ __trunckfsf2
++ __trunckfdf2
++ __fixkfsi
++ __fixkfdi
++ __fixunskfsi
++ __fixunskfdi
++ __floatsikf
++ __floatdikf
++ __floatunsikf
++ __floatundikf
++ __floattikf
++ __floatuntikf
++ __fixkfti
++ __fixunskfti
++ __extendkftf2
++ __trunctfkf2
++ __mulkc3
++ __divkc3
++ __powikf2
++}
diff --git a/lang/gcc15/files/patch-libgcc_config_rs6000_t-float128-freebsd b/lang/gcc15/files/patch-libgcc_config_rs6000_t-float128-freebsd
new file mode 100644
--- /dev/null
+++ b/lang/gcc15/files/patch-libgcc_config_rs6000_t-float128-freebsd
@@ -0,0 +1,18 @@
+--- /dev/null
++++ libgcc/config/rs6000/t-float128-freebsd
+@@ -0,0 +1,15 @@
++# On FreeBSD there is no float128 IFUNC (rs6000/t-float128-hw needs the Linux
++# AT_PLATFORM auxv entry, absent on FreeBSD), so the software __float128/KFmode
++# helpers built by rs6000/t-float128 would only land in the static libgcc.a
++# (hidden) via LIB2ADD_ST. Put them in the shared libgcc_s.so and export them
++# (see libgcc-freebsd-float128.ver) so gcc-built DSOs -- notably libstdc++.so,
++# which references e.g. __eqkf2 for IEEE-128 long double -- resolve them.
++#
++# Exclude __mulkc3/__divkc3: under -mabi=ieeelongdouble libgcc2.c's __multc3/
++# __divtc3 are already mangled to those names in libgcc_s.so, so adding rs6000's
++# own copies to the shared library would multiply-define them. They stay
++# static-only; the .ver exports the libgcc2.c-provided ones.
++fp128_shared_src := $(filter-out %/_mulkc3.c %/_divkc3.c,$(fp128_src))
++LIB2ADD_ST := $(filter-out $(fp128_shared_src),$(LIB2ADD_ST))
++LIB2ADD += $(fp128_shared_src)
++SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-freebsd-float128.ver
diff --git a/lang/gcc15/files/patch-libgcc_configure b/lang/gcc15/files/patch-libgcc_configure
new file mode 100644
--- /dev/null
+++ b/lang/gcc15/files/patch-libgcc_configure
@@ -0,0 +1,19 @@
+--- libgcc/configure.orig
++++ libgcc/configure
+@@ -5185,7 +5185,7 @@
+ # check if we have VSX (ISA 2.06) support to build the software libraries, and
+ # whether the assembler can handle xsaddqp for hardware support. Also check if
+ # a new glibc is being used so that __builtin_cpu_supports can be used.
+-powerpc*-*-linux*)
++powerpc*-*-linux* | powerpc*-*-freebsd*)
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+@@ -5196,6 +5196,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ vector double dadd (vector double a, vector double b) { return a + b; }
++__ibm128 conftest_ibm128;
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ libgcc_cv_powerpc_float128=yes
diff --git a/lang/gcc16/files/patch-gcc_Makefile.in b/lang/gcc16/files/patch-gcc_Makefile.in
--- a/lang/gcc16/files/patch-gcc_Makefile.in
+++ b/lang/gcc16/files/patch-gcc_Makefile.in
@@ -1,6 +1,6 @@
---- gcc/Makefile.in.orig 2024-02-25 22:32:27 UTC
+--- gcc/Makefile.in.orig 2026-04-30 08:33:20 UTC
+++ gcc/Makefile.in
-@@ -671,6 +671,8 @@ libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/
+@@ -683,6 +683,8 @@ libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/
# Directory in which the compiler finds libraries etc.
libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
@@ -9,7 +9,7 @@
# Directory in which the compiler finds executables
libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
# Directory in which all plugin resources are installed
-@@ -3821,6 +3823,7 @@ installdirs:
+@@ -4135,6 +4137,7 @@ installdirs:
# $(libdir)/gcc/include isn't currently searched by cpp.
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libsubdir)
diff --git a/lang/gcc16/files/patch-gcc_config.gcc b/lang/gcc16/files/patch-gcc_config.gcc
--- a/lang/gcc16/files/patch-gcc_config.gcc
+++ b/lang/gcc16/files/patch-gcc_config.gcc
@@ -1,6 +1,6 @@
---- gcc/config.gcc.orig
+--- gcc/config.gcc.orig 2026-04-30 08:33:20 UTC
+++ gcc/config.gcc
-@@ -3071,7 +3071,10 @@
+@@ -3071,7 +3071,10 @@ powerpc*-*-freebsd*)
tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
case ${target} in
powerpc*le-*-*)
diff --git a/lang/gcc16/files/patch-gcc_config_rs6000_rs6000.cc b/lang/gcc16/files/patch-gcc_config_rs6000_rs6000.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc16/files/patch-gcc_config_rs6000_rs6000.cc
@@ -0,0 +1,10 @@
+--- gcc/config/rs6000/rs6000.cc.orig 2026-04-30 08:33:20 UTC
++++ gcc/config/rs6000/rs6000.cc
+@@ -28608,6 +28608,7 @@ rs6000_mangle_decl_assembler_name (tree decl, tree id)
+
+ /* Map long double built-in functions if long double is IEEE 128-bit. */
+ if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
++ && glibc_supports_ieee_128bit ()
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_IS_UNDECLARED_BUILTIN (decl)
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
diff --git a/lang/gcc16/files/patch-gcc_configure b/lang/gcc16/files/patch-gcc_configure
--- a/lang/gcc16/files/patch-gcc_configure
+++ b/lang/gcc16/files/patch-gcc_configure
@@ -4,9 +4,9 @@
There __FreeBSD_version is 1000009, so we start enabling the support
from __FreeBSD_version == 1000010.
---- gcc/configure.orig 2023-05-11 22:33:34 UTC
+--- gcc/configure.orig 2026-04-30 08:34:44 UTC
+++ gcc/configure
-@@ -24214,6 +24214,13 @@ EOF
+@@ -27021,6 +27021,13 @@ EOF
#else
# if defined __sun__ && defined __svr4__
/* Solaris ld.so.1 supports .init_array/.fini_array since Solaris 8. */
@@ -20,7 +20,7 @@
# else
# error The C library not known to support .init_array/.fini_array
# endif
-@@ -33823,7 +33823,8 @@
+@@ -33823,7 +33830,8 @@ case "$target:$with_long_double_format" in
if test "${with_long_double_format+set}" = set; then :
withval=$with_long_double_format;
case "$target:$with_long_double_format" in
diff --git a/lang/gcc16/files/patch-gcc_fortran_trans-types.cc b/lang/gcc16/files/patch-gcc_fortran_trans-types.cc
new file mode 100644
--- /dev/null
+++ b/lang/gcc16/files/patch-gcc_fortran_trans-types.cc
@@ -0,0 +1,12 @@
+--- gcc/fortran/trans-types.cc.orig 2026-04-30 08:33:20 UTC
++++ gcc/fortran/trans-types.cc
+@@ -595,7 +595,8 @@ gfc_init_kinds (void)
+ precision. For libgfortran calls pretend the IEEE 754 quad TFmode has
+ kind 17 rather than 16 and use kind 16 for the IBM extended format
+ TFmode. */
+- if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode))
++ if (composite_mode != QImode && saw_r16 && !MODE_COMPOSITE_P (r16_mode)
++ && TARGET_GLIBC_MAJOR >= 2)
+ {
+ for (int i = 0; i < r_index; ++i)
+ if (gfc_real_kinds[i].kind == 16)
diff --git a/lang/gcc16/files/patch-gcc_jit_Make-lang.in b/lang/gcc16/files/patch-gcc_jit_Make-lang.in
--- a/lang/gcc16/files/patch-gcc_jit_Make-lang.in
+++ b/lang/gcc16/files/patch-gcc_jit_Make-lang.in
@@ -1,6 +1,6 @@
---- gcc/jit/Make-lang.in.orig 2024-02-25 22:32:31 UTC
+--- gcc/jit/Make-lang.in.orig 2026-04-30 08:33:20 UTC
+++ gcc/jit/Make-lang.in
-@@ -360,9 +360,9 @@ jit.install-headers: installdirs
+@@ -377,9 +377,9 @@ jit.install-headers: installdirs
# Install hooks:
jit.install-headers: installdirs
$(INSTALL_DATA) $(srcdir)/jit/libgccjit.h \
diff --git a/lang/gcc16/files/patch-gcc_jit_jit-recording.cc b/lang/gcc16/files/patch-gcc_jit_jit-recording.cc
--- a/lang/gcc16/files/patch-gcc_jit_jit-recording.cc
+++ b/lang/gcc16/files/patch-gcc_jit_jit-recording.cc
@@ -1,6 +1,6 @@
---- gcc/jit/jit-recording.cc.orig 2025-09-19 17:08:24 UTC
+--- gcc/jit/jit-recording.cc.orig 2026-04-30 08:33:20 UTC
+++ gcc/jit/jit-recording.cc
-@@ -4822,7 +4822,7 @@ recording::function::write_reproducer (reproducer &r)
+@@ -4941,7 +4941,7 @@ recording::function::write_reproducer (reproducer &r)
r.write(" gcc_jit_function_add_integer_array_attribute (%s,\n"
" %s,\n"
" (int[])%s,\n"
diff --git a/lang/gcc16/files/patch-gcc_jit_libgccjit.cc b/lang/gcc16/files/patch-gcc_jit_libgccjit.cc
--- a/lang/gcc16/files/patch-gcc_jit_libgccjit.cc
+++ b/lang/gcc16/files/patch-gcc_jit_libgccjit.cc
@@ -1,6 +1,6 @@
---- gcc/jit/libgccjit.cc.orig 2025-09-19 17:04:52 UTC
+--- gcc/jit/libgccjit.cc.orig 2026-04-30 08:33:20 UTC
+++ gcc/jit/libgccjit.cc
-@@ -4405,7 +4405,7 @@ gcc_jit_context_new_rvalue_vector_perm (gcc_jit_contex
+@@ -4474,7 +4474,7 @@ gcc_jit_context_new_rvalue_vector_perm (gcc_jit_contex
mask_len == elements1_len,
ctxt, loc,
"mismatching length for mask:"
@@ -9,7 +9,7 @@
mask_len,
elements1_len);
-@@ -4426,7 +4426,7 @@ gcc_jit_context_new_rvalue_vector_perm (gcc_jit_contex
+@@ -4495,7 +4495,7 @@ gcc_jit_context_new_rvalue_vector_perm (gcc_jit_contex
mask_element_size == elements1_element_size,
ctxt, loc,
"mismatching size for mask element type:"
diff --git a/lang/gcc16/files/patch-gfortran-libgcc b/lang/gcc16/files/patch-gfortran-libgcc
--- a/lang/gcc16/files/patch-gfortran-libgcc
+++ b/lang/gcc16/files/patch-gfortran-libgcc
@@ -44,10 +44,9 @@
misleading information in that bug. CMake is not actually doing
anything wrong.)
---- UTC
---- gcc/fortran/gfortranspec.cc.orig 2022-01-23 22:32:06.000000000 +0000
-+++ gcc/fortran/gfortranspec.cc 2022-02-06 08:56:31.018286000 +0000
-@@ -406,7 +406,7 @@
+--- gcc/fortran/gfortranspec.cc.orig 2026-04-30 08:33:20 UTC
++++ gcc/fortran/gfortranspec.cc
+@@ -406,7 +406,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR
}
}
@@ -56,14 +55,14 @@
if (library)
{
unsigned int i;
---- libgfortran/Makefile.in.orig
+--- libgfortran/Makefile.in.orig 2026-04-30 08:34:44 UTC
+++ libgfortran/Makefile.in
-@@ -759,7 +759,7 @@
+@@ -987,7 +987,7 @@ libgfortran_la_LDFLAGS = -version-info `grep -v '^\#'
$(LTLDFLAGS) $(LIBQUADLIB) ../libbacktrace/libbacktrace.la \
$(HWCAP_LDFLAGS) \
- $(LIBM) $(extra_darwin_ldflags_libgfortran) \
+ $(LIBM) $(extra_darwin_ldflags_libgfortran) \
- $(version_arg) -Wc,-shared-libgcc
+ $(version_arg)
libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
- cafexeclib_LTLIBRARIES = libcaf_single.la
+ libcaf_shared_DEPS = caf/libcaf.h caf/caf_error.h
diff --git a/lang/gcc16/files/patch-libgcc_config.host b/lang/gcc16/files/patch-libgcc_config.host
--- a/lang/gcc16/files/patch-libgcc_config.host
+++ b/lang/gcc16/files/patch-libgcc_config.host
@@ -1,11 +1,11 @@
---- libgcc/config.host.orig
+--- libgcc/config.host.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config.host
-@@ -1234,6 +1234,12 @@
+@@ -1234,6 +1234,12 @@ powerpc*-*-freebsd*)
powerpc64*)
tmake_file="${tmake_file} rs6000/t-freebsd64"
md_unwind_header=rs6000/freebsd-unwind.h
+ if test $libgcc_cv_powerpc_float128 = yes; then
-+ tmake_file="${tmake_file} rs6000/t-float128"
++ tmake_file="${tmake_file} rs6000/t-float128 rs6000/t-float128-freebsd"
+ fi
+ if test $libgcc_cv_powerpc_float128_hw = yes; then
+ tmake_file="${tmake_file} rs6000/t-float128-hw"
diff --git a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h b/lang/gcc16/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy from lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
copy to lang/gcc16/files/patch-libgcc_config_rs6000_freebsd-unwind.h
--- a/lang/gcc14/files/patch-libgcc_config_rs6000_freebsd-unwind.h
+++ b/lang/gcc16/files/patch-libgcc_config_rs6000_freebsd-unwind.h
@@ -1,18 +1,21 @@
---- libgcc/config/rs6000/freebsd-unwind.h.orig
+--- libgcc/config/rs6000/freebsd-unwind.h.orig 2026-04-30 08:33:28 UTC
+++ libgcc/config/rs6000/freebsd-unwind.h
-@@ -33,6 +33,11 @@
- const unsigned int *pc = (const unsigned int *) context->ra;
+@@ -24,6 +24,14 @@
- #ifdef __powerpc64__
+ #define R_LR 65
+
++#ifdef __powerpc64__
+#if _CALL_ELF == 2
+#define TOC_SAVE_SLOT 24
+#else
+#define TOC_SAVE_SLOT 40
+#endif
- if (fs->regs.how[2] == REG_UNSAVED)
- {
- /* If the current unwind info (FS) does not contain explicit info
-@@ -40,9 +45,9 @@
++#endif
++
+ #define MD_FROB_UPDATE_CONTEXT frob_update_context
+
+ static void
+@@ -40,9 +48,9 @@ frob_update_context (struct _Unwind_Context *context,
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
@@ -24,7 +27,7 @@
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
-@@ -51,17 +56,17 @@
+@@ -51,17 +59,17 @@ frob_update_context (struct _Unwind_Context *context,
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
diff --git a/lang/gcc16/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver b/lang/gcc16/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
new file mode 100644
--- /dev/null
+++ b/lang/gcc16/files/patch-libgcc_config_rs6000_libgcc-freebsd-float128.ver
@@ -0,0 +1,38 @@
+--- /dev/null
++++ libgcc/config/rs6000/libgcc-freebsd-float128.ver
+@@ -0,0 +1,35 @@
++# IEEE-128 (__float128 / KFmode) software helpers exported from libgcc_s.so on
++# FreeBSD, where there is no float128 IFUNC. Attached to GCC_7.0.0, the version
++# where PowerPC __float128 support was introduced.
++GCC_7.0.0 {
++ __addkf3
++ __subkf3
++ __mulkf3
++ __divkf3
++ __negkf2
++ __unordkf2
++ __eqkf2
++ __gekf2
++ __lekf2
++ __extendsfkf2
++ __extenddfkf2
++ __trunckfsf2
++ __trunckfdf2
++ __fixkfsi
++ __fixkfdi
++ __fixunskfsi
++ __fixunskfdi
++ __floatsikf
++ __floatdikf
++ __floatunsikf
++ __floatundikf
++ __floattikf
++ __floatuntikf
++ __fixkfti
++ __fixunskfti
++ __extendkftf2
++ __trunctfkf2
++ __mulkc3
++ __divkc3
++ __powikf2
++}
diff --git a/lang/gcc16/files/patch-libgcc_config_rs6000_t-float128-freebsd b/lang/gcc16/files/patch-libgcc_config_rs6000_t-float128-freebsd
new file mode 100644
--- /dev/null
+++ b/lang/gcc16/files/patch-libgcc_config_rs6000_t-float128-freebsd
@@ -0,0 +1,18 @@
+--- /dev/null
++++ libgcc/config/rs6000/t-float128-freebsd
+@@ -0,0 +1,15 @@
++# On FreeBSD there is no float128 IFUNC (rs6000/t-float128-hw needs the Linux
++# AT_PLATFORM auxv entry, absent on FreeBSD), so the software __float128/KFmode
++# helpers built by rs6000/t-float128 would only land in the static libgcc.a
++# (hidden) via LIB2ADD_ST. Put them in the shared libgcc_s.so and export them
++# (see libgcc-freebsd-float128.ver) so gcc-built DSOs -- notably libstdc++.so,
++# which references e.g. __eqkf2 for IEEE-128 long double -- resolve them.
++#
++# Exclude __mulkc3/__divkc3: under -mabi=ieeelongdouble libgcc2.c's __multc3/
++# __divtc3 are already mangled to those names in libgcc_s.so, so adding rs6000's
++# own copies to the shared library would multiply-define them. They stay
++# static-only; the .ver exports the libgcc2.c-provided ones.
++fp128_shared_src := $(filter-out %/_mulkc3.c %/_divkc3.c,$(fp128_src))
++LIB2ADD_ST := $(filter-out $(fp128_shared_src),$(LIB2ADD_ST))
++LIB2ADD += $(fp128_shared_src)
++SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-freebsd-float128.ver
diff --git a/lang/gcc16/files/patch-libgcc_configure b/lang/gcc16/files/patch-libgcc_configure
new file mode 100644
--- /dev/null
+++ b/lang/gcc16/files/patch-libgcc_configure
@@ -0,0 +1,19 @@
+--- libgcc/configure.orig
++++ libgcc/configure
+@@ -5240,7 +5240,7 @@
+ # check if we have VSX (ISA 2.06) support to build the software libraries, and
+ # whether the assembler can handle xsaddqp for hardware support. Also check if
+ # a new glibc is being used so that __builtin_cpu_supports can be used.
+-powerpc*-*-linux*)
++powerpc*-*-linux* | powerpc*-*-freebsd*)
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+@@ -5251,6 +5251,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ vector double dadd (vector double a, vector double b) { return a + b; }
++__ibm128 conftest_ibm128;
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ libgcc_cv_powerpc_float128=yes

File Metadata

Mime Type
text/plain
Expires
Thu, Sep 10, 1:05 AM (21 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38623953
Default Alt Text
D58116.id181573.diff (41 KB)

Event Timeline