jnz / q3vm

Q3VM - Single file (vm.c) bytecode virtual machine/interpreter for C-language input
GNU General Public License v2.0
830 stars 57 forks source link

Add building lcc as an APE executable #37

Open mundusnine opened 2 months ago

mundusnine commented 2 months ago

Right now, lcc has limited OS support to only Windows and Linux.

This change enables compiling lcc using cosmopolitan libc which reconfigures stock GCC and Clang to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS on AMD64 and ARM64.

As cosmopolitan had the kill function collide with the kill function in dag.c, we renamed the function to kkill, since it's basically kill kids... :smiling_face_with_tear:

If this change is accepted, in the future we could bundle all the executables into one lcc.com as APE executables have a pkzip section at their EOF to hold data in the executable as a self-contained environment we can fopen from.

Thank you for this great project !