mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-10 05:02:06 +00:00
Introduce native support for MacOS ARM64
There's a new program named ape/ape-m1.c which will be used to build an embeddable binary that can load ape and elf executables. The support is mostly working so far, but still chasing down ABI issues.
This commit is contained in:
parent
b852650c08
commit
1422e96b4e
757 changed files with 2988 additions and 1321 deletions
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_BASE,7,7,0,7,0,7,0
|
||||
.syscon auxv,AT_BASE,7,7,7,7,0,7,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_EGID,14,14,0,0,0,2002,0
|
||||
.syscon auxv,AT_EGID,14,14,14,0,0,2002,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_ENTRY,9,9,0,9,0,9,0
|
||||
.syscon auxv,AT_ENTRY,9,9,9,9,0,9,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_EUID,12,12,0,0,0,2000,0
|
||||
.syscon auxv,AT_EUID,12,12,12,0,0,2000,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_GID,13,13,0,0,0,2003,0
|
||||
.syscon auxv,AT_GID,13,13,13,0,0,2003,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_HWCAP,16,16,0,0,0,0,0
|
||||
.syscon auxv,AT_HWCAP,16,16,16,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_HWCAP2,26,26,0,0,0,0,0
|
||||
.syscon auxv,AT_HWCAP2,26,26,26,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_PAGESZ,6,6,0,6,0,6,0
|
||||
.syscon auxv,AT_PAGESZ,6,6,6,6,0,6,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_PHDR,3,3,0,3,0,3,0
|
||||
.syscon auxv,AT_PHDR,3,3,3,3,0,3,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_PHENT,4,4,0,4,0,4,0
|
||||
.syscon auxv,AT_PHENT,4,4,4,4,0,4,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_PHNUM,5,5,0,5,0,5,0
|
||||
.syscon auxv,AT_PHNUM,5,5,5,5,0,5,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_RANDOM,25,25,0,16,0,0,0
|
||||
.syscon auxv,AT_RANDOM,25,25,25,16,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_SECURE,23,23,0,0,0,0,0
|
||||
.syscon auxv,AT_SECURE,23,23,23,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon auxv,AT_UID,11,11,0,0,0,2001,0
|
||||
.syscon auxv,AT_UID,11,11,11,0,0,2001,0
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EACCES,13,13,13,13,13,13,5
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EACCES
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EADDRINUSE,98,98,48,48,48,48,10048
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EADDRINUSE
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EADDRNOTAVAIL,99,99,49,49,49,49,10049
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EADDRNOTAVAIL
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EAGAIN,11,11,35,35,35,35,10035
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EAGAIN
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EBADF,9,9,9,9,9,9,6
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EBADF
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ECONNABORTED,103,103,53,53,53,53,10053
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ECONNABORTED
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ECONNREFUSED,111,111,61,61,61,61,10061
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ECONNREFUSED
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ECONNRESET,104,104,54,54,54,54,10054
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ECONNRESET
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EDQUOT,122,122,69,69,69,69,1816
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EDQUOT
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EEXIST,17,17,17,17,17,17,183
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EEXIST
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EFAULT,14,14,14,14,14,14,487
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EFAULT
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EHOSTUNREACH,113,113,65,65,65,65,10065
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EHOSTUNREACH
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EINPROGRESS,115,115,36,36,36,36,10036
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EINPROGRESS
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EINTR,4,4,4,4,4,4,10004
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EINTR
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EINVAL,22,22,22,22,22,22,87
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EINVAL
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EISCONN,106,106,56,56,56,56,10056
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EISCONN
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EMSGSIZE,90,90,40,40,40,40,10040
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EMSGSIZE
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENAMETOOLONG,36,36,63,63,63,63,10063
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENAMETOOLONG
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENETDOWN,100,100,50,50,50,50,10050
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENETDOWN
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENETUNREACH,101,101,51,51,51,51,10051
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENETUNREACH
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENOENT,2,2,2,2,2,2,2
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENOENT
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENOMEM,12,12,12,12,12,12,14
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENOMEM
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENOSYS,38,38,78,78,78,78,1
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENOSYS
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENOTEMPTY,39,39,66,66,66,66,145
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENOTEMPTY
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ENOTSUP,95,95,45,45,91,86,10045
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ENOTSUP
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,EPIPE,32,32,32,32,32,32,109
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EPIPE
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon errno,ETIMEDOUT,110,110,60,60,60,60,1460
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.ETIMEDOUT
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon compat,EWOULDBLOCK,11,11,35,35,35,35,10035
|
||||
#ifdef __x86_64__
|
||||
.yoink kDos2Errno.EWOULDBLOCK
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_
|
||||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_
|
||||
#ifdef __aarch64__
|
||||
|
||||
// Feature bits for getauxval(AT_HWCAP) on AARCH64 GNU/SystemD.
|
||||
|
@ -58,4 +58,4 @@
|
|||
#define HWCAP2_MTE (1 << 18)
|
||||
|
||||
#endif /* __aarch64__ */
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_ */
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_ */
|
|
@ -18,60 +18,61 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/macros.internal.h"
|
||||
/* clang-format off */
|
||||
// clang-format off
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define ENCODE .uleb128
|
||||
.yoink _init_systemfive
|
||||
#else
|
||||
#define ENCODE .balign 8 ; .quad
|
||||
#endif
|
||||
|
||||
.macro .syscon group:req name:req linux:req linux_aarch64:req xnu:req freebsd:req openbsd:req netbsd:req windows:req
|
||||
|
||||
#ifdef __x86_64__
|
||||
.yoink _init_systemfive
|
||||
|
||||
.section .piro.bss.sort.syscon.2.\group\().\name,"aw",@nobits
|
||||
.balign 8
|
||||
\name: .quad 0
|
||||
.endobj \name,globl
|
||||
.previous
|
||||
|
||||
#if SupportsLinux() || SupportsMetal()
|
||||
.section .sort.rodata.syscon.linux.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \linux
|
||||
#ifdef __aarch64__
|
||||
ENCODE \linux_aarch64
|
||||
#else
|
||||
ENCODE \linux
|
||||
#endif
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#if SupportsXnu()
|
||||
.section .sort.rodata.syscon.xnu.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \xnu
|
||||
ENCODE \xnu
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#if SupportsFreebsd()
|
||||
.section .sort.rodata.syscon.freebsd.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \freebsd
|
||||
ENCODE \freebsd
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#if SupportsOpenbsd()
|
||||
.section .sort.rodata.syscon.openbsd.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \openbsd
|
||||
ENCODE \openbsd
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#if SupportsNetbsd()
|
||||
.section .sort.rodata.syscon.netbsd.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \netbsd
|
||||
ENCODE \netbsd
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#if SupportsWindows()
|
||||
.section .sort.rodata.syscon.windows.2.\group\().\name,"a",@progbits
|
||||
.uleb128 \windows
|
||||
ENCODE \windows
|
||||
.previous
|
||||
#endif
|
||||
|
||||
#else
|
||||
.section .rodata,"a",@progbits
|
||||
.balign 8
|
||||
\name: .quad \linux_aarch64
|
||||
.endobj \name,globl
|
||||
.previous
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
.endm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue