From owner-svn-src-all@FreeBSD.ORG Sun Nov 11 13:50:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9FE3607; Sun, 11 Nov 2012 13:50:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7081D8FC14; Sun, 11 Nov 2012 13:50:02 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:9d32:5200:f533:2e10] (unknown [IPv6:2001:7b8:3a7:0:9d32:5200:f533:2e10]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 467105C59; Sun, 11 Nov 2012 14:50:01 +0100 (CET) Message-ID: <509FAD08.10400@FreeBSD.org> Date: Sun, 11 Nov 2012 14:50:00 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Nathan Whitehorn Subject: Re: svn commit: r242835 - head/contrib/llvm/lib/Target/X86 References: <201211091856.qA9IuRxX035169@svn.freebsd.org> <509F2AA6.9050509@freebsd.org> In-Reply-To: <509F2AA6.9050509@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 13:50:02 -0000 On 2012-11-11 05:33, Nathan Whitehorn wrote: > On 11/09/12 12:56, Dimitry Andric wrote: >> Author: dim >> Date: Fri Nov 9 18:56:27 2012 >> New Revision: 242835 >> URL: http://svnweb.freebsd.org/changeset/base/242835 >> >> Log: >> Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as >> the FreeBSD ABI requires. This is essentially a revert of upstream llvm >> commit r126226, and it will be reverted by upstream too. ... > I'd like to object to this. We have an identical ABI to Linux (and > Solaris, as far as I know). Apparently Linux has standardized on 16-byte stack alignment for 32-bit x86, somewhere in the past. That is, it seems they were forced to do so by the gcc maintainers. Please read: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496 for all the details. > Splitting this by platform will only > propagate the stack alignment breakage further Apparently, that breakage seems to have existed since the beginning. I don't think it can be fixed anymore; it is probably better to migrate to x86_64 anyway, and repeat all the mistakes of the past once again. :-) > -- what we need is > LLVM/our C library to handle different alignments. It seems like we need this for all our 32-bit x86 executables and shared libraries, not only our system libraries. At least, that is what I have been told. > Please fix this for > real instead of balkanizing the ABI support in LLVM and introducing > different ABIs for LLVM and GCC to FreeBSD. The balkanization was already there, since FreeBSD's ABI for 32-bit x86 executables has always used 4 byte stack alignment. If anything, Linux is the cause of the balkanization, since they switched from 4 to 16 byte alignment somewhere along the road, and purposefully (or accidentally) lost backwards compatibility. If anything, we should probably send patches to upstream gcc to make them aware of FreeBSD's specific stack alignment, if they are using 16 byte stack alignment now.