View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 521
|
Posted: Thu Aug 08, 2024 10:53 am Post subject: Musl? |
|
|
Hi folks
I guess this isn't specifically a Gentoo question, but it relates to topics that I see on this forum.
I'm absolutely, 100% in favour of variety in Linux. That glibc isn't the only standard C library available for Linux seems a good thing to me.
But, having said that, I've never used MUSL, except as part of Alpine in containers. I'm fairly sure that little of the code I've written for Linux would work unmodified with MUSL, because I use glibc extensions freely, without giving much thought to the matter.
I guess MUSL is a bit smaller than glibc, so I can see why that would matter in containers. But in a desktop Linux system, is there any compelling advantage to using it, compared to glibc?
BR, Lars. |
|
Back to top |
|
|
kgdrenefort Guru
Joined: 19 Sep 2023 Posts: 312 Location: Somewhere in the 77
|
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 521
|
Posted: Thu Aug 08, 2024 12:39 pm Post subject: |
|
|
Thanks. This is pretty technical information, and I can see why I'd need to read this if I wanted to be sure that my applications would work with MUSL. But it doesn't really tell me why I might prefer it over the alternatives.
BR, Lars. |
|
Back to top |
|
|
kgdrenefort Guru
Joined: 19 Sep 2023 Posts: 312 Location: Somewhere in the 77
|
Posted: Thu Aug 08, 2024 12:50 pm Post subject: |
|
|
From gentoo's wiki:
Code: | (…) musl takes a different approach: it is written with static linking in mind, but also with fast dynamic linking capabilities, while remaining close to standards and conscious of security issues. (…) |
https://wiki.gentoo.org/wiki/Project:Musl
So far as I understand, Musl try to be 100% compliant with code compiling on GLibC, trying to replace it (as an alternative) and is available in Gentoo.
It tries to do a better job as I can read, but still my skills are too low to make any serious statement.
Regards,
GASPARD DE RENEFORT Kévin _________________ Traduction wiki, pour praticiper.
Custom logos/biz card/website. |
|
Back to top |
|
|
BurningMemory n00b
Joined: 17 Jan 2023 Posts: 54
|
Posted: Thu Aug 08, 2024 1:33 pm Post subject: Re: Musl? |
|
|
lars_the_bear wrote: | But in a desktop Linux system, is there any compelling advantage to using it, compared to glibc? |
Well, there really isn't aside from, maybe, reducing the attack surface as musl is very minimal and more "secure".
Also, in my experience it does perform really well on servers, almost no problems nowadays. On the desktop
side of things, you may find yourself pulling a little less packages and with a huge gigantic PERHAPS changes
in performance. But mostly it's a no. Also, be aware that some software does not compile against musl and
you may have unexpected compile-time failures, like with gobject stuff and sddm. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 9272
|
|
Back to top |
|
|
eschwartz Developer
Joined: 29 Oct 2023 Posts: 221
|
Posted: Thu Aug 08, 2024 2:56 pm Post subject: Re: Musl? |
|
|
lars_the_bear wrote: | I guess MUSL is a bit smaller than glibc, so I can see why that would matter in containers. But in a desktop Linux system, is there any compelling advantage to using it, compared to glibc?
BR, Lars. |
Some people REALLY dislike a fast malloc() implementation, and as such consider it beneficial to use musl.
I do not know why...
musl has some advantages with producing statically linked binaries, something that is somewhat unusual to actually need. I would like to be able to install musl on a glibc system using musl's support for isolating its runtime in /usr/lib/musl/libc.so and compiling using the musl-gcc wrapper.
In general I wouldn't bother using it except for building freestanding binaries or on memory+size constrained systems, Embedded is a good use case. Desktop linux is NOT a good use case, except for building a slightly better sys-apps/busybox[static]. This can actually come in handy for recovering broken systems, as it gives you a swiss army toolchest of core utilities, especially e.g. tar. |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3698 Location: Rasi, Finland
|
Posted: Thu Aug 08, 2024 7:30 pm Post subject: |
|
|
If you need to run some binary-only programs on linux (like paid games), those are most probably linked against glibc. I'd guess there are some workarounds, but I'm not certain.
Sometimes I like to toy around with low power systems and use musl on them. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 521
|
Posted: Fri Aug 09, 2024 7:08 am Post subject: |
|
|
Hi folks
Thanks. I use Alpine (with MUSL) in containers all the time, and I'm amazed at how small the container image can be made. But, from what I'm reading, there doesn't seem to be a compelling reason to use it on a desktop system.
BR, Lars |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|