aboutsummaryrefslogtreecommitdiff
path: root/src/link
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-08-07 23:10:57 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-08-19 16:45:15 -0700
commit507aae4a1a3db498ece2a3a89d74e9e24d952923 (patch)
treedb52f3b00d0def30488e7ce81adc8685c4945874 /src/link
parent73bbd1069a993a0e663033ea3b8cd4ed1a123566 (diff)
downloadzig-507aae4a1a3db498ece2a3a89d74e9e24d952923.tar.gz
zig-507aae4a1a3db498ece2a3a89d74e9e24d952923.zip
make self-hosted the default compiler
stage1 is available behind the -fstage1 flag. closes #89
Diffstat (limited to 'src/link')
-rw-r--r--src/link/Coff.zig4
-rw-r--r--src/link/Elf.zig2
-rw-r--r--src/link/MachO.zig4
-rw-r--r--src/link/Wasm.zig6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig
index 92e9dce3ad..a01b9cf7c3 100644
--- a/src/link/Coff.zig
+++ b/src/link/Coff.zig
@@ -411,7 +411,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Coff {
};
const use_llvm = build_options.have_llvm and options.use_llvm;
- const use_stage1 = build_options.is_stage1 and options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and options.use_stage1;
if (use_llvm and !use_stage1) {
self.llvm_object = try LlvmObject.create(gpa, options);
}
@@ -949,7 +949,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Node) !
// If there is no Zig code to compile, then we should skip flushing the output file because it
// will not be part of the linker line anyway.
const module_obj_path: ?[]const u8 = if (self.base.options.module) |module| blk: {
- const use_stage1 = build_options.is_stage1 and self.base.options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and self.base.options.use_stage1;
if (use_stage1) {
const obj_basename = try std.zig.binNameAlloc(arena, .{
.root_name = self.base.options.root_name,
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
index 9902886bac..ade4f62f91 100644
--- a/src/link/Elf.zig
+++ b/src/link/Elf.zig
@@ -328,7 +328,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Elf {
.page_size = page_size,
};
const use_llvm = build_options.have_llvm and options.use_llvm;
- const use_stage1 = build_options.is_stage1 and options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and options.use_stage1;
if (use_llvm and !use_stage1) {
self.llvm_object = try LlvmObject.create(gpa, options);
}
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 7a50843023..020388cee8 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -272,7 +272,7 @@ pub const Export = struct {
pub fn openPath(allocator: Allocator, options: link.Options) !*MachO {
assert(options.target.ofmt == .macho);
- const use_stage1 = build_options.is_stage1 and options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and options.use_stage1;
if (use_stage1 or options.emit == null) {
return createEmpty(allocator, options);
}
@@ -363,7 +363,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*MachO {
const cpu_arch = options.target.cpu.arch;
const page_size: u16 = if (cpu_arch == .aarch64) 0x4000 else 0x1000;
const use_llvm = build_options.have_llvm and options.use_llvm;
- const use_stage1 = build_options.is_stage1 and options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and options.use_stage1;
const self = try gpa.create(MachO);
errdefer gpa.destroy(self);
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 6267865888..626f176652 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -356,7 +356,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Wasm {
}
const use_llvm = build_options.have_llvm and options.use_llvm;
- const use_stage1 = build_options.is_stage1 and options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and options.use_stage1;
if (use_llvm and !use_stage1) {
self.llvm_object = try LlvmObject.create(gpa, options);
}
@@ -2593,7 +2593,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
// If there is no Zig code to compile, then we should skip flushing the output file because it
// will not be part of the linker line anyway.
const module_obj_path: ?[]const u8 = if (self.base.options.module) |mod| blk: {
- const use_stage1 = build_options.is_stage1 and self.base.options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and self.base.options.use_stage1;
if (use_stage1) {
const obj_basename = try std.zig.binNameAlloc(arena, .{
.root_name = self.base.options.root_name,
@@ -2803,7 +2803,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
if (self.base.options.module) |mod| {
// when we use stage1, we use the exports that stage1 provided us.
// For stage2, we can directly retrieve them from the module.
- const use_stage1 = build_options.is_stage1 and self.base.options.use_stage1;
+ const use_stage1 = build_options.have_stage1 and self.base.options.use_stage1;
if (use_stage1) {
for (comp.export_symbol_names.items) |symbol_name| {
try argv.append(try std.fmt.allocPrint(arena, "--export={s}", .{symbol_name}));