From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 12 22:33:02 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 303DC106564A; Tue, 12 Jul 2011 22:33:02 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id CF4348FC0C; Tue, 12 Jul 2011 22:33:01 +0000 (UTC) Received: by iyb11 with SMTP id 11so6516101iyb.13 for ; Tue, 12 Jul 2011 15:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9AfH0jEL1sfR47pdBeRPi7L6vqFg2x3BTJgbmxd0HP4=; b=tEJJWkvoXbUACT1QYDBeH9pPalBFCQr9Ml707ln+Dkl45xTVraXnY3LoqeV8soeaIl zrxJyJyMUDqsup0qWc/Nu93FPzAPQFKFHEaQLvtsO0zNytVbuNAMPU0LCvSa6bOPvMxt dSvcLki79ng6vwMMqfJ3zUgVoC5cOsGKwWVtw= MIME-Version: 1.0 Received: by 10.42.146.133 with SMTP id j5mr401813icv.180.1310509981102; Tue, 12 Jul 2011 15:33:01 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.7 with HTTP; Tue, 12 Jul 2011 15:33:01 -0700 (PDT) In-Reply-To: <4E1CB8C6.7090405@freebsd.org> References: <20110712164337.07e387eb@kan.dnsalias.net> <4E1CB8C6.7090405@freebsd.org> Date: Wed, 13 Jul 2011 00:33:01 +0200 X-Google-Sender-Auth: 5lK_rVzbU_hShPDTAr4JaizCYxQ Message-ID: From: Robert Millan To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 22:33:02 -0000 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? =C2=A0This would b= e >> 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 differe= nt > 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. When it comes to libc and syscall ABI, it doesn't really matter which one we provide, because -nostdinc -nostdlib completely discards it, as the kernel doesn't use any libc headers or link with libc in any way. When it comes to internal kernel interfaces, a few of them can be selected in the FreeBSD kernel tree: the FreeBSD one, the NetBSD one, the OpenBSD one, even the Linux interface. However, only one of them (FreeBSD interface) is implemented. If you select e.g. NetBSD interface you get build errors such as "sys/device.h not found". Those errors happen because the NetBSD interface was selected for building the kernel of FreeBSD, NOT because we're building on FreeBSD. They would happen all the same if we attempted this on any other platform, including NetBSD. --=20 Robert Millan