diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-10 10:44:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-10 10:44:35 -0400 |
| commit | aeae71f462d5a7c6a84e46c6635839c483c6acb5 (patch) | |
| tree | 94a827002a029579e558a3f868566f94300a17af /src/Compilation.zig | |
| parent | dfe34405406cf9b8f15fb0fc079a343fea4267a6 (diff) | |
| parent | d1484bf4b96177135183916b95198de25dc63356 (diff) | |
| download | zig-aeae71f462d5a7c6a84e46c6635839c483c6acb5.tar.gz zig-aeae71f462d5a7c6a84e46c6635839c483c6acb5.zip | |
Merge pull request #15068 from Snektron/spirv-test-runner-support
spirv: test runner support
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index f6f4851e5e..6eef76cf14 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -722,10 +722,11 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { // Once they are capable this condition could be removed. When removing this condition, // also test the use case of `build-obj -fcompiler-rt` with the native backends // and make sure the compiler-rt symbols are emitted. - const capable_of_building_compiler_rt = build_options.have_llvm and options.target.os.tag != .plan9; - - const capable_of_building_zig_libc = build_options.have_llvm and options.target.os.tag != .plan9; - const capable_of_building_ssp = build_options.have_llvm and options.target.os.tag != .plan9; + const is_p9 = options.target.os.tag == .plan9; + const is_spv = options.target.cpu.arch.isSpirV(); + const capable_of_building_compiler_rt = build_options.have_llvm and !is_p9 and !is_spv; + const capable_of_building_zig_libc = build_options.have_llvm and !is_p9 and !is_spv; + const capable_of_building_ssp = build_options.have_llvm and !is_p9 and !is_spv; const comp: *Compilation = comp: { // For allocations that have the same lifetime as Compilation. This arena is used only during this @@ -1948,8 +1949,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void .sub_path = std.fs.path.basename(sub_path), }; } - comp.bin_file.destroy(); + var old_bin_file = comp.bin_file; comp.bin_file = try link.File.openPath(comp.gpa, options); + old_bin_file.destroy(); } // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |
