Commit edbcbb7
committed
fix(aot): reserve x18 register on macOS ARM64
Apple reserves CPU register x18 for TLS on ARM64. When generating AOT
code for aarch64 on macOS, LLVM may use x18, causing crashes when the
AOT code runs on macOS ARM64 (M1/M2/M3).
This patch:
1. Detects darwin/macho ABI and sets correct vendor string
2. Detects darwin/apple in default triple for platform detection
3. Adds +reserve-x18 to LLVM target features for aarch64 on macOS
The fix only applies when compiling on macOS ARM64 hosts, ensuring
generated AOT code is compatible with Apple's platform requirements.1 parent 2a2dd19 commit edbcbb7
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3005 | 3005 | | |
3006 | 3006 | | |
3007 | 3007 | | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
3008 | 3012 | | |
3009 | 3013 | | |
3010 | 3014 | | |
| |||
3050 | 3054 | | |
3051 | 3055 | | |
3052 | 3056 | | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
3053 | 3065 | | |
3054 | 3066 | | |
3055 | 3067 | | |
| |||
3139 | 3151 | | |
3140 | 3152 | | |
3141 | 3153 | | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
3142 | 3178 | | |
3143 | 3179 | | |
3144 | 3180 | | |
| |||
0 commit comments