From 87b8a0567b0f54415aeecd879d3f1a4e12014d22 Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Mon, 26 Jun 2023 19:10:34 +0200 Subject: default to single-threaded for WebAssembly When targeting WebAssembly, we default to building a single-threaded build as threads are still experimental. The user however can enable a multi- threaded build by specifying '-fno-single-threaded'. It's a compile-error to enable this flag, but not also enable shared-memory. --- src/Compilation.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index fe13df8097..4e0a36d652 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1029,7 +1029,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { const include_compiler_rt = options.want_compiler_rt orelse needs_c_symbols; - const must_single_thread = options.target.isWasm() and !options.linker_shared_memory; + const must_single_thread = target_util.isSingleThreaded(options.target); const single_threaded = options.single_threaded orelse must_single_thread; if (must_single_thread and !single_threaded) { return error.TargetRequiresSingleThreaded; -- cgit v1.2.3