zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 4b403c7eaca50815cae8f2ddde19b4fb476ae8ca (tree)
parent b6556c944b88726c2bdb34ce72358ade88c5a984
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sat, 26 Sep 2020 21:23:12 -0700

fix non-ELF linkAsArchive

Diffstat:
MBRANCH_TODO | 4++--
Msrc/link.zig | 6+++++-
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/BRANCH_TODO b/BRANCH_TODO @@ -1,7 +1,7 @@ - * MachO LLD linking * subsystem - * mingw-w64 * COFF LLD linking + * mingw-w64 + * MachO LLD linking * WASM LLD linking * audit the CLI options for stage2 * audit the base cache hash diff --git a/src/link.zig b/src/link.zig @@ -417,7 +417,11 @@ pub const File = struct { const module_obj_path: ?[]const u8 = if (base.options.module) |module| blk: { const use_stage1 = build_options.is_stage1 and base.options.use_llvm; if (use_stage1) { - const obj_basename = try std.fmt.allocPrint(arena, "{}.o", .{base.options.root_name}); + const obj_basename = try std.zig.binNameAlloc(arena, .{ + .root_name = base.options.root_name, + .target = base.options.target, + .output_mode = .Obj, + }); const full_obj_path = try directory.join(arena, &[_][]const u8{obj_basename}); break :blk full_obj_path; }