diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-07-02 21:11:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-02 21:11:45 -0400 |
| commit | bb98620c10992884d58ae97a3a30dd9e26735fea (patch) | |
| tree | 463cb67f3551c397aae17dff5594cd2fd2037ca0 /src/link.zig | |
| parent | d84b386f6034278c8a9e8c3d2b0975ac541584aa (diff) | |
| parent | a6bf68ccf985787eeac33a97e362d043987905c4 (diff) | |
| download | zig-bb98620c10992884d58ae97a3a30dd9e26735fea.tar.gz zig-bb98620c10992884d58ae97a3a30dd9e26735fea.zip | |
Merge pull request #9219 from ziglang/unreachable-code
move "unreachable code" error from stage1 to stage2
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/link.zig b/src/link.zig index d429a1b459..9c1be16b9c 100644 --- a/src/link.zig +++ b/src/link.zig @@ -92,6 +92,7 @@ pub const Options = struct { each_lib_rpath: bool, disable_lld_caching: bool, is_test: bool, + use_stage1: bool, major_subsystem_version: ?u32, minor_subsystem_version: ?u32, gc_sections: ?bool = null, @@ -181,7 +182,7 @@ pub const File = struct { /// rewriting it. A malicious file is detected as incremental link failure /// and does not cause Illegal Behavior. This operation is not atomic. pub fn openPath(allocator: *Allocator, options: Options) !*File { - const use_stage1 = build_options.is_stage1 and options.use_llvm; + const use_stage1 = build_options.is_stage1 and options.use_stage1; if (use_stage1 or options.emit == null) { return switch (options.object_format) { .coff, .pe => &(try Coff.createEmpty(allocator, options)).base, @@ -507,7 +508,7 @@ pub const File = struct { // 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 (base.options.module) |module| blk: { - const use_stage1 = build_options.is_stage1 and base.options.use_llvm; + const use_stage1 = build_options.is_stage1 and base.options.use_stage1; if (use_stage1) { const obj_basename = try std.zig.binNameAlloc(arena, .{ .root_name = base.options.root_name, |
