| author | |
| committer | |
| log | 062eb6f3c0027e8a371e6865963645b70e49b84e |
| tree | 8d4acf43c95e976b733a5acddc477ec604c0759d |
| parent | 381937116326400c1162a710c16496152b542443 |
| signature |
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.2 files changed, 1 insertions(+), 5 deletions(-)
src/Compilation.zig+1-1| ... | ... | @@ -1029,7 +1029,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1029 | 1029 | |
| 1030 | 1030 | const include_compiler_rt = options.want_compiler_rt orelse needs_c_symbols; |
| 1031 | 1031 | |
| 1032 | const must_single_thread = target_util.isSingleThreaded(options.target); | |
| 1032 | const must_single_thread = options.target.isWasm() and !options.linker_shared_memory; | |
| 1033 | 1033 | const single_threaded = options.single_threaded orelse must_single_thread; |
| 1034 | 1034 | if (must_single_thread and !single_threaded) { |
| 1035 | 1035 | return error.TargetRequiresSingleThreaded; |
src/target.zig-4| ... | ... | @@ -207,10 +207,6 @@ pub fn supports_fpic(target: std.Target) bool { |
| 207 | 207 | return target.os.tag != .windows and target.os.tag != .uefi; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | pub fn isSingleThreaded(target: std.Target) bool { | |
| 211 | return target.isWasm(); | |
| 212 | } | |
| 213 | ||
| 214 | 210 | /// Valgrind supports more, but Zig does not support them yet. |
| 215 | 211 | pub fn hasValgrindSupport(target: std.Target) bool { |
| 216 | 212 | switch (target.cpu.arch) { |