authorgravatar for takeshi@tetrate.ioTakeshi Yoneda <takeshi@tetrate.io> 2021-06-15 09:28:19+09:00
committergravatar for takeshi@tetrate.ioTakeshi Yoneda <takeshi@tetrate.io> 2021-06-15 09:28:19+09:00
log1795472eb71a52d37d73dcf4cac82af44f6ddc3c
treeffa609cdfa71c2eaabcae497aab40497cf8b858e
parentbc64664a0cb3dab4374e1053fb765872765f848c

cleanup, and disable threading completely.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>

1 files changed, 9 insertions(+), 12 deletions(-)

src/libcxx.zig+9-12
......@@ -139,9 +139,8 @@ pub fn buildLibCXX(comp: *Compilation) !void {
139139 }
140140
141141 if (target.os.tag == .wasi) {
142 try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC");
142 // WASI doesn't support thread yet.
143143 try cflags.append("-D_LIBCPP_HAS_NO_THREADS");
144 try cflags.append("-D_LIBCPP_ABI_VERSION=2");
145144 try cflags.append("-fno-exceptions");
146145 }
147146
......@@ -253,29 +252,27 @@ pub fn buildLibCXXABI(comp: *Compilation) !void {
253252 var cflags = std.ArrayList([]const u8).init(arena);
254253
255254 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"))
260259 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.
265262 try cflags.append("-fno-exceptions");
266263 } else {
267264 try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL");
268 try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS");
269265 }
270266
271267 try cflags.append("-D_LIBCPP_DISABLE_EXTERN_TEMPLATE");
268 try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS");
272269 try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY");
273270 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
274271 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
275272 try cflags.append("-fvisibility=hidden");
276273 try cflags.append("-fvisibility-inlines-hidden");
277274
278 if (target.abi.isMusl() or target.os.tag == .wasi) {
275 if (target.abi.isMusl()) {
279276 try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC");
280277 }
281278