Gentoo Portage – What Does elibc_FreeBSD Mean?

freebsdgentooglibc

I have a gentoo overlay which has been added to http://gpo.zugaina.org/. One of my ebuilds recMD5 now shows the use flag elibc_FreeBSD even though I didn't add it. I am also running into it for a hadoop package. It looks like all I need to do is add the use flag for the package but I would like to know what its purpose is.

I am also getting an error with

euse -E elibc_FreeBSD

ERROR: Use flag "elibc_FreeBSD" is masked and should not be added to make.conf.

Best Answer

A Bit Of Background

Historically speaking some users of FreeBSD have not gotten along with users of the Linuxes. For many years, until Linux from Scratch, and it's children of whom Gentoo is one, users could not get true source code on their system, unless they chose to use the FreeBSD Ports System. For that reason FreeBSD users viewed themselves as superior, but as Gentoo and Portage matured, the stage was set for the battle pictured below(and the G is backwards, I know):

Gentoo Vs FreeBSD

Much like Portage uses the ebuild construct, ports have the same rules. I linked dependency checking because that's the biggest one. If you look at Chapter 5, Section 5, you can see that ports management could be considered by some anything from an annoyance to a headache. As such the flag and project I explain below attempts to alleviate the issue by replacing the ports mechanism with portage. See How The Flag Works for more.


Why Gentoo is Called a Meta Distribution

Please read GLEP:22, part of the Gentoo Linux Enhancement Project, in which the Specification Section states:

Keyword Fragments

Each keyword needs to specify, either explicitly or implicitly, the following parameters: ARCH, USERLAND, LIBC, and KERNEL.

ARCH
x86, amd64, cobalt, mips64, arm, hppa, ia64, ppc64, sparc

KERNEL
linux, selinux, openbsd, freebsd, netbsd, macosx

USERLAND
gnu, bsd

LIBC
glibc, openbsd, freebsd, netbsd, macosx

(The above examples are not meant to be complete. Hurd, for example is not included because I know very little about Hurd.)

A fully-specified keyword would look like "ARCH-KERNEL-USERLAND-LIBC", so, for example, "ppc-fbsd-gnu-glibc" would indicate a Gentoo system corresponding to a ppc architecture running the FreeBSD kernel with a GNU userland and glibc as the system C library.

elibc is short for Environment_LIBC which points to the LIBC keyword fragment. LIBC is Linux's implementation of a C Standards Library. Since the Standards Library is dependent upon all of the Keywords quoted above, it is set on system-wide basis, and through variable inheritance, a package basis in Gentoo (see /etc/portage/make.profile which is a symlink to /usr/portage/profiles, which is set using eselect profiles).

ecyoung@bedroom-gentoo ~ $ sudo emerge -av glibc
Password: 

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-libs/glibc-2.20-r2:2.2::gentoo  USE="gd (multilib) -debug (-hardened) -nscd -profile (-selinux) -suid -systemtap -vanilla" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

To produce the above LIBC, my profile contains or inherits:

  1. ARCH - amd64
  2. KERNEL - linux
  3. USERLAND - gnu
  4. LIBC - glibc

It's the keywording and enviroment variable USE Flags explained in this GLEP, that make Gentoo so powerful. This system is the main reason I chose Gentoo as my primary distribution, and also the reason I will read and/or attempt to answer every question here tagged /gentoo.

Once the Keywords and Environment Variables are mixed with the per package USE Flags, the Meta Distribution is created. While there isn't an infinite number of ways a package can be compiled, I can guarantee that every package on a Gentoo system has been affected by a USE Flag in one way or another.


How The Flag Works

To install FreeBSD, you need to use the Handbook provided by FreeBSD to install FreeBSD, and then inside a fresh install use the Gentoo FreeBSD instructions at the Wiki. Doing so adds the following functionality to FreeBSD:

Gentoo/FreeBSD is a Gentoo system based on FreeBSD. It is FreeBSD with the following changes:

  • Portage replaces ports.
  • The base system is managed by portage.
  • Software in ./contrib and ./crypto is replaced with Gentoo Linux versions.
  • The rc system is replaced with OpenRC.
  • Python, wget and bash are included in the base system to support portage.
  • FreeBSD's bootloader is removed from the base system (useful for jails).

The maintainer of the two packages your question was concerned with has added the option to compile the package on a FreeBSD system. If you aren't on a FreeBSD system then this change doesn't affect you. This was indicated by portage telling you that the flag was masked. You don't need to change anything. For a brief, and I do mean brief, explanation of the difference between FreeBSD and Linux, see HTG Explains: What’s the Difference Between Linux and BSD?.

Related Question