authorgravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-04-13 18:40:28-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-14 10:21:48-04:00
log0f1d92e2cfda7ac633cc66fdf2b0e5e27cdf0f98
treeb23e55357b41fdacaf61fd2ce88a8faadb87d459
parent68d7e4a1b60a52b59bc148a81458a89b9b739ab1

wasm: force single threaded


3 files changed, 9 insertions(+), 0 deletions(-)

src/main.cpp+4
...@@ -921,6 +921,10 @@ int main(int argc, char **argv) {...@@ -921,6 +921,10 @@ int main(int argc, char **argv) {
921 }921 }
922 }922 }
923923
924 if (target_is_single_threaded(&target)) {
925 is_single_threaded = true;
926 }
927
924 if (output_dir != nullptr && enable_cache == CacheOptOn) {928 if (output_dir != nullptr && enable_cache == CacheOptOn) {
925 fprintf(stderr, "`--output-dir` is incompatible with --cache on.\n");929 fprintf(stderr, "`--output-dir` is incompatible with --cache on.\n");
926 return print_error_usage(arg0);930 return print_error_usage(arg0);
src/target.cpp+4
...@@ -1371,6 +1371,10 @@ bool target_is_wasm(const ZigTarget *target) {...@@ -1371,6 +1371,10 @@ bool target_is_wasm(const ZigTarget *target) {
1371 return target->arch == ZigLLVM_wasm32 || target->arch == ZigLLVM_wasm64;1371 return target->arch == ZigLLVM_wasm32 || target->arch == ZigLLVM_wasm64;
1372}1372}
13731373
1374bool target_is_single_threaded(const ZigTarget *target) {
1375 return target_is_wasm(target);
1376}
1377
1374ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {1378ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
1375 switch (os) {1379 switch (os) {
1376 case OsFreestanding:1380 case OsFreestanding:
src/target.hpp+1
...@@ -171,6 +171,7 @@ bool target_abi_is_musl(ZigLLVM_EnvironmentType abi);...@@ -171,6 +171,7 @@ bool target_abi_is_musl(ZigLLVM_EnvironmentType abi);
171bool target_is_glibc(const ZigTarget *target);171bool target_is_glibc(const ZigTarget *target);
172bool target_is_musl(const ZigTarget *target);172bool target_is_musl(const ZigTarget *target);
173bool target_is_wasm(const ZigTarget *target);173bool target_is_wasm(const ZigTarget *target);
174bool target_is_single_threaded(const ZigTarget *target);
174175
175uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);176uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);
176177