Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162289948
D58116.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
35 KB
Referenced Files
None
Subscribers
None
D58116.diff
View Options
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_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_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-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
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 6:11 PM (12 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35005978
Default Alt Text
D58116.diff (35 KB)
Attached To
Mode
D58116: lang/gcc1[2-6]: merge upstream pull requests
Attached
Detach File
Event Timeline
Log In to Comment