blob: ea10c55fc52ae5bd46a481f4bd9c0dde79412fd9 [file] [log] [blame]
This is klibc, what is intended to be a minimalistic libc subset for
use with initramfs. It is deliberately written for small size,
minimal entanglement, and portability, not speed. It is definitely a
work in progress, and a lot of things are still missing.
The build procedure is not very polished yet, but for a native build
with the default configuration it should be simple:
1. In a recent Linux kernel source directory, run:
make headers_install INSTALL_HDR_PATH=<klibc-source-dir>/linux
2. In the klibc source directory, run:
If you're cross-compiling, you need to set KLIBCARCH to the
appropriate architecture, and set CROSS_COMPILE to your toolchain
IMPORTANT: if you're on a 64-bit machine with a 32-bit userland
(ia64, mips64, ppc64 sparc64, s390x or x86_64), and you want to
build the 32-bit version: you need to set KLIBCARCH to the 32-bit
architecture as well as set up the linux/include/asm symlink to
point to the 32-bit architecture. Building the 32-bit architecture
usually (but not always) produces smaller binaries, and is likely
to be better tested.
If you are on ARM, and want to build a thumb version of the library
(this is supported), change OPTFLAGS in arch/arm/MCONFIG to build
thumb code.
Building without kernel source
If you already have a copy of the current kernel UAPI headers, you
don't need the kernel source as well. You can either:
1. Copy or link to the UAPI headers so that they appear under the
"linux/include" subdirectory.
2. Set the KLIBCKERNELSRC variable on the "make" command line to
point to the *parent* of the UAPI headers directory.
Architecture support
The following is the last known status of various architectures:
alpha: Working
arm-thumb: Untested
arm: Working
arm26: Not yet ported
arm64: Working
avr32: Not yet ported
cris: Working
h8300: Not yet ported
i386: Working
ia64: Working static, shared untested
m68k: Working
mips: Working
mips64: Working
parisc: Untested
parisc64: Not yet ported
ppc: Working
ppc64: Working
s390: Working
s390x: Working
sh: Runtime breakage
sh64: Not yet ported
sparc: Working
sparc64: Working
v850: Not yet ported
x86-64: Working
xtensa: Not yet ported
Shared library support requires recent binutils on many architectures.
Note that even the "working" ones likely have bugs. Please report
them if you run into them.
Try the test programs in the tests/ directory. They should run...
Contact the klibc mailing list:
... for more info.