fix non-ELF linkAsArchive

This commit is contained in:
Andrew Kelley 2020-09-26 21:23:12 -07:00
parent b6556c944b
commit 4b403c7eac
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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;
}