Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jul 2011 14:05:27 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Robert Millan <rmh@debian.org>, freebsd-hackers@freebsd.org
Subject:   Re: [PATCH] __FreeBSD_kernel__
Message-ID:  <20110705140527.17362ed5@kan.dnsalias.net>
In-Reply-To: <CAOfDtXOcfbNw6St5CMN4GB_psf8hZEV=hpL4q3mmQXqWeLmqXQ@mail.gmail.com>
References:  <CAOfDtXPUxQO1zbnxh8sh%2By7g=d8QaH2svYtEQJ06L4d%2BQKG8VA@mail.gmail.com> <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <CAGH67wQAv4Tf8HjccN2GZzgD2u1ZrORABtGehxXjeg109%2BRNWQ@mail.gmail.com> <20110703103531.4a553271@kan.dnsalias.net> <CAOfDtXOcfbNw6St5CMN4GB_psf8hZEV=hpL4q3mmQXqWeLmqXQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/ysc1mR5.B5Jmaeu6YmM=8CX
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Sun, 3 Jul 2011 17:37:30 +0200
Robert Millan <rmh@debian.org> wrote:

> 2011/7/3 Alexander Kabaev <kabaev@gmail.com>:
> > __linux__ is exactly what __FreeBSD__ is and dies not identify
> > kernel but rather Linux as whole OS, whatever that might be these
> > days.
> >
> > There does not appear to be an universal macro that identifies
> > environment as using Linux kernel regardless of the rest of
> > components used (say, to identify Android and Ubuntu or something
> > embedded with ucLibc as running Linux kernel with different userland
> > implementations).
>=20
> I think I'll cowardly try to stick to a practical POV and avoid the
> discussion about names that tends to get people excited about :-)
>=20
> So from a purely practical perspective:
>=20
> - If __linux__ is defined, this implies you're using a specific
> kernel.
> - If you're using that specific kernel, this implies __linux__ is
> defined.
>=20
> which explains why using __linux__ to identify the kernel is useful
> and reliable.
>=20
> Can __linux__ be used to identify more things?  Most notably, can
> __linux__ be used to identify userland API?
>=20
> - If __linux__ is defined, this does not imply you're using GNU libc.
> - If you're using GNU libc, this does not imply __linux__ is defined.
>=20
> which explains why using __linux__ to identify libc is a bad idea.
> However, it can be useful to identify a set of different C libraries
> (Glibc, Bionic, uclibc, etc) if they share the property you're
> interested in.
>=20
> --=20
> Robert Millan

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 just as __FreeBSD__ is. You choose to disable
__FreeBSD__ in GNU/kFreeBSD presumably because it makes your life
porting software easier and are asking FreeBSD project to cope with
the decision. This breaks compiles of new software with older
compilers than do not define the macro, takes __FreeBSD__ out of
symmetry with  __linux__ and other similarly defined platform macros
and forces a race to update every other compiler out there to follow
the suit. I fail to see the benefits out-weighting the drawbacks in
this scenario.

--=20
Alexander Kabaev

--Sig_/ysc1mR5.B5Jmaeu6YmM=8CX
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iD8DBQFOE1JsQ6z1jMm+XZYRAvk8AKC0EatDS1Jkq9gHvoiaOQITmeE05QCg5qsW
fENstdcAljnvT0Pey78eC7g=
=2d6g
-----END PGP SIGNATURE-----

--Sig_/ysc1mR5.B5Jmaeu6YmM=8CX--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110705140527.17362ed5>