Commit 710e2e7f10

Andrew Kelley <andrew@ziglang.org>
2022-10-26 21:56:29
libcxx: only pass -DHAVE___CXA_THREAD_ATEXIT_IMPL for glibc
This definition communicates to libcxxabi that the libc will provide the `__cxa_thread_atexit_impl` symbol. This is true for glibc but not true for other libcs, such as musl.
1 parent 0b72965
Changed files (1)
src/libcxx.zig
@@ -320,7 +320,7 @@ pub fn buildLibCXXABI(comp: *Compilation) !void {
             }
             try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS");
             try cflags.append("-D_LIBCPP_HAS_NO_THREADS");
-        } else {
+        } else if (target.abi.isGnu()) {
             try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL");
         }