Top
Best
New

Posted by zX41ZdbW 13 hours ago

Solo – a .so loader for static Linux binaries(github.com)
153 points | 172 commentspage 2
simonask 11 hours ago|
It is a testament to the complete failure of the GNU/Linux userland that something like this seems at all attractive to spend time on (or, it seems, LLM tokens).

Actually, scratch that, because Windows and macOS have historically struggled with ABI compatibility as well (macOS less so, due to not caring about backward compatibility in the first place).

How did we get to the point where people feel they need to go to the length of embedding an ELF loader in their binary (!!) rather than just linking with glibc?

jeroenhd 5 hours ago||
> How did we get to the point where people feel they need to go to the length of embedding an ELF loader in their binary (!!) rather than just linking with glibc?

Most Linux distros have been built around the ability to compile their software together in a large repository, from source, so this was rarely ever an issue. Proprietary distribution or executing binaries from the internet like on Windows just wasn't really a common issue.

The problem arises when you start combining distros (glibc and MUSL for instance) or if you try to do the Windows model of sharing software. Historically, projects just compiled different versions for different distros.

When doing static compilation, just targetting an old version of glibc (which is generally forward compatible) also works.

You can hack your way into using software like this (or rather, have an LLM hack its way in) but I don't think any real distro actually cares. This issue exists in a quite small space where people are trying to use proprietary software built for glibc in MUSL environments for whatever reason, and the usual compatibility tricks don't work.

It's a niche use case for most Linux distros. It's not a "complete failure" of the GNU/Linux userland, it's the result of a couple of proprietary components not having MUSL builds available, or MUSL-based distributions not including libraries people want.

I'd like glibc to change so that these hacks aren't necessary for these use cases anymore, but it's not really a problem in practice for the vast majority of Linux use cases.

pg83 3 hours ago||
I disagree that this is a niche problem.

Yes, on the one hand, each specific distribution doesn't have this problem because it can pick up everything it needs.

But for us, independent developers of small programs, the problem is truly stark: we can't afford to build our programs for every distribution. And we can't afford to waste time navigating all the idiosyncrasies of various package repositories, both technical and political (not all repositories allow easy access).

And we can't count on someone else packaging our work until we become incredibly popular.

skydhash 1 hour ago||
> But for us, independent developers of small programs, the problem is truly stark: we can't afford to build our programs for every distribution.

Most people use the major distributions like Ubuntu, Debian, Fedora, Arch, alpine linux, void linux,… A build machine with VMs can easily take care of those.

> And we can't afford to waste time navigating all the idiosyncrasies of various package repositories, both technical and political (not all repositories allow easy access).

Most (if not all) package managers allow for custom repositories. No need to get access to the official ones.

diabllicseagull 11 hours ago|||
I'm mostly taken aback all the solutions devised to go around the issue, especially the container-based ones. I really disliked it when I grabbed the flatpak version of Blender only to find out that it can't have HIP support. (they might have fixed it by now but you get the point)
wmf 10 hours ago|||
Linux loves to leave papercuts unfixed or undocumented for decades. The solution is to build against an older version of glibc but no one tells you that or how to do it.
emidoots 10 hours ago|||
Luckily Zig makes this quite easy to do. In Mach[0] we are able to just `zig build -Dtarget=x86_64-linux-gnu.2.28` to build GUI apps against an ~8 year old glibc version for maximum compatibility.

This is possible because Zig allows for targeting most glibc versions out of the box with its cross-compilation support.

[0] https://machengine.org

pg83 10 hours ago|||
It's a pretty poor solution, to be honest.

1) Why should I limit myself to the available APIs?

2) Not just glibc. For example, if I build against the latest libstdc++, it will automatically support the more recent glibc. And pinning the old libstdc++ -well, that's just not a good idea.

krupan 8 hours ago|||
Complete failure is strong words when lots and lots of Linux boxes are running just fine.

