This is not essential for my programs, but merely out of curiosity. Is it possible to, preferably using gcc
, compile a 'fat' binary for Linux including multiple architectures such as combinations of amd64
, i386
, lpia
and powerpc
?
views:
51answers:
2
+2
A:
The ELF format for executables that linux uses does not support fat binaries, so there's currently not a reasonable way to do this.
There's an extension to ELF available at http://icculus.org/fatelf/ , to use it you need to patch various parts (linux kernel,binutils,glibc etc.) as these changes are not integrated in the mainline yet.
nos
2010-09-18 09:04:07
How would I go about compiling a FatELF? Is there planned FatELF support for the kernel in the future?
Delan Azabani
2010-09-18 09:07:09
1. You'd read the docs here http://hg.icculus.org/icculus/fatelf/file/e8010ae51530/docs , note that it is considerable work to pactch/recompile all the parts you need. 2. Noone knows if this will make it into the mainline kernel or not.
nos
2010-09-18 09:18:19
The last discussion I saw made it look pretty unlikely that it would be merged into the kernel. And that's likelier to be the *easier* battle, compared to getting it merged in glibc...
caf
2010-09-19 10:43:53
+1
A:
You don't need a fat executable in Linux. Instead, you can write a bash script that will choose and execute the correct binary.
Lie Ryan
2010-09-18 20:22:24