From owner-freebsd-current@FreeBSD.ORG Wed Jul 4 15:32:00 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56821065672; Wed, 4 Jul 2012 15:32:00 +0000 (UTC) (envelope-from taku@tackymt.homeip.net) Received: from basalt.tackymt.homeip.net (unknown [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by mx1.freebsd.org (Postfix) with ESMTP id 8977C8FC08; Wed, 4 Jul 2012 15:32:00 +0000 (UTC) Received: from basalt.tackymt.homeip.net (localhost [127.0.0.1]) by basalt.tackymt.homeip.net (Postfix) with ESMTP id E379483A0; Thu, 5 Jul 2012 00:31:59 +0900 (JST) X-Virus-Scanned: amavisd-new at tackymt.homeip.net Received: from localhost by basalt.tackymt.homeip.net (amavisd-new, unix socket) with ESMTP id ufMI_mYLGDLv; Thu, 5 Jul 2012 00:31:58 +0900 (JST) Received: from biotite.tackymt.homeip.net (biotite.tackymt.homeip.net [IPv6:2001:3e0:577:0:216:cfff:febc:1472]) by basalt.tackymt.homeip.net (Postfix) with ESMTPSA; Thu, 5 Jul 2012 00:31:58 +0900 (JST) Date: Thu, 5 Jul 2012 00:32:01 +0900 From: Taku YAMAMOTO To: Dimitry Andric Message-Id: <20120705003201.bb297e8a.taku@tackymt.homeip.net> In-Reply-To: <4FF45C6E.1080000@FreeBSD.org> References: <20120704233316.70ec8654.taku@tackymt.homeip.net> <4FF45C6E.1080000@FreeBSD.org> X-Mailer: Sylpheed 3.1.0 (GTK+ 2.22.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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:32:00 -0000 On Wed, 04 Jul 2012 17:08:30 +0200 Dimitry Andric wrote: > 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). Oops, I had to be clear about that! Yes, the experiment was took on i386 (actually -march=pentium4). > Note that you would get the same issue with newer versions of gcc, which > will also assume this alignment. Interesting, but the base gcc we currently have won't on i386, I think. (I occationally get bitten by similar problem when using -ftree-vectorize) -- -|-__ YAMAMOTO, Taku | __ < - A chicken is an egg's way of producing more eggs. -