From owner-freebsd-arch@FreeBSD.ORG Thu Nov 18 06:15:15 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC9471065670; Thu, 18 Nov 2010 06:15:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA378FC15; Thu, 18 Nov 2010 06:15:13 +0000 (UTC) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAI51XsR000608; Thu, 18 Nov 2010 16:01:33 +1100 Received: from c122-106-146-145.carlnfd1.nsw.optusnet.com.au (c122-106-146-145.carlnfd1.nsw.optusnet.com.au [122.106.146.145]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAI51Kkg001538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2010 16:01:22 +1100 Date: Thu, 18 Nov 2010 16:01:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <4CE46602.9000303@bsdimp.com> Message-ID: <20101118154920.S3472@besplex.bde.org> References: <201007291718.12687.tijl@coosemans.org> <4CE417B3.3030102@bsdimp.com> <201011172058.05683.tijl@coosemans.org> <201011171718.37798.jhb@freebsd.org> <4CE46602.9000303@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Tijl Coosemans , Dimitry Andric , Garrett Cooper , freebsd-arch@freebsd.org, Warner Losh Subject: Re: Support for cc -m32 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 06:15:15 -0000 On Wed, 17 Nov 2010, Warner Losh wrote: > On 11/17/2010 15:18, John Baldwin wrote: >> ... >> I'd prefer something that autogenerated headers in /usr/include/machine >> that >> #include the appropriate version similar to what Warner suggested. >> >> However, one issue with that approach (and this one) are headers that only >> exist for one platform. The end result would be that that header would now >> exist for both platforms (in that if you do 'if [ -r >> /usr/include/machine/foo.h ]' it will be true). We can make it #error or >> otherwise fail (by including a non-existing file for example), but if there >> was some way to have cc -m32 "magically" substitute "i386/" for "machine", >> that is what I would most prefer. (This has problems too in that #include >> would work with -m32 even though >> /usr/include/machine/foo.h >> doesn't exist, but /usr/include/i386/foo.h does. > "magically" converting machine -> i386 requires cpp hacking. > > However, the if [] test is beyond the scope of the API that we support. > Scripts that use -m32 will have to cope with other issues. > > We could 'solve' this by having an /usr/include32, but even that still isn't > complete. Doesn't seem so hard to hack cpp for a subdirectory (but harder than adding -I for the whole include path). > I contend that the least bad solution is to auto generate the machine > directory from the sys/{i386,amd64}/include. If we do that, we could > implement -m64 on i386 too, but that needs a lot more infrastructure. Maybe auto-generate machine32 and hack cpp to use that instead of `machine'? Bruce