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