From owner-freebsd-current@FreeBSD.ORG Sun Nov 4 14:29:46 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02D82AB; Sun, 4 Nov 2012 14:29:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A6ABE8FC0C; Sun, 4 Nov 2012 14:29:45 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d48d:da6b:2080:d1e7] (unknown [IPv6:2001:7b8:3a7:0:d48d:da6b:2080:d1e7]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 263F15C59; Sun, 4 Nov 2012 15:29:44 +0100 (CET) Message-ID: <50967BD6.9090806@FreeBSD.org> Date: Sun, 04 Nov 2012 15:29:42 +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: Konstantin Belousov Subject: Re: November 5th is Clang-Day References: <20121102032945.GF65074@lor.one-eyed-alien.net> <201211030948.43530.naylor.b.david@gmail.com> <1TUlad-0008bB-OF@internal.tormail.org> <201211041442.16620.naylor.b.david@gmail.com> <20121104131830.GL73505@kib.kiev.ua> In-Reply-To: <20121104131830.GL73505@kib.kiev.ua> Content-Type: multipart/mixed; boundary="------------080601050205030809080704" Cc: David Chisnall , freebsd-current@freebsd.org, David Naylor , Brooks Davis , Jan Beich X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:29:46 -0000 This is a multi-part message in MIME format. --------------080601050205030809080704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-11-04 14:18, Konstantin Belousov wrote: > On Sun, Nov 04, 2012 at 02:42:13PM +0200, David Naylor wrote: ... >> I tried building (using gcc) wine with your patch and now (at least) winecfg >> and regedit work with a clang built lib32. I'll email Gerald (wine's >> maintainer) about including your patch in wine. > > The wine is the wrong place to fix. If system libraries suddenly started > requiring 16-byte stack alignment on i386, it is unacceptable breakage > of the ABI. So we really must use 4 byte stack alignment on i386 by default? I have attached a diff to llvm for this, but I would like to verify that it is really correct. Apparently Darwin, Linux and Solaris all use 16 byte alignment. The Sys V ABI seems to say only: "The stack is word aligned. Although the architecture does not require any alignment of the stack, software convention and the operating system requires that the stack be aligned on a word boundary". --------------080601050205030809080704 Content-Type: text/x-diff; name="fix-llvm-i386-alignment-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-llvm-i386-alignment-1.diff" Index: contrib/llvm/lib/Target/X86/X86Subtarget.cpp =================================================================== --- contrib/llvm/lib/Target/X86/X86Subtarget.cpp (revision 242480) +++ contrib/llvm/lib/Target/X86/X86Subtarget.cpp (working copy) @@ -416,12 +416,12 @@ X86Subtarget::X86Subtarget(const std::string &TT, assert((!In64BitMode || HasX86_64) && "64-bit code requested on a subtarget that doesn't support it!"); - // Stack alignment is 16 bytes on Darwin, FreeBSD, Linux and Solaris (both - // 32 and 64 bit) and for all 64-bit targets. + // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both 32 and 64 + // bit) and for all 64-bit targets. if (StackAlignOverride) - stackAlignment = StackAlignOverride; - else if (isTargetDarwin() || isTargetFreeBSD() || isTargetLinux() || - isTargetSolaris() || In64BitMode) + stackAlignment = StackAlignOverride; + else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() || + In64BitMode) stackAlignment = 16; } --------------080601050205030809080704--