From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 21 14:52:59 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC7E106564A; Tue, 21 Aug 2012 14:52:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 415F58FC0C; Tue, 21 Aug 2012 14:52:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2D6DBB964; Tue, 21 Aug 2012 10:52:58 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 21 Aug 2012 09:44:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <20120821084930.GM33100@deviant.kiev.zoral.com.ua> In-Reply-To: <20120821084930.GM33100@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201208210944.31001.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 Aug 2012 10:52:58 -0400 (EDT) Cc: Konstantin Belousov , tijl@freebsd.org, Dan McGregor Subject: Re: Build 32 bit binaries on amd64 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 14:52:59 -0000 On Tuesday, August 21, 2012 4:49:30 am Konstantin Belousov wrote: > On Mon, Aug 20, 2012 at 08:32:41PM -0600, Dan McGregor wrote: > > Hi. > > > > I've been working on porting compiler-rt/clang's support for address > > sanitization (asan) to FreeBSD. So far I have it building and it > > appears to work properly, however the build system expects to be able > > to build 32 bit binaries on amd64. > > > > amd64 doesn't include i386's machine/foo headers. The included patch > > is my proposed solution: > > > > Add i386 headers to /usr/include/i386, and in machine/foo.h, check if > > it's a 32 bit build and include the appropriate header from i386. > > > > For example machine/ucontext.h will include i386/ucontext.h if > > compiled with -m32. > > > > Thoughts? > > > > If anyone's curious about the compiler_rt port, I have it at > > github.com/dannomac/compiler-rt on the branch named freebsd. > > There was a work by Tijl Coosemans in the similar, but somewhat less hacky > direction. The headers are moved into sys/x86/include and unified as much > as possible, while machine/ counterpart includes corresponding header > from x86/include. > > I even lost track of how much more headers is left to convert. In fact, > not all headers are equal, some are only useful for kernel or base system. > Also, parts of the critically important headers do not live in machine/ > at all, e.g. the headers from libm. > > The work seems to be stale, do you want to cooperate with Tijl or continue ? I think we should probably follow Tijl's model since we are on that path. I originally preferred the /usr/include/i386 approach, but have come around to Tjil's approach instead. -- John Baldwin