The branch main has been updated by pkubaj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5b04de7c4d12cfcba4dd3f7b8a2cda886e8ffd31

commit 5b04de7c4d12cfcba4dd3f7b8a2cda886e8ffd31
Author:     Piotr Kubaj <[email protected]>
AuthorDate: 2026-12-04 14:00:49 +0000
Commit:     Piotr Kubaj <[email protected]>
CommitDate: 2026-12-04 14:26:46 +0000

    rtld: keep FP and vector registers out of the C code on 32-bit powerpc
    
    clang expects __tls_get_addr() to preserve the floating-point and vector
    registers, and _rtld_bind_start only saves the integer ones. When lib32
    is built for a CPU with AltiVec or VSX, the first TLS access in a
    dlopen()ed library clobbers vs0, v2 and v3 in the caller, because
    clang vectorizes rtld's memset() and memcpy().
    
    Build the 32-bit rtld without AltiVec, VSX and hard float, like the
    64-bit one.
    
    Approved by:    jhibbits (blanket)
---
 libexec/rtld-elf/powerpc/Makefile.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libexec/rtld-elf/powerpc/Makefile.inc 
b/libexec/rtld-elf/powerpc/Makefile.inc
index e69de29bb2d1..97522767a681 100644
--- a/libexec/rtld-elf/powerpc/Makefile.inc
+++ b/libexec/rtld-elf/powerpc/Makefile.inc
@@ -0,0 +1,3 @@
+# _rtld_bind_start only preserves the integer argument registers, so keep
+# the C code away from the floating-point and vector ones.
+CFLAGS+=       -mno-altivec -msoft-float

Reply via email to