Earlier quoted context omitted.
Yup. Just compile it as static executable. Static binaries are very undervalued imo.
The "just" is doing a lot of heavylifting here (as detailed in the article), especially for anything that's not a trivial cmdline tool.
The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
21–30 of 215 posts
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#22This seems interesting even regardless of go. Is it realistic to create an executable which would work on very different kinds of Linux distros? e.g. 32-bit and 64-bit? Or maybe some general framework/library for building an arbitrary program at least for "any libc"?
Yup. Just compile it as static executable. Static binaries are very undervalued imo.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#23Earlier quoted context omitted.
Cosmopolitan goes one further: [binaries] that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS on AMD64 and ARM64 https://justine.lol/cosmopolitan/
>Linux if you configure binfmt_misc >Windows if you disable Windows Defender >OpenBSD only older versions
For most cases, a single Windows exe that targets the oldest version you want to support plus a single Glibc binary that dynamically links against the oldest version you want to support and so on is still the best option.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#24Is there a tool that takes an executable, collects all the required .so files and produces either a static executable, or a package that runs everywhere?
I don't think you can link shared objects into a static binary because you'd have to patch all instances where the code reads the PLT/GOT, but this can be arbitrarily mangled by the optimizer, and turn them back into relocations for the linker to then resolve them. You can change the rpath though, which is sort of like an LD_LIBRARY_PATH baked into the object, which makes it relatively easy to bundle everything but l…
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#25Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#26This seems interesting even regardless of go. Is it realistic to create an executable which would work on very different kinds of Linux distros? e.g. 32-bit and 64-bit? Or maybe some general framework/library for building an arbitrary program at least for "any libc"?
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#27This seems interesting even regardless of go. Is it realistic to create an executable which would work on very different kinds of Linux distros? e.g. 32-bit and 64-bit? Or maybe some general framework/library for building an arbitrary program at least for "any libc"?
Yup. Just compile it as static executable. Static binaries are very undervalued imo.
Here is an idea, lets go back to pure UNIX distros using static binaries with OS IPC for any kind of application dynamism, I bet it will work out great, after all it did for several years.
Got to put that RAM to use.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#28Earlier quoted context omitted.
There are things like this. The things I know of and can think of off the top of my head are: 1. appimage https://appimage.org/ 2. nix-bundle https://github.com/nix-community/nix-bundle 3. guix via guix pack 4. A small collection of random small projects hardly anyone uses for docker to do this (i.e. https://github.com/NilsIrl/dockerc ) 5. A docker image (a package that runs everywhere, assuming a docker runtime is a…
AppImage looks like what I need, thanks. I wonder though, if I package say a .so file from nVidia, is that allowed by the license?
You generally still also have to abide by license obligations for OSS too, e. G., GPL.
To be specific for the exampls, Nvidia has historically been quite restrictive (only on approval) here. Firmware has only recently been opened up a bit and drivers continue to be an issue iirc.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#29Is there a tool that takes an executable, collects all the required .so files and produces either a static executable, or a package that runs everywhere?
There are things like this. The things I know of and can think of off the top of my head are: 1. appimage https://appimage.org/ 2. nix-bundle https://github.com/nix-community/nix-bundle 3. guix via guix pack 4. A small collection of random small projects hardly anyone uses for docker to do this (i.e. https://github.com/NilsIrl/dockerc ) 5. A docker image (a package that runs everywhere, assuming a docker runtime is a…
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#30Earlier quoted context omitted.
Yup. Just compile it as static executable. Static binaries are very undervalued imo.
We had a time when static binaries where pretty much the only thing we had available. Here is an idea, lets go back to pure UNIX distros using static binaries with OS IPC for any kind of application dynamism, I bet it will work out great, after all it did for several years. Got to put that RAM to use.