From owner-freebsd-current@FreeBSD.ORG Wed Jul 4 15:08:31 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 7C7AF106564A for ; Wed, 4 Jul 2012 15:08:31 +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 388618FC0C for ; Wed, 4 Jul 2012 15:08:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d061:cfb8:84ae:5c85] (unknown [IPv6:2001:7b8:3a7:0:d061:cfb8:84ae:5c85]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 40BE35C59; Wed, 4 Jul 2012 17:08:30 +0200 (CEST) Message-ID: <4FF45C6E.1080000@FreeBSD.org> Date: Wed, 04 Jul 2012 17:08:30 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120619 Thunderbird/14.0 MIME-Version: 1.0 To: Taku YAMAMOTO References: <20120704233316.70ec8654.taku@tackymt.homeip.net> In-Reply-To: <20120704233316.70ec8654.taku@tackymt.homeip.net> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: FYI: SIGBUS with world built by clang X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 04 Jul 2012 15:08:31 -0000 On 2012-07-04 16:33, Taku YAMAMOTO wrote: > For people having SIGBUS with clang-build world + gcc-build binaries, > > > In short words, for any libraries (and never forget about rtld-elf!) > which are potentially called from arbitrary binaries, > compile them with either -mstackrealign or -mstack-alignment=8! > > The detail is as follows. > > I've observed that clang carelessly expects the stack being aligned at > 16 byte boundary. Eh, this is a requirement of the amd64 ABI. Any compiler that *doesn't* align the stack on 16-byte boundaries is basically broken. Or are you experiencing this on i386? Even there, 16-byte alignment would be much better in combination with SSE instructions (which arent' enabled by default, btw). Note that you would get the same issue with newer versions of gcc, which will also assume this alignment.