View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 05 Jun 2024 Posts: 364
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
kgdrenefort Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/7661068826613b962e31a4.jpg)
Joined: 19 Sep 2023 Posts: 292 Location: Somewhere in the 77
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lars_the_bear Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 05 Jun 2024 Posts: 364
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
kgdrenefort Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/7661068826613b962e31a4.jpg)
Joined: 19 Sep 2023 Posts: 292 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 |
|
![](templates/gentoo/images/spacer.gif) |
BurningMemory n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
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 |
|
![](templates/gentoo/images/spacer.gif) |
asturm Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 05 Apr 2007 Posts: 9101
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eschwartz Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/180460208566750902dba46.png)
Joined: 29 Oct 2023 Posts: 133
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Zucca Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/1241878214609aa5b503437.gif)
Joined: 14 Jun 2007 Posts: 3607 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 :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lars_the_bear Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 05 Jun 2024 Posts: 364
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|