by mikewarot · 3y ago · 0 comments
Because there isn't a stable system interface table in Linux (i.e. INT 21, AH=9 prints a $ delimited string in MS-DOS, and has since the 1980s), you can't just run an executable.
The closest you're likely to get is Justine's APE - Actually Portable Executable[1] to get something you can distribute and just run.
What do you mean by this? Linux is pretty good about maintaining a stable syscall ABI. Whereas my understanding is that Windows and BSDs define the compatibility boundary at the C library level.
Web is filled with scams, malware, phishing or just insecure web pages.Even when a source code of a program is public and download page is genuine, how could I ever trust the binary? I can't, but I can verify the source code (or take a risk that someone already examined it) and trust transparent CI chain.
So even if it comes from the respected developer I won't run a notavirus.exe, unless it was compiled automatically in a public docker container.
P.S. Another option for more portable linux executables is musl C library + appimage.
Yes you can! You can run unmodified Win32 executables from the late 90s on present-day Windows systems and they work just fine. Windows has a great reputation for continuity.
There is a stable system interface, it's user32.dll and friends. You might experience a bit more pain relating to the Visual Studio runtime (vcredist) or use of COM components, but those are work-aroundable.
APE is something rather different: it's portable across different operating systems with different executable formats! Quite the technological achievement.