authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-26 21:23:12-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-26 21:23:12-07:00
log4b403c7eaca50815cae8f2ddde19b4fb476ae8ca
treed3aad3f9e605ddc09c42a668e47572726884df8d
parentb6556c944b88726c2bdb34ce72358ade88c5a984

fix non-ELF linkAsArchive


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

BRANCH_TODO+2-2
...@@ -1,7 +1,7 @@...@@ -1,7 +1,7 @@
1 * MachO LLD linking
2 * subsystem1 * subsystem
3 * mingw-w64
4 * COFF LLD linking2 * COFF LLD linking
3 * mingw-w64
4 * MachO LLD linking
5 * WASM LLD linking5 * WASM LLD linking
6 * audit the CLI options for stage26 * audit the CLI options for stage2
7 * audit the base cache hash7 * audit the base cache hash
src/link.zig+5-1
...@@ -417,7 +417,11 @@ pub const File = struct {...@@ -417,7 +417,11 @@ pub const File = struct {
417 const module_obj_path: ?[]const u8 = if (base.options.module) |module| blk: {417 const module_obj_path: ?[]const u8 = if (base.options.module) |module| blk: {
418 const use_stage1 = build_options.is_stage1 and base.options.use_llvm;418 const use_stage1 = build_options.is_stage1 and base.options.use_llvm;
419 if (use_stage1) {419 if (use_stage1) {
420 const obj_basename = try std.fmt.allocPrint(arena, "{}.o", .{base.options.root_name});420 const obj_basename = try std.zig.binNameAlloc(arena, .{
421 .root_name = base.options.root_name,
422 .target = base.options.target,
423 .output_mode = .Obj,
424 });
421 const full_obj_path = try directory.join(arena, &[_][]const u8{obj_basename});425 const full_obj_path = try directory.join(arena, &[_][]const u8{obj_basename});
422 break :blk full_obj_path;426 break :blk full_obj_path;
423 }427 }