LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-27-2022, 03:21 PM   #1
GoodSolonius
LQ Newbie
 
Registered: Dec 2022
Posts: 2

Rep: Reputation: 0
musl-related issues on void linux


Hello,

I have a few questions related to running dynamically-linked binaries on musl. Let me start with a few statements which I feel are relevant:
1. I'm currently on Void Linux, amd64 architecture. My musl version is 1.1.24_12, I'm guessing it's either unmodified by the packaging or only slightly tweaked. Either way, I'm assuming other users' experience is similar.
2. This isn't specifically a troubleshooting question, I'm not really expecting to get a simple solution to my problem. If I do get one I'm going to feel like a clown for making such a long OP.
3. I don't really want to switch back to glibc because of laziness and I'm probably more inclined towards the philosophy of musl anyway. This is also the reason I chose this libc implementation in the first place.

Now onto the problem.

Trying to run dynamically-linked binaries, usually games, results in errors with loading shared libraries, or `symbol not found`. Here's a specific example of Factorio:
Code:
Error loading shared library libresolv.so.2: No such file or directory (needed by /home/me/games/factorio/bin/x64/factorio)
Error relocating /home/me/games/factorio/bin/x64/factorio: __res_nquery: symbol not found
Error relocating /home/me/games/factorio/bin/x64/factorio: __dn_expand: symbol not found
Ldd results in many more `symbol not found`.

Then there are also strange problems with SEGFAULTs on some of my programs. I'm pretty sure these are related to libc, despite being statically-linked - I think they call some c libraries during runtime (ldd would suggest this). However, I don't know how to debug this further, and it's been a while since I wrote it. If anybody is interested in details feel free to ask.

Here are my questions, in no particular order:
What is your experience with musl-related errors?
What are the prospects of these issues being fixed? I'm assuming the only good solution lies in improving musl, but perhaps I'm wrong, and the project has no interest in resolving these - I can see many reasons for such an approach. Also I'm unfamiliar with the state of the project in general, so I'd appreciate any information from somebody more knowledgeable.
 
Old 12-28-2022, 06:18 AM   #2
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
The way I understand it, software needs to be compiled against the libc your going to be using at runtime, just like any other lib. As far as I know, these two competing libc implementations are not intended to be binary compatible with each other since that would pointless and offer no advantage.

If I remember correctly most independent projects that support Void, supply 2 packages. One for musl, and one for glib.

 
1 members found this post helpful.
Old 12-28-2022, 02:11 PM   #3
GoodSolonius
LQ Newbie
 
Registered: Dec 2022
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mill J View Post
The way I understand it, software needs to be compiled against the libc your going to be using at runtime, just like any other lib. As far as I know, these two competing libc implementations are not intended to be binary compatible with each other since that would pointless and offer no advantage.

If I remember correctly most independent projects that support Void, supply 2 packages. One for musl, and one for glib.

I just checked and their FAQ page states:
> Yes and no. At both the source and binary level, musl aims for a degree of feature-compatibility, but not bug-compatibility, with glibc. [...]
> [...] Binary compatibility is much more limited, but it will steadily increase with new versions of musl. At present, some glibc-linked shared libraries can be loaded with musl, but all but the simplest glibc-linked applications will fail if musl is dropped-in in place of /lib/ld-linux.so.2.

So I expect either a compatibility layer will eventually be released or the library will become more compatible with binaries at some point in the future.

I don't think (almost) complete compatibility between musl and glibc would be pointless, since musl strives to be faster, simpler, more correct, etc. - all of which doesn't necesarily imply non-compatible behaviour (bugs are an exception to this, but porting bugs isn't really reasonable anyway).

Additionally, I have no reasonable way of compiling proprietary software for musl, since I have no access to source code. Sure, a case for open source could be made here, but I'm talking about convenience, games, and some rust libraries, which are the only ones I can do anything about.

I can confirm that Void packages work fine.
 
Old 12-28-2022, 05:45 PM   #4
Mill J
Senior Member
 
Registered: Feb 2017
Location: @127.0.0.1
Distribution: Mint, Void, MX, Haiku, PMOS, Plasma Mobile, and many others
Posts: 1,258
Blog Entries: 2

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Hmm, that interesting, thanks for sharing. I wasn't aware that musl was aiming for a drop in replacement for glib. I guess it's been several years since I've started with Void. I just chose glib since I needed to develop software to run on a "regular" linux distro.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Void Linux gave itself to the void, Korora needs a long siesta -- life is hard for small distros LXer Syndicated Linux News 0 05-16-2018 09:50 AM
Void Linux is... void black-clover Linux - Networking 8 11-23-2017 08:04 PM
pthread giving error: invalid conversion from ‘void* (*)(int*)’ to ‘void* (*)(void*)’ knobby67 Programming 4 05-05-2017 10:54 AM
void main(void) linuxanswer Programming 4 10-26-2003 12:37 AM
void foo(void) and void foo() lackluster Programming 9 02-15-2003 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration