From owner-svn-src-head@FreeBSD.ORG Tue Jan 4 20:51:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E470D1065673; Tue, 4 Jan 2011 20:51:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3AF18FC12; Tue, 4 Jan 2011 20:51:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04KpSYi054567; Tue, 4 Jan 2011 20:51:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04KpSGk054564; Tue, 4 Jan 2011 20:51:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201101042051.p04KpSGk054564@svn.freebsd.org> From: Dimitry Andric Date: Tue, 4 Jan 2011 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216977 - in head/libexec/rtld-elf: amd64 i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 20:51:29 -0000 Author: dim Date: Tue Jan 4 20:51:28 2011 New Revision: 216977 URL: http://svn.freebsd.org/changeset/base/216977 Log: 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 Modified: head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Tue Jan 4 20:38:52 2011 (r216976) +++ head/libexec/rtld-elf/amd64/Makefile.inc Tue Jan 4 20:51:28 2011 (r216977) @@ -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 Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Tue Jan 4 20:38:52 2011 (r216976) +++ head/libexec/rtld-elf/i386/Makefile.inc Tue Jan 4 20:51:28 2011 (r216977) @@ -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