Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2011 00:33:01 +0200
From:      Robert Millan <rmh@debian.org>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>, Oliver Pinter <oliver.pntr@gmail.com>
Subject:   Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system
Message-ID:  <CAOfDtXM0b6xN74_g=wx-w8v6h5xApEN1cyBSrNrvZTwg5245xQ@mail.gmail.com>
In-Reply-To: <4E1CB8C6.7090405@freebsd.org>
References:  <CAOfDtXNqydD_hyvo25Arkm=gdqVcSJB8RPfnFL9xozQfS=UeEQ@mail.gmail.com> <CAPjTQNFp8dQBKdFzhPAX1NZ2j%2BLSsffZkOurN0yEb4M%2BpD%2Buow@mail.gmail.com> <CAOfDtXMMej_KORBt1PvAdAL7VvEkzXjpHM=eO_%2BLh=fP5OfWmQ@mail.gmail.com> <20110712164337.07e387eb@kan.dnsalias.net> <CAOfDtXNNpZj=cJE2Mtwth3sXiAtoFr%2B=pAv-TmrzjG-wOb%2B0kw@mail.gmail.com> <4E1CB8C6.7090405@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/7/12 Nathan Whitehorn <nwhitehorn@freebsd.org>:
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXM0b6xN74_g=wx-w8v6h5xApEN1cyBSrNrvZTwg5245xQ>