I think the disconnect is mostly people that can't decide if they want a stable distro or a rolling release distro. Most everyone uses a stable distro because it's stable, but then the want some up-to-date software that isn't ore-built for their (crusty old) stable distro and they get annoyed. My solution was to finally give in and embrace a rolling release distro (I use arch, btw). If there isn't a package for something I want, it's not hard to build something myself because all my build tools, kernel, and libs are up to date.

Other reasons to want static linking is to distribute proprietary software with no source code available. Linux certainly does not cater to that scenario and I suppose some might call that a complete failure ¯ \ _ ( ツ ) _ / ¯

pg83 11 hours ago|||
Glibc has a terrible history of binary incompatibility. If that's so hard to believe, try running binaries built on one distribution on other distributions. Linux has two stable ABIs: the kernel ABI for static programs, and, ironically, WINE.
vlovich123 11 hours ago|||
I haven’t heard of this and I don’t think you’re right. Glibc, for all its faults, as a general rule does backward compatibility well. The problem is if you compile against a newer glibc (common in CI by default) and try to run on a distro with an older (common in the wild). If your CI uses an older glibc you should be fine AFAIK.
pg83 11 hours ago||
https://bugzilla.redhat.com/show_bug.cgi?id=638477 is the most "famous" example.

There are also much less well-known "little things" that regularly pop up here and there.

> If your CI uses an older glibc you should be fine AFAIK.

In any case, my binaries work not only under glibc, but also under Alpine, and (work in progress) under android/bionic.

vlovich123 10 hours ago|||
Not sure what you’re trying to show with that bug report but it’s not a case of cross distro glibc issues. If I read correctly it’s a vanilla behavioral change that exposed preexisting UB in flash.

Not sure how the comments about alpine or bionic relate either to my claim that cross distro glibc is fine.

pg83 10 hours ago||
It depends on how we define the ABI. I see it as a set of client-visible invariants that they rely on. In my world, glibc changed the client's visible invariants, breaking the client. The client works on one glibc-based host, but not on another. What is this if not "a case of cross-distro glibc issues?"

Overall, both of our points of view on compatibility were discussed well in that thread; we probably shouldn't repeat ourselves. :)

account42 4 hours ago|||
ABI is not "whatever happens to work with this distro" but "what programs that comply with the API contract compile to". Overlapping memcpy arguments is an API contract violation and thus not something covered by the ABI either. This distinction is the entire reason why C has a separate memmove function. You can't just make up your own imaginary ABI contract and then blame the system when it doesn't fulfill it. That's going to result in self-inflicted plain on any OS.
pg83 4 hours ago||
It's so good that Linus thinks differently!
ninkendo 1 hour ago|||
> It depends on how we define the ABI. I see it as a set of client-visible invariants that they rely on

By that definition, any change of any kind will break ABI, Hyrum’s law and spacebar heating and all that.

__turbobrew__ 9 hours ago|||
> Quite frankly, I find your attitude to be annoying and downright stupid.

- Linus Torvalds

That bug report was a good read.

jezek2 4 hours ago||||
This is not true. Glibc supports symbol versioning. You can use it to select old versions of used symbols. The result is a binary that can work on 20 year old distros the same as on the latest, compiled with latest compiler and Glibc.

You can also compile using old distro and old Glibc to get similar effect. Though you would miss the advances of the newer compilers.

pg83 4 hours ago||
https://news.ycombinator.com/item?id=49358538
diabllicseagull 11 hours ago|||
according to appimage recommendations as long as you build against glibc with an earlier version than the system it's run on it should be fine.

https://docs.appimage.org/reference/best-practices.html

I hear you about WINE though.

Natalia724 10 hours ago|||
[flagged]
account42 4 hours ago||
> How did we get to the point where people feel they need to go to the length of embedding an ELF loader in their binary (!!) rather than just linking with glibc?

Due to FUD, mostly.

Sane people do just link with an old enough version of glibc.

