mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
compiler: don't use self-hosted backend on any BSD yet
There are some blocking bugs in the self-hosted ELF linker.
This commit is contained in:
parent
0e673fdab2
commit
e526d65f5e
@ -236,7 +236,7 @@ pub fn hasLldSupport(ofmt: std.Target.ObjectFormat) bool {
|
|||||||
pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
|
pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
|
||||||
if (target.cpu.arch.isSpirV()) return true;
|
if (target.cpu.arch.isSpirV()) return true;
|
||||||
if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
|
if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
|
||||||
if (target.os.tag == .netbsd or target.os.tag == .openbsd) {
|
if (target.os.tag.isBSD()) {
|
||||||
// Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
|
// Self-hosted linker needs work: https://github.com/ziglang/zig/issues/24341
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ fn addCaseInner(self: *StackTrace, config: Config, use_llvm: bool) void {
|
|||||||
fn shouldTestNonLlvm(target: *const std.Target) bool {
|
fn shouldTestNonLlvm(target: *const std.Target) bool {
|
||||||
return switch (target.cpu.arch) {
|
return switch (target.cpu.arch) {
|
||||||
.x86_64 => switch (target.ofmt) {
|
.x86_64 => switch (target.ofmt) {
|
||||||
.elf => true,
|
.elf => !target.os.tag.isBSD(),
|
||||||
else => false,
|
else => false,
|
||||||
},
|
},
|
||||||
else => false,
|
else => false,
|
||||||
|
|||||||
@ -2488,8 +2488,9 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
|
|||||||
else => return true,
|
else => return true,
|
||||||
}
|
}
|
||||||
const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
|
const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
|
||||||
|
const os_tag = query.os_tag orelse builtin.os.tag;
|
||||||
switch (cpu_arch) {
|
switch (cpu_arch) {
|
||||||
.x86_64 => if (std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
|
.x86_64 => if (os_tag.isBSD() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
|
||||||
.spirv32, .spirv64 => return false,
|
.spirv32, .spirv64 => return false,
|
||||||
else => return true,
|
else => return true,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user