From 062eb6f3c0027e8a371e6865963645b70e49b84e Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Sun, 18 Jun 2023 18:22:04 +0200 Subject: Compilation: allow threads for Wasm when shared-memory is enabled When the user enabled the linker-feature 'shared-memory' we do not force a singlethreaded build. The linker already verifies all other CPU features required for threads are enabled. This is true for both WASI and freestanding. --- 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 4e0a36d652..fe13df8097 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 = target_util.isSingleThreaded(options.target); + const must_single_thread = options.target.isWasm() and !options.linker_shared_memory; const single_threaded = options.single_threaded orelse must_single_thread; if (must_single_thread and !single_threaded) { return error.TargetRequiresSingleThreaded; -- cgit v1.2.3