aboutsummaryrefslogtreecommitdiff
path: root/src/link/Elf.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-27 17:08:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-27 17:08:37 -0700
commitdc88864c9742029c2980fc16cd2c9e6f04ff3568 (patch)
tree2569f14d189ef238ca7a281774e09ba49374113b /src/link/Elf.zig
parent66e5920dc3411daa4f0c84a8f4c733c1263e8523 (diff)
downloadzig-dc88864c9742029c2980fc16cd2c9e6f04ff3568.tar.gz
zig-dc88864c9742029c2980fc16cd2c9e6f04ff3568.zip
stage2: implement `@boolToInt`
This is the first commit in which some behavior tests are passing for both stage1 and stage2.
Diffstat (limited to 'src/link/Elf.zig')
-rw-r--r--src/link/Elf.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
index 502575f3c8..9ddebd3453 100644
--- a/src/link/Elf.zig
+++ b/src/link/Elf.zig
@@ -1257,7 +1257,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
// Both stage1 and stage2 LLVM backend put the object file in the cache directory.
if (self.base.options.use_llvm) {
// Stage2 has to call flushModule since that outputs the LLVM object file.
- if (!build_options.is_stage1) try self.flushModule(comp);
+ if (!build_options.is_stage1 or !self.base.options.use_stage1) try self.flushModule(comp);
const obj_basename = try std.zig.binNameAlloc(arena, .{
.root_name = self.base.options.root_name,
@@ -1287,7 +1287,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
const allow_shlib_undefined = self.base.options.allow_shlib_undefined orelse !self.base.options.is_native_os;
const compiler_rt_path: ?[]const u8 = if (self.base.options.include_compiler_rt) blk: {
// TODO: remove when stage2 can build compiler_rt.zig
- if (!build_options.is_stage1) break :blk null;
+ if (!build_options.is_stage1 or !self.base.options.use_stage1) break :blk null;
// In the case of build-obj we include the compiler-rt symbols directly alongside
// the symbols of the root source file, in the same compilation unit.
@@ -1605,7 +1605,8 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
if (is_exe_or_dyn_lib and
!self.base.options.skip_linker_dependencies and
!self.base.options.link_libc and
- build_options.is_stage1)
+ build_options.is_stage1 and
+ self.base.options.use_stage1)
{
try argv.append(comp.libc_static_lib.?.full_object_path);
}