Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Musl?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Thu Aug 08, 2024 10:53 am    Post subject: Musl? Reply with quote

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
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 312
Location: Somewhere in the 77

PostPosted: Thu Aug 08, 2024 11:00 am    Post subject: Reply with quote

Hello,

Not being qualified to answer, maybe it could leads you : https://wiki.musl-libc.org/functional-differences-from-glibc.html

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Thu Aug 08, 2024 12:39 pm    Post subject: Reply with quote

kgdrenefort wrote:
Not being qualified to answer, maybe it could leads you : https://wiki.musl-libc.org/functional-differences-from-glibc.html


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
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 312
Location: Somewhere in the 77

PostPosted: Thu Aug 08, 2024 12:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
BurningMemory
n00b
n00b


Joined: 17 Jan 2023
Posts: 54

PostPosted: Thu Aug 08, 2024 1:33 pm    Post subject: Re: Musl? Reply with quote

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
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9314

PostPosted: Thu Aug 08, 2024 2:50 pm    Post subject: Reply with quote

https://bugs.gentoo.org/show_bug.cgi?id=musl-porting
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 240

PostPosted: Thu Aug 08, 2024 2:56 pm    Post subject: Re: Musl? Reply with quote

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
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3752
Location: Rasi, Finland

PostPosted: Thu Aug 08, 2024 7:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Fri Aug 09, 2024 7:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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