git: 86f0621d33bf - main - math/sleef: fix runtime on powerpc64

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sat, 10 Oct 2026 18:16:33 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=86f0621d33bf56f7043593ad063c82415b10aac9

commit 86f0621d33bf56f7043593ad063c82415b10aac9
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-09 21:27:54 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-10 18:15:30 +0000

    math/sleef: fix runtime on powerpc64
    
    Backport upstream 1c246c2e91fa: do not build the VSX dispatcher when the
    compiler does not support VSX. On big-endian it referenced Sleef_*vsx
    functions that were never built, leaving libsleef.so unloadable.
---
 .../files/patch-src_libm-tester_CMakeLists.txt     | 26 ++++++++++++++++++++++
 math/sleef/files/patch-src_libm_CMakeLists.txt     | 26 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/math/sleef/files/patch-src_libm-tester_CMakeLists.txt b/math/sleef/files/patch-src_libm-tester_CMakeLists.txt
new file mode 100644
index 000000000000..8e3622ad3a77
--- /dev/null
+++ b/math/sleef/files/patch-src_libm-tester_CMakeLists.txt
@@ -0,0 +1,26 @@
+Backport of upstream commit 1c246c2e91fa (part of "Code cleanup (#692)"): only
+build the VSX dispatcher when the compiler supports VSX. On big-endian
+powerpc64 the VSX helper is unavailable, so the dispatcher referenced
+Sleef_*vsx functions that were never built and libsleef.so could not be
+loaded (undefined symbol Sleef_sind2_u35vsx).
+
+--- src/libm-tester/CMakeLists.txt.orig	2026-10-09 21:23:09 UTC
++++ src/libm-tester/CMakeLists.txt
+@@ -536,7 +536,7 @@ endif(SLEEF_ARCH_X86)
+   endif(SLEEF_ENABLE_TESTER4 AND TLFLOAT_LIBRARIES)
+ endif(SLEEF_ARCH_X86)
+ 
+-if (SLEEF_ARCH_PPC64)
++if (SLEEF_ARCH_PPC64 AND COMPILER_SUPPORTS_VSX)
+   if (SLEEF_ENABLE_TESTER)
+     add_executable(iutdsp128 ${IUT_SRC})
+     target_compile_definitions(iutdsp128 PRIVATE ENABLE_DSPPOWER_128=1 ${COMMON_TARGET_DEFINITIONS})
+@@ -555,7 +555,7 @@ if (SLEEF_ARCH_PPC64)
+     add_dependencies(tester4dsp128 ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ext_tlfloat)
+     add_test_with_emu(1.0 tester4dsp128)
+   endif(SLEEF_ENABLE_TESTER4 AND TLFLOAT_LIBRARIES)
+-endif(SLEEF_ARCH_PPC64)
++endif(SLEEF_ARCH_PPC64 AND COMPILER_SUPPORTS_VSX)
+ 
+ if (SLEEF_ARCH_S390X)
+   if (SLEEF_ENABLE_TESTER)
diff --git a/math/sleef/files/patch-src_libm_CMakeLists.txt b/math/sleef/files/patch-src_libm_CMakeLists.txt
new file mode 100644
index 000000000000..dfa13747960d
--- /dev/null
+++ b/math/sleef/files/patch-src_libm_CMakeLists.txt
@@ -0,0 +1,26 @@
+Backport of upstream commit 1c246c2e91fa (part of "Code cleanup (#692)"): only
+build the VSX dispatcher when the compiler supports VSX. On big-endian
+powerpc64 the VSX helper is unavailable, so the dispatcher referenced
+Sleef_*vsx functions that were never built and libsleef.so could not be
+loaded (undefined symbol Sleef_sind2_u35vsx).
+
+--- src/libm/CMakeLists.txt.orig	2026-10-09 21:23:09 UTC
++++ src/libm/CMakeLists.txt
+@@ -790,7 +790,7 @@ endif(SLEEF_ARCH_X86)
+   endif()
+ endif(SLEEF_ARCH_X86)
+ 
+-if (SLEEF_ARCH_PPC64)
++if (SLEEF_ARCH_PPC64 AND COMPILER_SUPPORTS_VSX)
+   # Target disppower_128.c
+   sleef_generate_disp_simd(power_128 2 4 SLEEF_VECTOR_DOUBLE SLEEF_VECTOR_FLOAT SLEEF_VECTOR_INT vsx vsx3 x)
+ 
+@@ -815,7 +815,7 @@ if (SLEEF_ARCH_PPC64)
+     set_target_properties(tryvsx3_obj PROPERTIES ${COMMON_TARGET_PROPERTIES})
+     target_sources(${TARGET_LIBSLEEF} PRIVATE $<TARGET_OBJECTS:tryvsx3_obj>)
+   endif()
+-endif(SLEEF_ARCH_PPC64)
++endif(SLEEF_ARCH_PPC64 AND COMPILER_SUPPORTS_VSX)
+ 
+ if (SLEEF_ARCH_S390X)
+   # Target disps390x_128.c