summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-01-04 20:51:28 +0000
committerdim <dim@FreeBSD.org>2011-01-04 20:51:28 +0000
commitaedf7a79dae6b0cf8534a2e4b74095777d945f74 (patch)
treec2e889dfe60be3e3786f90f9d27b561552cedc86 /libexec
parent44b901022ff3e78bc474bf93f64452ff55a50e0b (diff)
downloadFreeBSD-src-aedf7a79dae6b0cf8534a2e4b74095777d945f74.zip
FreeBSD-src-aedf7a79dae6b0cf8534a2e4b74095777d945f74.tar.gz
On amd64 and i386, tell the compiler to refrain from generating SSE,
3DNow, MMX and floating point instructions in rtld-elf. Otherwise, _rtld_bind() (and whatever it calls) could possibly clobber function arguments that are passed in SSE/3DNow/MMX/FP registers, usually floating point values. This can happen, for example, when clang generates SSE code for memset() or memcpy() calls. One symptom of this is sshd dying early on amd64 with "PRNG not seeded", which is ultimately caused by libcrypto.so.6 calling RAND_add() with a double parameter. That parameter is passed via %xmm0, which gets wiped out by an SSE memset() in _rtld_bind(). Reviewed by: kib, kan
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/amd64/Makefile.inc1
-rw-r--r--libexec/rtld-elf/i386/Makefile.inc1
2 files changed, 2 insertions, 0 deletions
diff --git a/libexec/rtld-elf/amd64/Makefile.inc b/libexec/rtld-elf/amd64/Makefile.inc
index 4ecf82f..7d68611 100644
--- a/libexec/rtld-elf/amd64/Makefile.inc
+++ b/libexec/rtld-elf/amd64/Makefile.inc
@@ -1,5 +1,6 @@
# $FreeBSD$
+CFLAGS+= -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-float
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/libexec/rtld-elf/i386/Makefile.inc b/libexec/rtld-elf/i386/Makefile.inc
index 4ecf82f..7d68611 100644
--- a/libexec/rtld-elf/i386/Makefile.inc
+++ b/libexec/rtld-elf/i386/Makefile.inc
@@ -1,5 +1,6 @@
# $FreeBSD$
+CFLAGS+= -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-float
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
OpenPOWER on IntegriCloud