Prefix/libc

This is a project to support libc inside a Prefix, so called "RAP" (Rap Ain't Prefix). See also Project:Android. A general use case is for Prefix on RHEL 5 (CentOS 5 ans SL 5), where the host glibc-2.5 is too old to support modern features as fortify.

Classical Prefix is based on rpath. The differences are summerized in this table.

Bootstrap Script
Download the Gentoo RAP bootstrap-rap.sh. You can use various ways to obtain the script and get it to a place where you can execute it. Once in position, preform the following commands:

That's all! The script will guide you through the full process, and tells you how to start your freshly bootstrapped Gentoo RAP system if it successfully runs up till the end. In normal cases, you don't need any more than just this.

Tested Distributions
At the moment, RAP supports Linux distributions only. The following tables tracks the tested distributions with the script. Feel free to add your own.

Compile Inside Memory
On a cluster node with large memory and shared network filesystem, compiling in a memory tmpfs can be significantly faster. /dev/shm is mounted as tmpfs by many distributions. For example:

Before calling bootstrap-rap.sh, it can be done with

In stage3, why should binutils be installed before glibc?
glibc has strict version dependence on binutils. Otherwise we get this error:

Why is there no binutils installed in stage2?
Debian multiarch gcc require binutils to support sysroot. By default, binutils of gentoo is not built with sysroot. And we do not need it. stage3 builds binutils very early.

How to add an en_US.UTF-8 locale?
We are having our own libc, the locales should be generated in Prefix. Add an entry to EPREFIX/etc/locale.gen

Then generate the locale by

For more details, refer to the handbook.

Trouble Shooting
RAP is expected to run on a wild variety of environments. Let's document here the problems met during the bootstrap and the solutions made. It is very funny to see how many host systems are badly crewed.

/bin/tar exists but does not work. The working one is in /usr/local/bin
Solution: edit the script to prepend /usr/local/bin to PATH.

Kernel Version Too Low
>=glibc-2.20 requires >=linux-2.6.32. Bootstrapping on old kernels results in

Versions of glibc should be masked: