cosmopolitan/build
Justine Tunney db0d8dd806 Support Linux binfmt_misc and APE loading on Apple
The "no modify self" variant of Actually Portable Executable is now
supported on all platforms. If you use `$(APE_NO_MODIFY_SELF)` then
ld.bfd will embed a 4096 byte ELF binary and a 4096 byte Macho file
which are installed on the fly to ${TMPDIR:-/tmp}, which enables us
launch the executable, without needing to copy the whole executable

To prevent it from copying a tiny executable to your temp directory
you need to install the `ape` command (renamed from ape-loader), to
a system path. For example:

    # FreeBSD / NetBSD / OpenBSD
    make -j8 o//ape/ape
    cp o//ape/ape /usr/bin/ape

    # Mac OS
    # make -j8 o//ape/ape.macho
    curl https://justine.lol/ape.macho >/usr/bin/ape
    chmod +x /usr/bin/ape

On Linux you can get even more performance with the new binfmt_misc
support which makes launching non-modifying APE binaries as fast as
launching ELF executables. Running the following command:

    # Linux
    ape/apeinstall.sh

Will copy APE loader to /usr/bin/ape and register with binfmt_misc
Lastly, this change also fixes a really interesting race condition
with OpenBSD thread joining.
2022-05-21 09:28:25 -07:00
..
bootstrap Support Linux binfmt_misc and APE loading on Apple 2022-05-21 09:28:25 -07:00
config.mk Flatten InfoZIP directory and fix build issues 2022-04-20 22:40:33 -07:00
definitions.mk Make improvements 2022-04-24 10:06:05 -07:00
findtmp Productionize new APE loader and more 2021-10-02 08:27:03 -07:00
functions.mk Initial import 2020-06-15 07:18:57 -07:00
gdb Fix redbean zip central directory lookup 2021-02-27 12:08:28 -08:00
getccversion Add binfmt_misc workaround detector to builds 2020-08-31 20:09:23 -07:00
getcompile Improve build system 2021-02-19 23:03:34 -08:00
hello Improve build system 2021-02-19 23:03:34 -08:00
htags Make some systemic improvements 2022-05-18 16:52:36 -07:00
online.mk Improve build system 2021-02-19 23:03:34 -08:00
realify.sed Add minor improvements and cleanup 2020-10-27 03:39:46 -07:00
realify.sh Make more improvements 2020-09-28 01:20:34 -07:00
rules.mk Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
sanitycheck Support Linux binfmt_misc and APE loading on Apple 2022-05-21 09:28:25 -07:00
sanitycheck2 Support Linux binfmt_misc and APE loading on Apple 2022-05-21 09:28:25 -07:00