catlifeonmars 12 hours ago||
So not completely static, since it must link against a libc :P
pg83 11 hours ago|
The binary itself is completely static; the link even provides commands on how to check this!
nubinetwork 11 hours ago||
Why not just pass the GPU to a docker container?
pg83 11 hours ago|
Available in README - https://github.com/pg83/solo#how-this-differents-from-prior-...
jeffbee 12 hours ago||
How are we supposed to take this stuff seriously if the author (sic) isn't even willing to write the readme? Claude exists! If I want some slop I can push the button myself.
pg83 11 hours ago||
Tell me, are there any substantive comments on the text, on what has been done, and on the technical implementation, and not on the form?
jeffbee 11 hours ago||
Why would I ask you about this work? The root of my question is why is this type of output shared on github, rather than the inputs?
pg83 10 hours ago||
Rough
analog_daddy 9 hours ago|||
Disclaimer: This is a user’s perspective rather than a programmer’s perspective.

valid point. I am usually okay with LLM generated code since even if it might not be architecturally sound It is usually well commented and has tests and documentation for helping another agent/human debug any issues.

But, just the painful experience of debugging any dlopen related crashes and/or intermittent bugs; and the sheer amount of tokens burnt by an LLM chasing tangents when shown a stack trace; I wouldn’t touch this at least as a packager/consumer of certain apps for personal usage on older distros. So far, AnyLinux-Appimages seem to be a mature solution with great support from the developers, in case anyone lands here for packaging applications to run on older distros.

pg83 9 hours ago|||
Modern models, when properly managed with a human in the loop, write higher-quality code than humans and introduce significantly fewer bugs. Therefore, it's quite the opposite - you should expect fewer "dlopen-related crashes and/or intermittent bugs."
amoss 6 hours ago|||
> Modern models, when properly managed with a human in the loop, write higher-quality code than humans and introduce significantly fewer bugs.

I don't think anybody believes this, and interjecting it into every thread is not really convincing anyone.

someothherguyy 2 hours ago|||
where is the study confirming this?
ChocolateGod 5 hours ago|||
> So far, AnyLinux-Appimages seem to be a mature solution with great support from the developers, in case anyone lands here for packaging applications to run on older distros.

The Linux ecosystem already settled on containers to solve the problem. Namely Docker, Flatpak, Podman ec.

pg83 11 hours ago||
Isn't this a README? https://github.com/pg83/solo/blob/main/README.md
WD-42 11 hours ago|||
Parents point is the readme was written by Claude. Signals low effort.
pg83 11 hours ago||
README.md was written by me, and I, of course, used claude/codex for it. In general, I do everything through claude/codex, the reasons are described in https://github.com/pg83/solo/blob/main/CONTRIBUTING.md . And no, it's not low effort, and no, I don't see the point in wasting time de-claude-ifying the text just to avoid it looking like I didn't spend enough time on it.
WD-42 11 hours ago|||
You make it clear why you write all your code through a llm. But a README is not code. Presumably you would like people to read it. A machine authored readme reflects poorly on a project.
pg83 10 hours ago|||
In any case, it's open source. If you don't like something, even if the project seems generally useful, go ahead and fix it. The PR came in. I'm an engineer and I can write good code, but that doesn't mean I can write good README.mds!
pg83 11 hours ago|||
The author of the README is me, the machine just wrote it. I am not a native speaker of English, my written English is simply terrible, no one wants to read the text that I wrote exactly :))
dummydummy1234 8 hours ago|||
For context, I read Claude output every single day, I know what it is reliable with and what it is not. Or at least I have a feel for how much I can trust it.

It may not be clear to a non-english first language person, but when I read Claudes documentation, my brain immediately picks up claude-speak. Therefore, I expect the code to be generally correct, maybe, depending on how specific I was during my prompting. In no way shape or form do I really trust it, at least until i dig into the code and validate my mental model. And query the review for edge cases etc...

By writing your documentation with Claude, my brain immediately associates the quality of the project with the quality of unreviewed Claude output.

To a degree this is unfair, as it is like judging the quality of someone's work based on their accent.

But Claudes accent, has a high correlation with Claude, so unlike with people, where an accent has no bearing on technical ability, Claude being Claude does.

I would much rather read a typo ridden sentence than claudism, even just as a forward, explaining what you did vs the ai, and telling the users how much we should trust it.

