|
|
Subscribe / Log in / New account

Possible Distributions quote of the year

Possible Distributions quote of the year

Posted Jan 24, 2025 8:49 UTC (Fri) by farnz (subscriber, #17727)
In reply to: Possible Distributions quote of the year by bluca
Parent article: Distributions quote of the week

I have a C program linked against libc from 5 years ago that doesn't run on my modern system, because the C ABI is unstable, and I only have glibc's variant on the C ABI, not the one that the program from 5 years ago used (musl, I think, but I'm not sure).

You have to do a lot of work to keep a C program working if it's dynamically linked against a C library - it just happens that if you use glibc, they do that work for you.


to post comments

Possible Distributions quote of the year

Posted Jan 24, 2025 12:19 UTC (Fri) by bluca (subscriber, #118303) [Link] (10 responses)

Which glibc symbol has changed in an incompatible way that is causing your program to stop working?

Possible Distributions quote of the year

Posted Jan 24, 2025 12:22 UTC (Fri) by farnz (subscriber, #17727) [Link] (9 responses)

getaddrinfo is the symbol that the dynamic linker complains about - there's something different about the glibc implementation to whichever libc this was linked against.

Not that that should be a problem - after all, if C has a stable ABI, then I should be able to take a binary built against any libc and run it against glibc.

Possible Distributions quote of the year

Posted Jan 24, 2025 12:44 UTC (Fri) by bluca (subscriber, #118303) [Link] (8 responses)

No? We are talking about the ABI of the standard library shipped in your distro... obviously if you switch to a different implementation, things will change, unless those implementations provide any guarantee - and I am pretty sure musl is very very very much opposed to provide any compatibility whatsoever with glibc, at a fundamentally ideological level, and declares it loudly and broadly.

Nobody is saying that Rust should provide multiple independent and compatible standard libraries. At least one though would be nice...

Possible Distributions quote of the year

Posted Jan 24, 2025 12:57 UTC (Fri) by farnz (subscriber, #17727) [Link] (7 responses)

Why should it be obvious that, in a language with a "stable ABI", I can't pick and choose implementations of that "stable ABI", but have to limit myself to the glibc ABI, not the C ABI?

Possible Distributions quote of the year

Posted Jan 24, 2025 13:11 UTC (Fri) by bluca (subscriber, #118303) [Link] (6 responses)

Because we are talking about the ecosystem and the standard library, not the language

Possible Distributions quote of the year

Posted Jan 24, 2025 13:16 UTC (Fri) by farnz (subscriber, #17727) [Link] (5 responses)

So what you're saying is that if someone accepts your definitions of what "C" is (after all, the standard library is part of C), then by your definitions, C has a stable ABI, as long as I limit myself to a single platform. But only if I limit myself to the subset of C that has a stable ABI on that platform, and don't try to use the parts of C that don't have a stable ABI on that platform, and then take care to use an implementation of the bits of C that don't have a stable ABI that, as an implementation issue, also promises a stable ABI on that platform, rather than an implementation with a different ABI, or even an unstable ABI.

Or I can use a language that also doesn't have a stable ABI of its own, and rely on the promises it makes, rather than digging through what "C has a stable ABI" means when you're not immersed in C on Linux day-in, day-out.

Possible Distributions quote of the year

Posted Jan 24, 2025 13:46 UTC (Fri) by bluca (subscriber, #118303) [Link] (2 responses)

Of course this is about one platform, the title of the page is "Distributions quote of the week", and it is talking about a specific distribution, and a specific issue. So yeah, that's what matters. Practicality matters, and academic dicussions are academic. You can have them if you want, but what matters here, today, is reality, not abstract discourses. And the practical reality is that glibc has had a stable ABI for the past 20 years and the Rust stdlib can't even go 20 minutes without breaking its own. And that matters in practice when building a distribution, no matter what purely abstract-level arguments one can concoct about the language(s) in general.

Possible Distributions quote of the year

Posted Jan 24, 2025 13:47 UTC (Fri) by bluca (subscriber, #118303) [Link]

Whops sorry Daroc I saw your request after replying here, I'd delete the reply if there was a button.

Possible Distributions quote of the year

Posted Jan 24, 2025 13:51 UTC (Fri) by farnz (subscriber, #17727) [Link]

Changing to "the glibc ABI is stable" is not what you said, though. You promised me that the C ABI is stable, and it's, as a practical matter, not, since I have a binary written in C using just a POSIX libc that I cannot run, because I no longer recall which specific C it depends upon.

Possible Distributions quote of the year

Posted Jan 24, 2025 18:01 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

> So what you're saying is that if someone accepts your definitions of what "C" is (after all, the standard library is part of C), then by your definitions, C has a stable ABI, as long as I limit myself to a single platform.

It's a stable ABI if you don't update it. See? Very easy!

Possible Distributions quote of the year

Posted Jan 24, 2025 19:01 UTC (Fri) by daroc (editor, #160859) [Link]

Possibly you didn't see my other comment — I think this discussion has gotten repetitive, and this comment doesn't add anything to it. Please, let's stop here.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds