Been messing around with a personal project porting FreeBSD libc, mostly unmodified, running directly on Linux kernel syscalls. There’s no glibc or musl involved, just a thin translation layer for the places where the two kernels disagree. Termios encoding was probably the most annoying part so far.
This week I got LLVM’s libc++, libc++abi, and libunwind building against it through LLVM’s own build system. C++ code, containers, exceptions, all of it now compiles, links, and runs.I also have 106 FreeBSD base-system commands working. That includes things like cat, ls, cp, mv, find, expr, the interactive sh, localedef, tsort, getconf, and a long list of older BSD utilities like caesar, primes, jot, ministat, col, soelim, and others.
It's mostly unmodified FreeBSD source that go through structural ELF checks and most of them have their own functional tests beyond that.
So, if anyone ever wondered whether the FreeBSD kernel could be replaced cleanly with the Linux kernel, the answer is 100% yes, and with surprisingly few source modifications.
This week I got LLVM’s libc++, libc++abi, and libunwind building against it through LLVM’s own build system. C++ code, containers, exceptions, all of it now compiles, links, and runs.I also have 106 FreeBSD base-system commands working. That includes things like cat, ls, cp, mv, find, expr, the interactive sh, localedef, tsort, getconf, and a long list of older BSD utilities like caesar, primes, jot, ministat, col, soelim, and others.
It's mostly unmodified FreeBSD source that go through structural ELF checks and most of them have their own functional tests beyond that.
So, if anyone ever wondered whether the FreeBSD kernel could be replaced cleanly with the Linux kernel, the answer is 100% yes, and with surprisingly few source modifications.