libgcc_s: export the IEEE-128 long double runtime on powerpc64le

On powerpc64le with IEEE-128 long double, the long-double compiler-runtime
helpers are the *kf* soft-float functions (built from the tf sources,
renamed via -D in lib/libcompiler_rt/Makefile.inc) plus the complex
multc3/__divtc3. They are compiled into libgcc_s.so by the powerpc64le
SRCF block, but were never added to Symbol.map, so they stayed local and
unexported.

Every other IEEE-128 architecture already exports its scalar long-double
runtime -- aarch64 and riscv list the tf helpers in GCC_4.6.0. powerpc64le
was simply missed.

Because the helpers are unexported, any clang-built shared library that uses
long double leaves them undefined (permitted in a DSO), and linking an
executable against that DSO then fails under lld's default
--no-allow-shlib-undefined. For example science/harminv fails to link its
binary against its own libharminv.so with undefined multc3/divtc3; at
-O0, mulkf3/addkf3/__subkf3/__unordkf2 appear as well.

Export the full runtime, gated on the PowerPC-specific LONG_DOUBLE_IEEE128
predefine so no other architecture is affected: complex multc3/divtc3 in
GCC_4.0.0 (beside the other complex mul*c3), and the 28 scalar *kf*
functions in GCC_7.0.0. Node placement follows glibc/gcc symbol-versioning
history.

Differential Revision:	https://reviews.freebsd.org/D58248
This commit is contained in:
Piotr Kubaj committed 2026-08-09 11:07:30 +02:00
1 parent 776ba7bade
commit 185a03ad8a
1 file changed
+34
+34
View File
@@ -161,6 +161,10 @@ GCC_4.0.0 {
__mulsc3;
#if defined(__amd64__) || defined(__i386__)
__mulxc3;
#endif
#if defined(__LONG_DOUBLE_IEEE128__)
__divtc3;
__multc3;
#endif
__powidf2;
__powisf2;
@@ -233,4 +237,34 @@ GCC_7.0.0 {
#ifdef __i386__
__divmoddi4;
#endif
#if defined(__LONG_DOUBLE_IEEE128__)
__addkf3;
__subkf3;
__mulkf3;
__divkf3;
__eqkf2;
__gekf2;
__gtkf2;
__lekf2;
__ltkf2;
__nekf2;
__unordkf2;
__extendsfkf2;
__extenddfkf2;
__trunckfsf2;
__trunckfdf2;
__fixkfsi;
__fixkfdi;
__fixkfti;
__fixunskfsi;
__fixunskfdi;
__fixunskfti;
__floatsikf;
__floatdikf;
__floattikf;
__floatunsikf;
__floatundikf;
__floatuntikf;
__powikf2;
#endif
};