[haiku-development] musly libroot

  • From: "Alexander von Gluck IV" <kallisti5@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 10 Apr 2019 21:26:33 +0000

Good afternoon!

I've been hacking away at riscv64 support and noticed how bad of a state our
stdc library is.

 https://git.haiku-os.org/haiku/tree/src/system/libroot/posix/glibc

We're pretty much on our own at this point since we based our libc on
an *old* version of glibc with a ton of backports / patches.

Now... while I think we're stuck with this glibc for a while due to gcc2 abi,
we might be able to make some improvements around our modern gcc
builds.

musl is a lightweight libc which compiles on Haiku *today* with zero 
modification.
Pros:
 * musl is MIT licensed (vs LGPL for glibc)
 * musl advertises being lightweight and standards-compliant
 * Small simple codebase 
 * glibc compatibility is high 
 * literally generates .a static libraries by default. 
 * No longer a "special forked glibc", aka less work.
 * Would make llvm / clang builds of Haiku easier in the future.
Cons: 
 * Not as compatible with glibc as glibc. 
 * No m68k support :-(
 * No riscv64 support (in progress)

My thoughts are:
 leveraging a build package musl from a hpkg while linking libroot on gcc7+
 leveraging our in-tree glibc on gcc2.

Seems like a clean solution...

Thoughts?
At face value it doesn't seem like we would need a large amount of change to do 
this.

 -- Alex

Other related posts: