From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 12 23:07:25 2011 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 79CCA1065670; Tue, 12 Jul 2011 23:07:25 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9688FC15; Tue, 12 Jul 2011 23:07:25 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LO800E00TKCIC00@smtpauth2.wiscmail.wisc.edu>; Tue, 12 Jul 2011 18:07:24 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LO8003Z4TKBHX20@smtpauth2.wiscmail.wisc.edu>; Tue, 12 Jul 2011 18:07:23 -0500 (CDT) Date: Tue, 12 Jul 2011 18:07:23 -0500 From: Nathan Whitehorn In-reply-to: To: Robert Millan Message-id: <4E1CD3AB.3030106@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-11, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.7.12.225415, SenderIP=128.104.160.176 References: <20110712164337.07e387eb@kan.dnsalias.net> <4E1CB8C6.7090405@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.18) Gecko/20110706 Thunderbird/3.1.11 Cc: freebsd-hackers@freebsd.org, Ed Maste , Oliver Pinter Subject: Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system 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, 12 Jul 2011 23:07:25 -0000 On 07/12/11 17:33, Robert Millan wrote: > 2011/7/12 Nathan Whitehorn: >> On 07/12/11 16:06, Robert Millan wrote: >>> Why would one need to build a cross-compiler in order to compile >>> userland-agnostic code for the same CPU architecture? This would be >>> like requiring a cross-compiler in order to build things like GRUB or >>> SeaBIOS. >> For one, it might have a different ABI, which isn't actually that different >> an issue than the one you find yourself facing. > ABI can mean many things in this context. It could mean libc ABI, it > could mean internal kernel interfaces, or even C calling conventions. The one I meant was the third one. Linux and FreeBSD happen, though not entirely by chance, to use almost exactly the same ABI on most platforms (but not all!). Assuming, and requiring, interchangeability of ABIs here thus seems like a poor choice. Once you've decided you might have a different ABI, you need a cross-compiler, and that would simultaneously take care of defining various platform-specific macros. The "isn't actually that different" comment, which wasn't a particularly useful thing to say, was that you could conceivably claim, under very broad definitions of what ABI means, that having __FreeBSD__ defined is in fact a part of the system ABI, just like the calling conventions or the stack frame layout. In either case, you would be expected to use a cross-compiler. -Nathan