aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-11-30 20:44:36 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-11-30 20:44:36 -0700
commit21565ca991bba9692ed74ec9fb9a665f8e504c7f (patch)
tree08fa6751c7c35d7adb64049478c07f80d2908ee5 /src
parent429a219f42c93957dee41021a22547549a8c54a2 (diff)
downloadzig-21565ca991bba9692ed74ec9fb9a665f8e504c7f.tar.gz
zig-21565ca991bba9692ed74ec9fb9a665f8e504c7f.zip
restore -target wasm32-freestanding-musl for C headers
See #5854 Some tiny tweaks too: * Use `wasm-freestanding-musl` instead of `wasm32-freestanding-musl`, making it pointer-size-agnostic. * Fix trying to build non-existent wasm musl start files.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig5
-rw-r--r--src/target.zig1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index a5bf7a0ebb..e236fcea43 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1358,7 +1358,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
self.failed_c_objects.putAssumeCapacityNoClobber(c_object, try ErrorMsg.create(
self.gpa,
0,
- "unable to build C object: {}",
+ "unable to build C object: {s}",
.{@errorName(err)},
));
c_object.status = .{ .failure = {} };
@@ -2356,7 +2356,8 @@ fn wantBuildGLibCFromSource(comp: Compilation) bool {
}
fn wantBuildMuslFromSource(comp: Compilation) bool {
- return comp.wantBuildLibCFromSource() and comp.getTarget().isMusl();
+ return comp.wantBuildLibCFromSource() and comp.getTarget().isMusl() and
+ !comp.getTarget().isWasm();
}
fn wantBuildMinGWFromSource(comp: Compilation) bool {
diff --git a/src/target.zig b/src/target.zig
index 66da1710c0..34b6dc16a0 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -102,6 +102,7 @@ pub fn archMuslName(arch: std.Target.Cpu.Arch) [:0]const u8 {
.i386 => return "i386",
.x86_64 => return "x86_64",
.riscv64 => return "riscv64",
+ .wasm32, .wasm64 => return "wasm",
else => unreachable,
}
}