Repository navigation
Commit e82b320
committed
two of the three guards that would have excluded this target never arrive
mimalloc's prim-tls.h:176 enables `__builtin_thread_pointer()` for x86_64 with
clang >= 14 unless `__APPLE__`, `__CYGWIN__` or `MI_LIBC_MUSL` says otherwise.
Two of those three describe this target and neither reaches it: mcpp suppresses
`__CYGWIN__` deliberately, because source must not read the realisation triple
as a statement about Cygwin, and `MI_LIBC_MUSL` is a build option upstream
expects the packager to set ("Enable this when linking with musl libc",
CMakeLists.txt:39) rather than something it detects.
So the guard passes and LLVM has no lowering for the builtin on this OS:
fatal error: error in backend: Target OS doesn't support
__builtin_thread_pointer() yet.
which arrives as a backend crash with no source location, and reaches the
compatibility results as the bare line "error: build failed".
prim-tls.h:176 opens with `#if !defined(MI_USE_BUILTIN_THREAD_POINTER) /* allow
user override */`, so the fix is to give it one. It goes in the Windows branch,
where a Win32 target never reads it — `_WIN32` selects `NtCurrentTeb()` three
arms earlier — so it changes only the target that has no `_WIN32`.
Measured: `runs` on x86_64-windows-gnu and unchanged `runs` on
x86_64-linux-gnu.1 parent c1b4b3e commit e82b320
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
0 commit comments