PINE64
Migrating from glibc to musl on Gentoo - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114)
+--- Thread: Migrating from glibc to musl on Gentoo (/showthread.php?tid=14486)



Migrating from glibc to musl on Gentoo - pkubaj - 07-22-2021

I'm running Gentoo with glibc on PBP.

I'm interested in switching to musl. As I understand it, it should be done via reinstalling, which I want to avoid since it took quite some time to set things up.

Is it possible to just untar the stage3 tarball onto / filesystem from liveusb? Would such OS boot?

I know I would need to rebuild all the installed software, but I just want things to boot now.

Overall, what are the cons of using musl on PBP?


RE: Migrating from glibc to musl on Gentoo - alchemist - 07-23-2021

Hi,

You cannot switch from glibc to musl, you need to reinstall all using the musl-based toolchain.

If you have a recent powerful PC, you can pre-build the binaries using cross-compilation and a QEMU chroot.


RE: Migrating from glibc to musl on Gentoo - pkubaj - 07-23-2021

I know I need a musl-based toolchain. This is why I'm considering extracting stage3 built with musl on top of my / partition.

Wouldn't that work?


RE: Migrating from glibc to musl on Gentoo - alchemist - 07-24-2021

musl and glibc are the central system C library implementations, they are not binary compatible.
Almost everything in your system is using it.

That means that if you overrides /lib/libc*.so with musl version, all binaries compiled with glibc will immediately stop to function.

This is not simply changing a tool by an other one. This is the core of the system, along the Linux kernel.


RE: Migrating from glibc to musl on Gentoo - pkubaj - 07-24-2021

Well, this is why I want to extract the whole stage3, not just musl itself. Overwriting / partition with musl stage3 would mean all the binaries would get replaced too. The only things that wouldn't be replaced would be everything else installed (X11, Firefox etc.). Those would be the things that I would need to rebuild, but at least the OS should be bootable.

If my analysis is incorrect, please correct me.


RE: Migrating from glibc to musl on Gentoo - alchemist - 07-24-2021

You can try it, but you will go faster if you create a new sane system in a subfolder, chroot inito it until it is fully ready, then switch the systems by swapping the root folders.


RE: Migrating from glibc to musl on Gentoo - pkubaj - 07-24-2021

Oh, I actually have a chroot already to play with it, so might as well go with that. Thanks for confirmation.