History

[macOS]: arm64, very early stage of Big Sur M1 native port.

Christian Jullien committed 5 years ago

Commit e8bff291 parent 97800172 files · +7 −0Browse files

Unified · Split

2 files
  1. Makefile +2 −0
  2. tccrun.c +5 −0
Makefile+2−0
@@ -110,6 +110,7 @@ DEF-arm = $(DEF-arm-eabihf) · 109 unmodified lines
110110 DEF-arm-NetBSD = $(DEF-arm-eabihf) -DTARGETOS_NetBSD
111111 DEF-arm-wince = $(DEF-arm-eabihf) -DTCC_TARGET_PE
112112 DEF-arm64 = -DTCC_TARGET_ARM64
113+DEF-arm64-osx = $(DEF-arm64) -DTCC_TARGET_MACHO
113114 DEF-arm64-FreeBSD = $(DEF-arm64) -DTARGETOS_FreeBSD
114115 DEF-arm64-NetBSD = $(DEF-arm64) -DTARGETOS_NetBSD
115116 DEF-arm64-OpenBSD = $(DEF-arm64) -DTARGETOS_OpenBSD
@@ -198,6 +199,7 @@ arm-vfp_FILES = $(arm_FILES) · 82 unmodified lines
198199 arm-eabi_FILES = $(arm_FILES)
199200 arm-eabihf_FILES = $(arm_FILES)
200201 arm64_FILES = $(CORE_FILES) arm64-gen.c arm64-link.c arm64-asm.c
202+arm64-osx_FILES = $(arm64_FILES) tccmacho.c
201203 c67_FILES = $(CORE_FILES) c67-gen.c c67-link.c tcccoff.c
202204 riscv64_FILES = $(CORE_FILES) riscv64-gen.c riscv64-link.c riscv64-asm.c
203205
tccrun.c+5−0
@@ -716,6 +716,11 @@ static void rt_getcontext(ucontext_t *uc, rt_context *rc) · 715 unmodified lines
716716 #elif defined(__arm__)
717717 rc->ip = uc->uc_mcontext.arm_pc;
718718 rc->fp = uc->uc_mcontext.arm_fp;
719+#elif defined(__aarch64__) && defined(__APPLE__)
720+ // see:
721+ // /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/mach/arm/_structs.h
722+ rc->ip = uc->uc_mcontext->__ss.__pc;
723+ rc->fp = uc->uc_mcontext->__ss.__fp;
719724 #elif defined(__aarch64__) && defined(__FreeBSD__)
720725 rc->ip = uc->uc_mcontext.mc_gpregs.gp_elr; /* aka REG_PC */
721726 rc->fp = uc->uc_mcontext.mc_gpregs.gp_x[29];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t