Commit bd325d1bd9

Jakub Konka <kubkon@jakubkonka.com>
2021-05-21 22:25:29
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.
1 parent fbd9690
Changed files (2)
lib
src
lib/std/target.zig
@@ -1259,9 +1259,6 @@ pub const Target = struct {
     }
 
     pub fn oFileExt_cpu_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) [:0]const u8 {
-        if (cpu_arch.isWasm()) {
-            return ".o.wasm";
-        }
         switch (abi) {
             .msvc => return ".obj",
             else => return ".o",
@@ -1289,9 +1286,6 @@ pub const Target = struct {
     }
 
     pub fn staticLibSuffix_cpu_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) [:0]const u8 {
-        if (cpu_arch.isWasm()) {
-            return ".wasm";
-        }
         switch (abi) {
             .msvc => return ".lib",
             else => return ".a",
src/link/Wasm.zig
@@ -698,7 +698,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
 
         if (link_in_crt) {
             // TODO work out if we want standard crt, a reactor or a command
-            try argv.append(try comp.get_libc_crt_file(arena, "crt.o.wasm"));
+            try argv.append(try comp.get_libc_crt_file(arena, "crt.o"));
         }
 
         if (!is_obj and self.base.options.link_libc) {