aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-12-07 03:06:10 -0500
committerGitHub <noreply@github.com>2022-12-07 03:06:10 -0500
commit53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c (patch)
tree741ec2205c1c47afbd262044f804b14a7a037fbe /src/Compilation.zig
parent8ccb9a6ad327a4d7fbc321b33d4aa66a27a1f5ee (diff)
parent50eb7983cde6e07d2613a6f3ab164ca055d9306f (diff)
downloadzig-53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c.tar.gz
zig-53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c.zip
Merge pull request #13799 from ziglang/close-stage1-issues
close stage1 issues
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index f568753fea..7f6314bbb0 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -5431,11 +5431,6 @@ pub fn build_crt_file(
});
errdefer comp.gpa.free(basename);
- // TODO: This is extracted into a local variable to work around a stage1 miscompilation.
- const emit_bin = Compilation.EmitLoc{
- .directory = null, // Put it in the cache directory.
- .basename = basename,
- };
const sub_compilation = try Compilation.create(comp.gpa, .{
.local_cache_directory = comp.global_cache_directory,
.global_cache_directory = comp.global_cache_directory,
@@ -5447,7 +5442,10 @@ pub fn build_crt_file(
.output_mode = output_mode,
.thread_pool = comp.thread_pool,
.libc_installation = comp.bin_file.options.libc_installation,
- .emit_bin = emit_bin,
+ .emit_bin = .{
+ .directory = null, // Put it in the cache directory.
+ .basename = basename,
+ },
.optimize_mode = comp.compilerRtOptMode(),
.want_sanitize_c = false,
.want_stack_check = false,
@@ -5492,15 +5490,16 @@ pub fn build_crt_file(
});
}
-pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void {
+pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void {
// Avoid deadlocking on building import libs such as kernel32.lib
- // This can happen when the user uses `build-exe foo.obj -lkernel32` and then
- // when we create a sub-Compilation for zig libc, it also tries to build kernel32.lib.
+ // This can happen when the user uses `build-exe foo.obj -lkernel32` and
+ // then when we create a sub-Compilation for zig libc, it also tries to
+ // build kernel32.lib.
if (comp.bin_file.options.skip_linker_dependencies) return;
- // This happens when an `extern "foo"` function is referenced by the stage1 backend.
- // If we haven't seen this library yet and we're targeting Windows, we need to queue up
- // a work item to produce the DLL import library for this.
+ // This happens when an `extern "foo"` function is referenced.
+ // If we haven't seen this library yet and we're targeting Windows, we need
+ // to queue up a work item to produce the DLL import library for this.
const gop = try comp.bin_file.options.system_libs.getOrPut(comp.gpa, lib_name);
if (!gop.found_existing and comp.getTarget().os.tag == .windows) {
try comp.work_queue.writeItem(.{