[PATCH] fake pre-processor macros when building on non-FreeBSD
system
Alexander Kabaev
kabaev at gmail.com
Tue Jul 12 21:38:12 UTC 2011
On Tue, 12 Jul 2011 23:06:12 +0200
Robert Millan <rmh at debian.org> wrote:
> 2011/7/12 Alexander Kabaev <kabaev at gmail.com>:
> > Whatever happened to using a proper cross-tool to do the job?
>
> 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.
>
> > Why is this hack needed?
>
> The kernel tree expects flags like __linux__ or __FreeBSD__ to have a
> different meaning when compiling for kernel space. Instead of "we're
> building code that will run on $foo", they mean "we're building $foo
> itself". This assumption is correct most of the time, but not always
> so. My patch addresses some of the situations in which the assumption
> fails.
>
> --
> Robert Millan
The fact that Linux compiler with manually undefined and re-defined
platform macros can compile is a coincidence and is not guaranteed to
work and certainly is not a goal of FreeBSD project so this can be
broken at any moment. Relying on that is unwise, putting hacks into
FreeBSD sources to legitimize the practice is not the move I would
support as well. Traditionally, IMHO.
--
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110712/67b8c530/signature.pgp
More information about the freebsd-hackers
mailing list