3 ms·
APE executables are PE executables that embed a shell script in the MS-DOS stub. The GNU or LLVM linker is configured to generate a printf '\177ELF...' >$0 stat
by jart 6y ago
APE executables are PE executables that embed a shell script in the MS-DOS stub. The GNU or LLVM linker is configured to generate a printf '\177ELF...' >$0 statement which inserts the ELF or Mach-O header into the first 64-bytes depending on where the executable is run. See https://justine.lol/ape.html https://justine.lol/ape.html and https://raw.githubusercontent.com/jart/cosmopolitan/master/ape/ape.S https://raw.githubusercontent.com/jart/cosmopolitan/master/a...
- nextaccountic 6y agoThis is so freaking cool!
- nextaccountic 6y ago.. actually, wait, are you the author? Thanks for open sourcing this! Can I use it to make a Rust executable? Maybe it can post-process the executable built by Rust somehow? (I guess Rust needs to link against the cosmopolitan libc and otherwise not make any syscalls) Maybe it's possible to make a cosmopolitan Rust target, like, x86-unknown-cosmopolitan? Also, does it support x86_64? (and maybe a fat x86/x86_64 binary as well?)