Also, If you really insist on using AI to write, have another model rewrite docs/comments into regular English (opus 4.6 for example is much better than 4.7, 4.8, or 5.

It is open source so you can do whatever you like, but people (especially native English speakers) will discount your work, because Claude, especially opus 5 writes very very badly.

The people who say they would rather see a typo infested mess of a readme are serious. Or even just write in your native language and then have Claude translate.

Both of those are better indications of proof of effort than a Claude readme.

pg83 8 hours ago|||
> Or even just write in your native language and then have Claude translate.

That's exactly what I did.

FooBarWidget 6 hours ago|||
> By writing your documentation with Claude, my brain immediately associates the quality of the project with the quality of unreviewed Claude output.

I'm sorry, but I agree with the author: if a certain writing style makes you associate the work with low-quality, then that's your problem. The author shouldn't have to rewrite the readme just to avoid triggering your automatic unfounded associations. If you look at the substance of the work, including the test cases, then this is clearly not easy work that can be vibe coded in a single pass.

It's just like emdash. Everybody digs on how it's a signifier of LLM text, but I've used emdash for years because it's gramatically correct. I shouldn't have to stop using emdash just to avoid kneejerk reactions.

duskdozer 2 hours ago|||
LLMs often use emdashes in a distinct incorrect way. It's not just the existence of any emdash, although considering you were in a very small minority of older users, it now warrants increased scrutiny, unfortunately for you.
nasso_dev 4 hours ago|||
if 99 poor effort/quality projects have a readme that reads in a particular style, then you expect the 100th project with a readme in the same style to also be of poor effort/quality

statistically, it only makes sense for your expectations to immediately be low when you encounter this writing style because there are just so much slop out there

the author is free to keep that writing style but they should be aware that this will—at least on the surface level—make their project look exactly like the metric ton of slop we see posted everyday everywhere

toast0 10 hours ago||||
I think we're trying to tell you that we actually would prefer it.
Barbing 11 hours ago|||
I believe usually when someone complains about text written by a language model they are hoping to read human-written text instead of human-laundered LLM output.
jlebar 11 hours ago|||
Implicit assumption of gp is that the README is llm authored. (Which, I agree is how it reads to me.)
j16sdiz 12 hours ago|
> backed by its own ELF loader (x86-64 and aarch64) and a glibc ABI bridge

Yacks

mananaysiempre 11 hours ago||
If you want to load the OpenGL/Vulkan vendor driver then unfortunately you don’t have much of a choice: those are linked against glibc, and I believe generally also against libwayland so screw off if you want a different protocol library (I might be wrong about the latter part). If you instead want to load plugins or whatnot into your statically linked executable, then personally I’d argue that you shouldn’t be emulating Linux dynamic linking semantics at all, because the whole late-bound global namespace thing is silly and wrong. (Solaris, which is where Glibc took this model from, moved away from it[1] as much as compatibility allowed, and so did Darwin[2], whereas Windows never made the mistake to begin with, but Glibc persisted and Musl copied it.)

[1] https://www.linker-aliens.org/blogs/rie/entry/direct_binding...

[2] https://web.archive.org/web/20011004090044/http://developer....

fabiensanglard 12 hours ago|||
Please elaborate and explain to people with less knowledge why this is bad.
arjvik 12 hours ago||
Mapping parts of files into executable memory, and then executing them, had better be bulletproof! Exploiting this seems like a direct path to RCE, and it's likely that this sort of library is used by privileged code.

Purely academically, this is a very cool piece of code! Just hoping that it gets a thorough vetting before used by privileged/security-critical software :)

pg83 10 hours ago||
Well, ld.so already does this, and it's no big deal. The Python interpreter also does this when executing a .py script (code is code, whether it's machine-readable or human-readable).

In any case, we take testing very seriously—every glibc shim we've written is covered with tests, and we run our loader against 1000 of the most popular Debian packages. The project has 100% code coverage. Perhaps, if I have the time, I'll also do some fuzzing on this thing.

lunixbochs 12 hours ago||
similar energy to my https://github.com/lunixbochs/crossldso
pg83 11 hours ago||
Oh, cool, another prior art I didn't know :)