rmh at debian.org
Tue Jul 5 19:04:42 UTC 2011
2011/7/5 Alexander Kabaev <kabaev at gmail.com>:
> I agree with all of the above reasons, but none of them change the fact
> that __linux__ is used left and right to identify both kernel and
> userland environments
Yes, __linux__ is used to identify userland. And almost 100% of the
times it is the wrong macro. We've spent several years fixing this
kind of bug. To give just one example among hundreds, here's the
latest incarnation of __linux__ misuse, reported 3 days ago:
> just as __FreeBSD__ is.
Not exactly. For example, when you see __FreeBSD__, you know what
libc you're dealing with.
> You choose to disable
> __FreeBSD__ in GNU/kFreeBSD presumably because it makes your life
> porting software easier
If Debian GNU/kFreeBSD enabled __FreeBSD__, software would expect that
it is being built on FreeBSD, and make lots of wrong assumptions.
Debian GNU/kFreeBSD is not FreeBSD. It is a derivative that builds on
the kernel of FreeBSD and some of its kernel-specific libraries. It's
not surprising that asserting we're FreeBSD via the compiler results
in breakage (to begin with, even GCC headers wouldn't work properly).
(similar statements can be made for e.g. Darwin, which I think you're
> and are asking FreeBSD project to cope with
> the decision.
I'm asking FreeBSD project to make life easier for a derivative that
is, one way or another, part of its ecosystem, at no cost other than
the time spent discussing the proposal.
> This breaks compiles of new software with older
> compilers than do not define the macro,
As far as I'm concerned, new software isn't supposed to rely on this
macro unconditionally untill it is deemed reasonable to do so.
> takes __FreeBSD__ out of
> symmetry with __linux__
I could argue that __FreeBSD_kernel__ would be in symmetry with
__linux__. But that's wordplay. I think we agreed to leave it out of
the list :-)
> and other similarly defined platform macros
> and forces a race to update every other compiler out there to follow
> the suit.
There's no race, and nobody forcing it.
More information about the freebsd-hackers