Skip to content

Commit

Permalink
Mint APE Loader v1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Dec 31, 2023
1 parent c9550af commit 81949f0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ape/ape-m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <time.h>
#include <unistd.h>

#define pagesz 16384
#define pagesz 16384
/* maximum path size that cosmo can take */
#define PATHSIZE (PATH_MAX < 1024 ? PATH_MAX : 1024)
#define SYSLIB_MAGIC ('s' | 'l' << 8 | 'i' << 16 | 'b' << 24)
Expand Down Expand Up @@ -726,7 +726,7 @@ __attribute__((__noreturn__)) static void Spawn(const char *exe, int fd,

register long *x0 __asm__("x0") = sp;
register char *x2 __asm__("x2") = path;
register int x3 __asm__("x3") = 8; /* _HOSTXNU */
register int x3 __asm__("x3") = 8; /* _HOSTXNU */
register struct Syslib *x15 __asm__("x15") = lib;
register long x16 __asm__("x16") = e->e_entry;
__asm__ volatile("mov\tx1,#0\n\t"
Expand Down Expand Up @@ -1012,8 +1012,8 @@ int main(int argc, char **argv, char **envp) {
Emit("usage: ape PROG [ARGV1,ARGV2,...]\n"
" ape - PROG [ARGV0,ARGV1,...]\n"
" ($0 = PROG.ape) [ARGV1,ARGV2,...]\n"
"actually portable executable loader silicon 1.9\n"
"copyright 2023 justine alexandra roberts tunney\n"
"actually portable executable loader silicon 1.10\n"
"copyrights 2023 justine alexandra roberts tunney\n"
"https://justine.lol/ape.html\n");
_exit(1);
} else {
Expand Down
2 changes: 1 addition & 1 deletion ape/ape.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define COSMOPOLITAN_APE_APE_H_

#define APE_VERSION_MAJOR 1
#define APE_VERSION_MINOR 9
#define APE_VERSION_MINOR 10
#define APE_VERSION_STR APE_VERSION_STR_(APE_VERSION_MAJOR, APE_VERSION_MINOR)
#define APE_VERSION_NOTE APE_VERSION_NOTE_(APE_VERSION_MAJOR, APE_VERSION_MINOR)

Expand Down
1 change: 1 addition & 0 deletions ape/apeuninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ for x in .ape \
.ape-1.7 \
.ape-1.8 \
.ape-1.9 \
.ape-1.10 \
.ape-blink-0.9.2 \
.ape-blink-1.0.0; do
rm -f \
Expand Down
Binary file modified build/bootstrap/ape.aarch64
Binary file not shown.
Binary file modified build/bootstrap/ape.elf
Binary file not shown.
Binary file modified build/bootstrap/ape.macho
Binary file not shown.
2 changes: 1 addition & 1 deletion tool/cosmocc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ On Apple Silicon, `aarch64-unknown-cosmo-cc` produces ELF binaries. If
you build a hello world program, then you need to say `ape ./hello`. If
you don't have an `ape` command then run `cc -o ape bin/ape-m1.c` which
should be moved to `/usr/local/bin/ape`. Your APE interpreter might
already exist under a path like `$TMPDIR/.ape-1.9`. It's important to
already exist under a path like `$TMPDIR/.ape-1.10`. It's important to
note this is only a gotcha for the cross compiler. Your `cosmocc`
compiler wraps the actual ELF binaries with a shell script that'll
extract and compile an APE loader automatically, as needed. This also
Expand Down

0 comments on commit 81949f0

Please sign in to comment.