authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-21 22:25:29+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-21 22:29:36+02:00
logbd325d1bd94361024f755c8bac3011a5cdffe573
tree810449ab0769c475151d0c4f9fa191a2dc03c569
parentfbd96907c9f53f01c211e6e3bbf15e53aaeb79f0

wasm: fix object extension to standard .o from .o.wasm

This should offer more compatibility with external tooling when cross-compiling to wasm with zig.

2 files changed, 1 insertions(+), 7 deletions(-)

lib/std/target.zig-6
......@@ -1259,9 +1259,6 @@ pub const Target = struct {
12591259 }
12601260
12611261 pub fn oFileExt_cpu_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) [:0]const u8 {
1262 if (cpu_arch.isWasm()) {
1263 return ".o.wasm";
1264 }
12651262 switch (abi) {
12661263 .msvc => return ".obj",
12671264 else => return ".o",
......@@ -1289,9 +1286,6 @@ pub const Target = struct {
12891286 }
12901287
12911288 pub fn staticLibSuffix_cpu_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) [:0]const u8 {
1292 if (cpu_arch.isWasm()) {
1293 return ".wasm";
1294 }
12951289 switch (abi) {
12961290 .msvc => return ".lib",
12971291 else => return ".a",
src/link/Wasm.zig+1-1
......@@ -698,7 +698,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
698698
699699 if (link_in_crt) {
700700 // TODO work out if we want standard crt, a reactor or a command
701 try argv.append(try comp.get_libc_crt_file(arena, "crt.o.wasm"));
701 try argv.append(try comp.get_libc_crt_file(arena, "crt.o"));
702702 }
703703
704704 if (!is_obj and self.base.options.link_libc) {