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
?
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.
You don't need a fat executable in Linux. Instead, you can write a bash script that will choose and execute the correct binary.
精彩评论