Earlier quoted context omitted.
>Linux if you configure binfmt_misc >Windows if you disable Windows Defender >OpenBSD only older versions
>> Linux > if you configure binfmt_misc I don't think that's a requirement, it'll just fall back to the shell script bootstrap without it.
The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
111–120 of 215 posts
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#112Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#113Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#114Earlier 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…
It should be noted that AppImages tend to be noticeably slower at runtime than other packaging methods and also very big for typical systems which include most libraries. They're good as a "compile once, run everywhere" approach but you're really accommodating edge cases here. A "works in most cases" build should also be available for that that it would benefit. And if you can, why not provide specialized packages fo…
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#115Is 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?
mkdir chroot
cd chroot
for lib in $(ldd ${executable} | grep -oE '/\S+'); do
tgt="$(dirname ${lib})"
mkdir -p .${tgt}
cp ${lib} .${tgt}
done
mkdir -p .$(dirname ${executable})
cp ${executable} .${executable}
tar cf ../chroot-run-anywhere.tgz .Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#116So what we need is essentially a "libc virtualization". But Musl is only available on Linux, isn't it? Cosmopolitan ( https://github.com/jart/cosmopolitan ) goes further and is available also on Mac and Windows, and it uses e.g. SIMD and other performance related improvements. Unfortunately, one has to cut through the marketing "magic" to find the main engineering value; stripping away the "polyglot" shell-script hac…
Really, what would the world look like if this problem had been properly solved? Would the centralization and monetization of the Internet have followed the same path? Would Windows be so dominant? Would social media have evolved to the current status? Would we have had a chance to fight against the technofeudalism we're headed for?
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#117Earlier quoted context omitted.
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?
AppImage is not what you need. It's just an executable wrapper for the archive. To make the software cross-distro, you need to compile it manually on an old distro with old glibc, make sure all the dependencies are there, and so on. https://docs.appimage.org/reference/best-practices.html#bina... There are several automation tools to make AppImages, but they won't magically allow you to compile on the latest Fedora an…
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#118Earlier quoted context omitted.
You can "package" all .so files you need into one file, there are many tools which do this (like a zip file). But you can't take .so files and make one "static" binary out of them.
> But you can't take .so files and make one "static" binary out of them. Yes you can! This is more-or-less what unexec does - https://news.ycombinator.com/item?id=21394916 For some reason nobody seems to like this sorcery, probably because it combines the worst of all worlds. But there's almost[1] nothing special about what the dynamic linker is doing to get those .so files into memory that it can't arrange them in o…
There is no universal, working way to do it. Only some hacks which work in some special cases.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#119Earlier quoted context omitted.
Well not a static binary in the sense that's commonly meant when speaking about static linking. But you can pack .so files into the executable as binary data and then dlopen the relevant memory ranges.
Yes, that's true. But I'm always a bit sceptical about such approaches. They are not universal. You still need glibc/musl to be the same on the target system. Also, if you compile againt new glibc version, but try to run on old glibc version, it might not work. These are just strange and confusing from the end users' perspective.
Why would you include most of your dynamic libraries but not your libc?
You could still run into problems if you (or your libraries) want to use syscalls that weren't available on older kernels or whatever.
Re: The Holy Grail of Linux Binary Compatibility: Musl and Dlopen
#120Earlier quoted context omitted.
Statically linked binaries are a huge security problem, as are containers, for the same reason. Vendors are too slow to patch. When dynamically linking against shared OS libraries, Updates are far quicker and easier. And as for the size advantage, just look at a typical Golang or Haskell program. Statically linked, two-digit megabytes, larger than my libc...
This is the theory, but not the practice. In decades of using and managing many kinds of computers I have seen only a handful of dynamic libraries for whom security updates have been useful, e.g. OpenSSL. On the other hands, I have seen countless problems caused by updates of dynamic libraries that have broken various applications, not only on Linux, but even on Windows and even for Microsoft products, such as Visual…
> On the other hands, I have seen countless problems caused by updates of dynamic libraries that have broken various applications,
OpenSSL is a good example of both useful and problematic updates. The number of updates that fixed a critical security problem but needed application changes to work was pretty high.