motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 6beae6c061a650ea2d695e6902683641df920aa8 (tree)
parent 951c5b3f67e086c50ba8d0cd9318cb770fd3f724
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 26 Dec 2023 19:58:05 -0700

frontend: avoid spurious error when no zcu

use_llvm=false does not always mean there needs to be a zig compiler
backend available. In particular, when there is no zig compilation unit,
use_llvm=false and yet no zig backend will be used to produce code.

Diffstat:
Msrc/Compilation/Config.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig @@ -237,7 +237,7 @@ pub fn resolve(options: Options) ResolveError!Config { break :b !target_util.selfHostedBackendIsAsRobustAsLlvm(target); }; - if (options.emit_bin) { + if (options.emit_bin and options.have_zcu) { if (!use_lib_llvm and use_llvm) { // Explicit request to use LLVM to produce an object file, but without // using LLVM libraries. Impossible.