From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 21 15:04:17 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 124991065674; Tue, 21 Aug 2012 15:04:17 +0000 (UTC) (envelope-from danismostlikely@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9798FC15; Tue, 21 Aug 2012 15:04:16 +0000 (UTC) Received: by vcbgb22 with SMTP id gb22so8053275vcb.13 for ; Tue, 21 Aug 2012 08:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=s3gaiK5ZBjP/+ZKM8jlPDpG4P8J5mIuerIUQERtD6wY=; b=ikxv3XOo4eGlP5tcvpFF8vUXCDbVrCxLRcNbS+0EC4kYyOJneul1BSF6hFsIfBBTwU x6bGlMELZGKWNkrOzsodhvAyqdQWW14bGmqHPsdgYPiwbmOKmBphQoRdA3y2RQ0WpMzr ASQpnWNOtB3HA6hTGXROhV6SN3RMPYASrIiSGDgBGjj4AOQBEE5ycDLVN82BMxQiCiXz eV6hpF0aeuSMJlbN3gLxRTVSVeyEHCnobT9bHnY3ItUafd8IrTmi/XOX1z8NVLWDrDHG oJjBBIfh0zKlhx0HUdtwDpsL5/diwMtjG3IAjM8tRVt1XzRZHmYTPW0+5VwTVpc99xHX kmsw== MIME-Version: 1.0 Received: by 10.52.67.7 with SMTP id j7mr11721783vdt.91.1345561455722; Tue, 21 Aug 2012 08:04:15 -0700 (PDT) Received: by 10.58.91.169 with HTTP; Tue, 21 Aug 2012 08:04:15 -0700 (PDT) In-Reply-To: <20120821084930.GM33100@deviant.kiev.zoral.com.ua> References: <20120821084930.GM33100@deviant.kiev.zoral.com.ua> Date: Tue, 21 Aug 2012 09:04:15 -0600 Message-ID: From: Dan McGregor To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, tijl@freebsd.org 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 15:04:17 -0000 My solution is certainly fairly hacky, I just took inspiration from NetBSD. I wanted to see if it could be done. While I was there I did identify several files that should be common between i386 and amd64, such as exec.h. Since reading your email I started looking at the x86 common code, and have made some more code common; specifically asm.h ans ucontext.h. I'll be putting that on github shortly. Since it does look like tijl hasn't committed anything since March, I would like to co-operate and see what his plans were. The idea of merging the i386 and amd64 headers into a common area seems like a better idea to me. Dan On 21 August 2012 02:49, 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 ?