Compiling the complete executable with gcc

This is not important for my programs, but simply out of curiosity. Is it possible, using gcc, to compile "fat" binary for Linux, including a number of architectures, such as combinations amd64, i386, lpiaand powerpc?

+3
source share
2 answers

The ELF format for executables that linux uses does not support live binary files, so there is currently no reasonable way to do this.

There is an extension for ELF, available at http://icculus.org/fatelf/ , to use it you need to fix various parts (linux kernel, binutils, glibc, etc.), because these changes are not yet integrated into the trunk.

+2
source

You do not need a full Linux executable. Instead, you can write a bash script that selects and executes the correct binary.

0
source

Source: https://habr.com/ru/post/1765405/


All Articles