Reputation: 571
I know about Wine/Darling and other compatibility layers, but I was wondering if it was possible (for example) this way:
1. Build a simple hello_world.c program on OS X.
2. Using objcopy/objconv/some other tool, copy the machine code into a Linux executable, and replace the call to the OSX libc with a call to glibc. If it's another executable dynamically linked to other OSX libraries, copy the libraries.
3. Run the program on Linux, assuming it works.
Example hello_world.c
:
#include <stdio.h>
int main(void) {
printf("Hello World");
return 0;
}
Upvotes: 1
Views: 60
Reputation: 26358
etc,etc. In this case e.g. OS X uses AIX ABI, and Linux SysV. )
In general, POSIX is a source compatibility concept, not a binary one. So no, this is not possible, or only under unworkable constrained requirements. Exceptions are things like the Linuxator on BSD systems.
Upvotes: 2