| ... | ... | @@ -139,9 +139,8 @@ pub fn buildLibCXX(comp: *Compilation) !void { |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (target.os.tag == .wasi) { |
| 142 | | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 142 | // WASI doesn't support thread yet. |
| 143 | 143 | try cflags.append("-D_LIBCPP_HAS_NO_THREADS"); |
| 144 | | try cflags.append("-D_LIBCPP_ABI_VERSION=2"); |
| 145 | 144 | try cflags.append("-fno-exceptions"); |
| 146 | 145 | } |
| 147 | 146 | |
| ... | ... | @@ -253,29 +252,27 @@ pub fn buildLibCXXABI(comp: *Compilation) !void { |
| 253 | 252 | var cflags = std.ArrayList([]const u8).init(arena); |
| 254 | 253 | |
| 255 | 254 | if (target.os.tag == .wasi) { |
| 256 | | if (std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp")) |
| 257 | | continue; |
| 258 | | |
| 259 | | if (std.mem.startsWith(u8, cxxabi_src, "src/cxa_exception.cpp")) |
| 255 | // WASI doesn't support thread yet. |
| 256 | if (std.mem.startsWith(u8, cxxabi_src, "src/cxa_thread_atexit.cpp") or |
| 257 | std.mem.startsWith(u8, cxxabi_src, "src/cxa_exception.cpp") or |
| 258 | std.mem.startsWith(u8, cxxabi_src, "src/cxa_personality.cpp")) |
| 260 | 259 | continue; |
| 261 | | |
| 262 | | if (std.mem.startsWith(u8, cxxabi_src, "src/cxa_personality.cpp")) |
| 263 | | continue; |
| 264 | | |
| 260 | try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS"); |
| 261 | // Also, exception is not supported yet. |
| 265 | 262 | try cflags.append("-fno-exceptions"); |
| 266 | 263 | } else { |
| 267 | 264 | try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL"); |
| 268 | | try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS"); |
| 269 | 265 | } |
| 270 | 266 | |
| 271 | 267 | try cflags.append("-D_LIBCPP_DISABLE_EXTERN_TEMPLATE"); |
| 268 | try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS"); |
| 272 | 269 | try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY"); |
| 273 | 270 | try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS"); |
| 274 | 271 | try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS"); |
| 275 | 272 | try cflags.append("-fvisibility=hidden"); |
| 276 | 273 | try cflags.append("-fvisibility-inlines-hidden"); |
| 277 | 274 | |
| 278 | | if (target.abi.isMusl() or target.os.tag == .wasi) { |
| 275 | if (target.abi.isMusl()) { |
| 279 | 276 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 280 | 277 | } |
| 281 | 278 | |