authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-09 17:24:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-10 11:17:29-07:00
log8679c7a6070c3aa38bcf8e3fad47ac041cb93c90
treef4a7bb27498fd9ab9867b1ea602cd75f2218e938
parent6e0904504155d3cba80955c108116170fd739aec

Compilation: default to self-hosted backend when not using libllvm

When not using libllvm, it means the compiler is not capable of producing an object file or executable, making the self-hosted backends be a better default.

1 files changed, 6 insertions(+), 0 deletions(-)

src/Compilation.zig+6
......@@ -841,6 +841,12 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
841841 if (options.main_mod == null)
842842 break :blk false;
843843
844 // If we cannot use LLVM libraries, then our own backends will be a
845 // better default since the LLVM backend can only produce bitcode
846 // and not an object file or executable.
847 if (!use_lib_llvm)
848 break :blk false;
849
844850 // If LLVM does not support the target, then we can't use it.
845851 if (!target_util.hasLlvmSupport(options.target, options.target.ofmt))
846852 break :blk false;