How PlashGlibc is built

There are two systems for building PlashGlibc:

Wrapping library calls

The main source of complication in building PlashGlibc is that some of its functions must be implemented in terms of glibc's normal version of that function. For example, PlashGlibc's fork() is a wrapper around glibc's normal fork() implementation. PlashGlibc's fork() clones the connection to the server before forking the process.

With the integrated build process, this is done by renaming the original versions of the calls, adding a "kernel_" prefix to the name. e.g. fork() becomes kernel_fork(). In most cases this is done by changing syscalls.list files (which cause syscall code to be generated by assembler files), but in some cases it requires changing glibc C files.

With the separate build process, linking happens in multiple steps:

Problems with the old, separate build process

There is a risk that relinking does not reproduce what glibc's build process does, and links with wrong options, producing a libc.so with subtle bugs.

Can't reuse Debian packaging for libc6.

When building the Plash-specific object files, the C code is compiled against installed libc header files rather than the header files in glibc's source tree. Firstly this is bad because of the dependency it introduces; this stops you from building glibc 2.4 on a system with 2.3.6 installed. Secondly, glibc's private headers contain some definitions not available in the public headers, such as architecture-specific stuff related to struct stat.

PlashGlibcBuildProcess (last edited 2008-05-05 18:16:34 by MarkSeaborn)