History

Add support for apple m1

The apple m1 uses position independent executables (pie). I have implemented this in tccmacho.c Apple also uses the stack different for var_args. Also characters are signed instead of unsigned. This is implemented in arm64-gen.c/tccdefs.h Add bounds checking lib to lib/Makefile. Add underscore support in lib/atomic.S and lib/fetch_and_add.S Disable __clear_cache in lib/lib-arm64.c (Use system version). I will try to fix this in future push. Disable test_asm_call in tests/tcctest.c. Clang does not support @plt. Also disable weak symbols test. I will try to fix weak support in future push. Disable tests/tests2/124_atomic_counter.c for 64BITS. This is a bug in the atomic code and will be fixed in future push. You have to use --dwarf configure option. stabs only works with -run. tested on apple x86_64(10.5) and arm64(12.3).

herman ten brugge committed 3 years ago

Commit c8ef84c1 parent c6b722f10 files · +736 −129Browse files

Showing the changes to include (1 of 10 files). Show all

Unified · Split

include/tccdefs.h+7−0
@@ -207,11 +207,18 @@ · 206 unmodified lines
207207 &~3), *(type *)(ap - ((sizeof(type)+3)&~3)))
208208
209209 #elif defined __aarch64__
210+#if defined __APPLE__
211+ typedef struct {
212+ void *__stack;
213+ } __builtin_va_list;
214+
215+#else
210216 typedef struct {
211217 void *__stack, *__gr_top, *__vr_top;
212218 int __gr_offs, __vr_offs;
213219 } __builtin_va_list;
214220
221+#endif
215222 #elif defined __riscv
216223 typedef char *__builtin_va_list;
217224 #define __va_reg_size (__riscv_xlen >> 3)

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