I have made some changes in the build system of frankenlibc, now it is
much closer to the original plan, and much easier to use.

It now builds a complete libc.a that includes NetBSD's libc, the rump
kernel, the frankenlibc libc stubs and the frankenlibc platform code.
This means you can now simply link a program against this libc (and
the crt) and it will magically run against a rump kernel instead of
the host.

eg compiling code to run on a rump kernel is now simply cc
--sysroot=path/to/rump myprog.c -o myprog if your compiler supports
sysroot sanely, plus a linker script if you are using the qemu-arm
target.

This has the effect that configuring which rump modules are compiled
into your rump kernel needs to be done when the libc is built, so
there is a new command line option eg ./buildc.sh -L
net_netinet,net_netinet6 will compile a rump kernel with just ipv4 and
ipv6 networking - it works out which base modules it needs as well.
You can compile multiple versions with different modules using the -d
option to put them in a different directory. It also gets rid of the
complicated -Wl,--no-as-needed invocations, by linking the entire rump
kernel into a single rumpkernel.o object file, inside the libc.a, so
the linker is unable to discard parts.

It now creates toolchain wrappers (by default in rump/bin), which deal
with the fact that only some compilers support a plain sysroot easily,
so it creates a sysroot for clang where supported (Linux, FreeBSD),
and a simple wrapper for NetBSD/clang that gives a few warnings but
works (NetBSD linker does not support sysroot). For gcc it uses a spec
file. The toolchain wrappers are named after the rump ones with
rumprun added, eg x86_64-rumprun-netbsd-gcc, until we get different
advice.

It is still missing much useful stuff I intend to add shortly, eg
pthread support, c++ support, userspace network devices etc.

Reply via email to