I would like to ask you the criteria that specify executable (or library) binary file can run in each environments. This is for the purpose of redistribution of files.
As my experience, the criteria mainly depends on two points, that is, OS (e.g. Linux, Windows, Android, Mac etc), and compilers (e.g. MSVC, GNU, Intel etc).
However, as my shallow knowledge about hardware, I suppose that CPUs are most important point, particularly their instruction sets (e.g. x86, x86-64, arm64-v8a etc).
How do you judge the binary file you built in an environment, and whether it can or cannot be used in other environments?
It's quite simple, really. On most OSs, a binary will at least run on later versions of the same OS, on the same architecture (whether it will work correctly is a different matter).
On Linux, there's no guarantee that a binary built on one machine will run on any other machine. This is because Linux distributions don't maintain a stable ABI that binaries can link to at run time. IIRC the main culprit is glibc.
Thank you for your experienced reply, and I apologize for my late reply.
I understand that backward compatibility has been satisfied by OS vendors other than Linux.
On Linux, there's no guarantee that a binary built on one machine will run on any other machine. This is because Linux distributions don't maintain a stable ABI that binaries can link to at run time. IIRC the main culprit is glibc.
For Linux, this sounds that not OS version, but shared library version (standard library, or kernel?) is the main cause to hamper transferability of executable (or library) binary files, isn't it?.
If it is correct, are binary files runnable when shared libraries used in runnable environments attached?
Or, the shared libraries are so dependent on OS versions, and so is it difficult to redistribute them with our custom binary files?
I know that some open source software/libraries (e.g. paraview, Qt etc) are distributed in the form of binary files for Linux OS (But, a lot of others are done in the form of source codes).
I suppose that each OSS community takes moderate responsibility to deploy binaries for several environments for OS, but I guess that there is no standard specification of runnable environments for Linux, doesn't it?
The problem of shared libraries is usually sidestepped by statically linking them into the binary. I think this is how Go executables do it. I've tried it in the past for C/++ executables with tools such as statifier, but the results were mixed. Sometimes it worked, other times not so much; sometimes it generated (for the time) massive files.
I guess that there is no standard specification of runnable environments for Linux, doesn't it?
No, there's not. IMO it's one of the outstanding problems in Linux.
OK, I keep in mind that distributions of binary files should be carefully conducted for Linux OS.
(I am going to restrict package (e.g. Ubuntu, etc), versioning)