cosmopolitan/tool
Brett Jia 7b69652854
Add -k OSNAME flag to apelink (#1383)
Let's say you pass the `-M blink-mips.elf` flag to apelink, so that your
ape binary will bundle a compressed build of blink, and the shell script
will extract that binary and launch your program under it, if running on
a MIPS system. However, for any given microprocessor architecture, we'll
need a separate loader for each operating system. The issue is ELF OSABI
isn't very useful. As an example, SerenityOS and Linux both have SYSV in
the OSABI field. So to tell their binaries apart we'd have to delve into
various other conventions, like special sections and PT_NOTE structures.

To make things simple this change introduces the `-k OS` flag to apelink
which generate shell script content that ensures `OS` matches `uname -s`
before attempting to execute a loader. For example, you could say:

    apelink -k Linux -M blink-linux-arm.elf -M blink-linux-mips.elf \
            -k Darwin -M blink-darwin-ppc.elf \
            ...

To introduce support for old 32-bit architectures on multiple OSes, when
building your cosmo binary.
2025-03-12 13:26:51 -07:00
..
args Invent new cosmo_args() api 2024-11-13 01:19:57 -08:00
build Add -k OSNAME flag to apelink (#1383) 2025-03-12 13:26:51 -07:00
cosmocc Check downloaded gcc/clang checksums (#1367) 2025-02-08 17:46:09 -08:00
curl Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
decode Support merging many .a files into one .a file 2024-09-05 19:28:14 -07:00
emacs Make Emacs load 2x faster 2024-08-23 20:08:05 -07:00
hello Write more runtime tests and fix bugs 2025-01-01 22:25:22 -08:00
lambda Update Musl Libc code 2024-07-30 22:51:29 -07:00
net Clarify unix.mapshared versus file locks (#1355) 2025-02-08 00:48:38 -08:00
plinko Make improvements 2024-09-01 01:27:47 -07:00
scripts Fix ordering of pthread_create(pthread_t *thread) 2025-01-03 17:34:29 -08:00
viz Improve Windows sleep accuracy from 15ms to 15µs 2024-12-06 23:03:57 -08:00
zsh tool/zsh/mkofs: doas 2025-01-13 16:48:55 -08:00
BUILD.mk more modeline errata (#1019) 2023-12-16 23:07:10 -05:00