| author | |
| committer | |
| log | 665737d845a5fc5a9182541cbe47643ee6d9f3f6 |
| tree | 34ccecf40166f5d6fea3cbd24a9b9fefc4d04441 |
| parent | f23b15b4d59afa9d12d46138b81b29d59b5e00d4 |
| parent | edf785db0f30842b958f540a3aaf7205b8b82493 |
17 files changed, 142 insertions(+), 20 deletions(-)
doc/langref/runtime_shrExact_overflow.zig+3| ... | @@ -1,3 +1,4 @@ | ... | @@ -1,3 +1,4 @@ |
| 1 | const builtin = @import("builtin"); | ||
| 1 | const std = @import("std"); | 2 | const std = @import("std"); |
| 2 | 3 | ||
| 3 | pub fn main() void { | 4 | pub fn main() void { |
| ... | @@ -5,6 +6,8 @@ pub fn main() void { | ... | @@ -5,6 +6,8 @@ pub fn main() void { |
| 5 | _ = &x; | 6 | _ = &x; |
| 6 | const y = @shrExact(x, 2); | 7 | const y = @shrExact(x, 2); |
| 7 | std.debug.print("value: {}\n", .{y}); | 8 | std.debug.print("value: {}\n", .{y}); |
| 9 | |||
| 10 | if (builtin.cpu.arch.isRISCV() and builtin.zig_backend == .stage2_llvm) @panic("https://github.com/ziglang/zig/issues/24304"); | ||
| 8 | } | 11 | } |
| 9 | 12 | ||
| 10 | // exe=fail | 13 | // exe=fail |
lib/libunwind/src/UnwindCursor.hpp+1-1| ... | @@ -150,7 +150,7 @@ bool DwarfFDECache<A>::_registeredForDyldUnloads = false; | ... | @@ -150,7 +150,7 @@ bool DwarfFDECache<A>::_registeredForDyldUnloads = false; |
| 150 | #endif | 150 | #endif |
| 151 | 151 | ||
| 152 | template <typename A> | 152 | template <typename A> |
| 153 | typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) { | 153 | typename DwarfFDECache<A>::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) { |
| 154 | pint_t result = 0; | 154 | pint_t result = 0; |
| 155 | _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared()); | 155 | _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared()); |
| 156 | for (entry *p = _buffer; p < _bufferUsed; ++p) { | 156 | for (entry *p = _buffer; p < _bufferUsed; ++p) { |
lib/std/Build/Step/CheckObject.zig+1-1| ... | @@ -2208,7 +2208,7 @@ const ElfDumper = struct { | ... | @@ -2208,7 +2208,7 @@ const ElfDumper = struct { |
| 2208 | try bw.print(" {s}", .{sym_bind}); | 2208 | try bw.print(" {s}", .{sym_bind}); |
| 2209 | } | 2209 | } |
| 2210 | 2210 | ||
| 2211 | const sym_vis = @as(elf.STV, @enumFromInt(sym.st_other)); | 2211 | const sym_vis = @as(elf.STV, @enumFromInt(@as(u2, @truncate(sym.st_other)))); |
| 2212 | try bw.print(" {s}", .{@tagName(sym_vis)}); | 2212 | try bw.print(" {s}", .{@tagName(sym_vis)}); |
| 2213 | 2213 | ||
| 2214 | const sym_name = switch (sym.st_type()) { | 2214 | const sym_name = switch (sym.st_type()) { |
lib/std/bit_set.zig+1| ... | @@ -1699,6 +1699,7 @@ fn testStaticBitSet(comptime Set: type) !void { | ... | @@ -1699,6 +1699,7 @@ fn testStaticBitSet(comptime Set: type) !void { |
| 1699 | 1699 | ||
| 1700 | test IntegerBitSet { | 1700 | test IntegerBitSet { |
| 1701 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | 1701 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; |
| 1702 | if (comptime builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24300 | ||
| 1702 | 1703 | ||
| 1703 | try testStaticBitSet(IntegerBitSet(0)); | 1704 | try testStaticBitSet(IntegerBitSet(0)); |
| 1704 | try testStaticBitSet(IntegerBitSet(1)); | 1705 | try testStaticBitSet(IntegerBitSet(1)); |
lib/std/crypto/salsa20.zig+6| ... | @@ -557,6 +557,8 @@ pub const SealedBox = struct { | ... | @@ -557,6 +557,8 @@ pub const SealedBox = struct { |
| 557 | const htest = @import("test.zig"); | 557 | const htest = @import("test.zig"); |
| 558 | 558 | ||
| 559 | test "(x)salsa20" { | 559 | test "(x)salsa20" { |
| 560 | if (builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24299 | ||
| 561 | |||
| 560 | const key = [_]u8{0x69} ** 32; | 562 | const key = [_]u8{0x69} ** 32; |
| 561 | const nonce = [_]u8{0x42} ** 8; | 563 | const nonce = [_]u8{0x42} ** 8; |
| 562 | const msg = [_]u8{0} ** 20; | 564 | const msg = [_]u8{0} ** 20; |
| ... | @@ -600,6 +602,8 @@ test "xsalsa20poly1305 secretbox" { | ... | @@ -600,6 +602,8 @@ test "xsalsa20poly1305 secretbox" { |
| 600 | } | 602 | } |
| 601 | 603 | ||
| 602 | test "xsalsa20poly1305 box" { | 604 | test "xsalsa20poly1305 box" { |
| 605 | if (builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24299 | ||
| 606 | |||
| 603 | var msg: [100]u8 = undefined; | 607 | var msg: [100]u8 = undefined; |
| 604 | var msg2: [msg.len]u8 = undefined; | 608 | var msg2: [msg.len]u8 = undefined; |
| 605 | var nonce: [Box.nonce_length]u8 = undefined; | 609 | var nonce: [Box.nonce_length]u8 = undefined; |
| ... | @@ -614,6 +618,8 @@ test "xsalsa20poly1305 box" { | ... | @@ -614,6 +618,8 @@ test "xsalsa20poly1305 box" { |
| 614 | } | 618 | } |
| 615 | 619 | ||
| 616 | test "xsalsa20poly1305 sealedbox" { | 620 | test "xsalsa20poly1305 sealedbox" { |
| 621 | if (builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24299 | ||
| 622 | |||
| 617 | var msg: [100]u8 = undefined; | 623 | var msg: [100]u8 = undefined; |
| 618 | var msg2: [msg.len]u8 = undefined; | 624 | var msg2: [msg.len]u8 = undefined; |
| 619 | var boxed: [msg.len + SealedBox.seal_length]u8 = undefined; | 625 | var boxed: [msg.len + SealedBox.seal_length]u8 = undefined; |
lib/std/os/linux/riscv32.zig+36-2| ... | @@ -7,6 +7,8 @@ const SYS = linux.SYS; | ... | @@ -7,6 +7,8 @@ const SYS = linux.SYS; |
| 7 | const uid_t = std.os.linux.uid_t; | 7 | const uid_t = std.os.linux.uid_t; |
| 8 | const gid_t = std.os.linux.gid_t; | 8 | const gid_t = std.os.linux.gid_t; |
| 9 | const pid_t = std.os.linux.pid_t; | 9 | const pid_t = std.os.linux.pid_t; |
| 10 | const stack_t = linux.stack_t; | ||
| 11 | const sigset_t = linux.sigset_t; | ||
| 10 | const sockaddr = linux.sockaddr; | 12 | const sockaddr = linux.sockaddr; |
| 11 | const socklen_t = linux.socklen_t; | 13 | const socklen_t = linux.socklen_t; |
| 12 | const timespec = std.os.linux.timespec; | 14 | const timespec = std.os.linux.timespec; |
| ... | @@ -237,8 +239,40 @@ pub const VDSO = struct { | ... | @@ -237,8 +239,40 @@ pub const VDSO = struct { |
| 237 | pub const CGT_VER = "LINUX_4.15"; | 239 | pub const CGT_VER = "LINUX_4.15"; |
| 238 | }; | 240 | }; |
| 239 | 241 | ||
| 240 | /// TODO | 242 | pub const f_ext_state = extern struct { |
| 241 | pub const ucontext_t = void; | 243 | f: [32]f32, |
| 244 | fcsr: u32, | ||
| 245 | }; | ||
| 246 | |||
| 247 | pub const d_ext_state = extern struct { | ||
| 248 | f: [32]f64, | ||
| 249 | fcsr: u32, | ||
| 250 | }; | ||
| 251 | |||
| 252 | pub const q_ext_state = extern struct { | ||
| 253 | f: [32]f128, | ||
| 254 | fcsr: u32, | ||
| 255 | _reserved: [3]u32, | ||
| 256 | }; | ||
| 257 | |||
| 258 | pub const fpstate = extern union { | ||
| 259 | f: f_ext_state, | ||
| 260 | d: d_ext_state, | ||
| 261 | q: q_ext_state, | ||
| 262 | }; | ||
| 263 | |||
| 264 | pub const mcontext_t = extern struct { | ||
| 265 | gregs: [32]u32, | ||
| 266 | fpregs: fpstate, | ||
| 267 | }; | ||
| 268 | |||
| 269 | pub const ucontext_t = extern struct { | ||
| 270 | flags: c_ulong, | ||
| 271 | link: ?*ucontext_t, | ||
| 272 | stack: stack_t, | ||
| 273 | sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask | ||
| 274 | mcontext: mcontext_t, | ||
| 275 | }; | ||
| 242 | 276 | ||
| 243 | /// TODO | 277 | /// TODO |
| 244 | pub const getcontext = {}; | 278 | pub const getcontext = {}; |
lib/std/os/linux/riscv64.zig+36-2| ... | @@ -7,6 +7,8 @@ const SYS = linux.SYS; | ... | @@ -7,6 +7,8 @@ const SYS = linux.SYS; |
| 7 | const uid_t = std.os.linux.uid_t; | 7 | const uid_t = std.os.linux.uid_t; |
| 8 | const gid_t = std.os.linux.gid_t; | 8 | const gid_t = std.os.linux.gid_t; |
| 9 | const pid_t = std.os.linux.pid_t; | 9 | const pid_t = std.os.linux.pid_t; |
| 10 | const stack_t = linux.stack_t; | ||
| 11 | const sigset_t = linux.sigset_t; | ||
| 10 | const sockaddr = linux.sockaddr; | 12 | const sockaddr = linux.sockaddr; |
| 11 | const socklen_t = linux.socklen_t; | 13 | const socklen_t = linux.socklen_t; |
| 12 | const timespec = std.os.linux.timespec; | 14 | const timespec = std.os.linux.timespec; |
| ... | @@ -237,8 +239,40 @@ pub const VDSO = struct { | ... | @@ -237,8 +239,40 @@ pub const VDSO = struct { |
| 237 | pub const CGT_VER = "LINUX_4.15"; | 239 | pub const CGT_VER = "LINUX_4.15"; |
| 238 | }; | 240 | }; |
| 239 | 241 | ||
| 240 | /// TODO | 242 | pub const f_ext_state = extern struct { |
| 241 | pub const ucontext_t = void; | 243 | f: [32]f32, |
| 244 | fcsr: u32, | ||
| 245 | }; | ||
| 246 | |||
| 247 | pub const d_ext_state = extern struct { | ||
| 248 | f: [32]f64, | ||
| 249 | fcsr: u32, | ||
| 250 | }; | ||
| 251 | |||
| 252 | pub const q_ext_state = extern struct { | ||
| 253 | f: [32]f128, | ||
| 254 | fcsr: u32, | ||
| 255 | _reserved: [3]u32, | ||
| 256 | }; | ||
| 257 | |||
| 258 | pub const fpstate = extern union { | ||
| 259 | f: f_ext_state, | ||
| 260 | d: d_ext_state, | ||
| 261 | q: q_ext_state, | ||
| 262 | }; | ||
| 263 | |||
| 264 | pub const mcontext_t = extern struct { | ||
| 265 | gregs: [32]u64, | ||
| 266 | fpregs: fpstate, | ||
| 267 | }; | ||
| 268 | |||
| 269 | pub const ucontext_t = extern struct { | ||
| 270 | flags: c_ulong, | ||
| 271 | link: ?*ucontext_t, | ||
| 272 | stack: stack_t, | ||
| 273 | sigmask: [1024 / @bitSizeOf(c_ulong)]c_ulong, // Currently a libc-compatible (1024-bit) sigmask | ||
| 274 | mcontext: mcontext_t, | ||
| 275 | }; | ||
| 242 | 276 | ||
| 243 | /// TODO | 277 | /// TODO |
| 244 | pub const getcontext = {}; | 278 | pub const getcontext = {}; |
lib/std/simd.zig+2| ... | @@ -9,6 +9,8 @@ const std = @import("std"); | ... | @@ -9,6 +9,8 @@ const std = @import("std"); |
| 9 | const builtin = @import("builtin"); | 9 | const builtin = @import("builtin"); |
| 10 | 10 | ||
| 11 | pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?comptime_int { | 11 | pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu) ?comptime_int { |
| 12 | @setEvalBranchQuota(2_000); | ||
| 13 | |||
| 12 | // This is guesswork, if you have better suggestions can add it or edit the current here | 14 | // This is guesswork, if you have better suggestions can add it or edit the current here |
| 13 | const element_bit_size = @max(8, std.math.ceilPowerOfTwo(u16, @bitSizeOf(T)) catch unreachable); | 15 | const element_bit_size = @max(8, std.math.ceilPowerOfTwo(u16, @bitSizeOf(T)) catch unreachable); |
| 14 | const vector_bit_size: u16 = blk: { | 16 | const vector_bit_size: u16 = blk: { |
lib/std/zig/system/linux.zig+2| ... | @@ -76,9 +76,11 @@ const RiscvCpuinfoImpl = struct { | ... | @@ -76,9 +76,11 @@ const RiscvCpuinfoImpl = struct { |
| 76 | 76 | ||
| 77 | const cpu_names = .{ | 77 | const cpu_names = .{ |
| 78 | .{ "sifive,u54", &Target.riscv.cpu.sifive_u54 }, | 78 | .{ "sifive,u54", &Target.riscv.cpu.sifive_u54 }, |
| 79 | .{ "sifive,u54-mc", &Target.riscv.cpu.sifive_u54 }, | ||
| 79 | .{ "sifive,u7", &Target.riscv.cpu.sifive_7_series }, | 80 | .{ "sifive,u7", &Target.riscv.cpu.sifive_7_series }, |
| 80 | .{ "sifive,u74", &Target.riscv.cpu.sifive_u74 }, | 81 | .{ "sifive,u74", &Target.riscv.cpu.sifive_u74 }, |
| 81 | .{ "sifive,u74-mc", &Target.riscv.cpu.sifive_u74 }, | 82 | .{ "sifive,u74-mc", &Target.riscv.cpu.sifive_u74 }, |
| 83 | .{ "spacemit,x60", &Target.riscv.cpu.spacemit_x60 }, | ||
| 82 | }; | 84 | }; |
| 83 | 85 | ||
| 84 | fn line_hook(self: *RiscvCpuinfoImpl, key: []const u8, value: []const u8) !bool { | 86 | fn line_hook(self: *RiscvCpuinfoImpl, key: []const u8, value: []const u8) !bool { |
src/codegen/llvm.zig+7-4| ... | @@ -1074,6 +1074,9 @@ pub const Object = struct { | ... | @@ -1074,6 +1074,9 @@ pub const Object = struct { |
| 1074 | .full => .FullPreLink, | 1074 | .full => .FullPreLink, |
| 1075 | }, | 1075 | }, |
| 1076 | .allow_fast_isel = true, | 1076 | .allow_fast_isel = true, |
| 1077 | // LLVM's RISC-V backend for some reason enables the machine outliner by default even | ||
| 1078 | // though it's clearly not ready and produces multiple miscompilations in our std tests. | ||
| 1079 | .allow_machine_outliner = !comp.root_mod.resolved_target.result.cpu.arch.isRISCV(), | ||
| 1077 | .asm_filename = null, | 1080 | .asm_filename = null, |
| 1078 | .bin_filename = options.bin_path, | 1081 | .bin_filename = options.bin_path, |
| 1079 | .llvm_ir_filename = options.post_ir_path, | 1082 | .llvm_ir_filename = options.post_ir_path, |
| ... | @@ -6837,8 +6840,8 @@ pub const FuncGen = struct { | ... | @@ -6837,8 +6840,8 @@ pub const FuncGen = struct { |
| 6837 | 6840 | ||
| 6838 | self.maybeMarkAllowZeroAccess(slice_ty.ptrInfo(zcu)); | 6841 | self.maybeMarkAllowZeroAccess(slice_ty.ptrInfo(zcu)); |
| 6839 | 6842 | ||
| 6840 | const elem_alignment = elem_ty.abiAlignment(zcu).toLlvm(); | 6843 | const slice_align = (slice_ty.ptrAlignment(zcu).min(elem_ty.abiAlignment(zcu))).toLlvm(); |
| 6841 | return self.loadByRef(ptr, elem_ty, elem_alignment, if (slice_ty.isVolatilePtr(zcu)) .@"volatile" else .normal); | 6844 | return self.loadByRef(ptr, elem_ty, slice_align, if (slice_ty.isVolatilePtr(zcu)) .@"volatile" else .normal); |
| 6842 | } | 6845 | } |
| 6843 | 6846 | ||
| 6844 | self.maybeMarkAllowZeroAccess(slice_ty.ptrInfo(zcu)); | 6847 | self.maybeMarkAllowZeroAccess(slice_ty.ptrInfo(zcu)); |
| ... | @@ -6915,8 +6918,8 @@ pub const FuncGen = struct { | ... | @@ -6915,8 +6918,8 @@ pub const FuncGen = struct { |
| 6915 | 6918 | ||
| 6916 | self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu)); | 6919 | self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu)); |
| 6917 | 6920 | ||
| 6918 | const elem_alignment = elem_ty.abiAlignment(zcu).toLlvm(); | 6921 | const ptr_align = (ptr_ty.ptrAlignment(zcu).min(elem_ty.abiAlignment(zcu))).toLlvm(); |
| 6919 | return self.loadByRef(ptr, elem_ty, elem_alignment, if (ptr_ty.isVolatilePtr(zcu)) .@"volatile" else .normal); | 6922 | return self.loadByRef(ptr, elem_ty, ptr_align, if (ptr_ty.isVolatilePtr(zcu)) .@"volatile" else .normal); |
| 6920 | } | 6923 | } |
| 6921 | 6924 | ||
| 6922 | self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu)); | 6925 | self.maybeMarkAllowZeroAccess(ptr_ty.ptrInfo(zcu)); |
src/codegen/llvm/bindings.zig+1| ... | @@ -92,6 +92,7 @@ pub const TargetMachine = opaque { | ... | @@ -92,6 +92,7 @@ pub const TargetMachine = opaque { |
| 92 | sancov: bool, | 92 | sancov: bool, |
| 93 | lto: LtoPhase, | 93 | lto: LtoPhase, |
| 94 | allow_fast_isel: bool, | 94 | allow_fast_isel: bool, |
| 95 | allow_machine_outliner: bool, | ||
| 95 | asm_filename: ?[*:0]const u8, | 96 | asm_filename: ?[*:0]const u8, |
| 96 | bin_filename: ?[*:0]const u8, | 97 | bin_filename: ?[*:0]const u8, |
| 97 | llvm_ir_filename: ?[*:0]const u8, | 98 | llvm_ir_filename: ?[*:0]const u8, |
src/zig_llvm.cpp+10-6| ... | @@ -260,6 +260,16 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi | ... | @@ -260,6 +260,16 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi |
| 260 | 260 | ||
| 261 | TargetMachine &target_machine = *reinterpret_cast<TargetMachine*>(targ_machine_ref); | 261 | TargetMachine &target_machine = *reinterpret_cast<TargetMachine*>(targ_machine_ref); |
| 262 | 262 | ||
| 263 | if (options->allow_fast_isel) { | ||
| 264 | target_machine.setO0WantsFastISel(true); | ||
| 265 | } else { | ||
| 266 | target_machine.setFastISel(false); | ||
| 267 | } | ||
| 268 | |||
| 269 | if (!options->allow_machine_outliner) { | ||
| 270 | target_machine.setMachineOutliner(false); | ||
| 271 | } | ||
| 272 | |||
| 263 | Module &llvm_module = *unwrap(module_ref); | 273 | Module &llvm_module = *unwrap(module_ref); |
| 264 | 274 | ||
| 265 | // Pipeline configurations | 275 | // Pipeline configurations |
| ... | @@ -385,12 +395,6 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi | ... | @@ -385,12 +395,6 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi |
| 385 | } | 395 | } |
| 386 | } | 396 | } |
| 387 | 397 | ||
| 388 | if (options->allow_fast_isel) { | ||
| 389 | target_machine.setO0WantsFastISel(true); | ||
| 390 | } else { | ||
| 391 | target_machine.setFastISel(false); | ||
| 392 | } | ||
| 393 | |||
| 394 | // Optimization phase | 398 | // Optimization phase |
| 395 | module_pm.run(llvm_module, module_am); | 399 | module_pm.run(llvm_module, module_am); |
| 396 | 400 |
src/zig_llvm.h+1| ... | @@ -71,6 +71,7 @@ struct ZigLLVMEmitOptions { | ... | @@ -71,6 +71,7 @@ struct ZigLLVMEmitOptions { |
| 71 | bool sancov; | 71 | bool sancov; |
| 72 | ZigLLVMThinOrFullLTOPhase lto; | 72 | ZigLLVMThinOrFullLTOPhase lto; |
| 73 | bool allow_fast_isel; | 73 | bool allow_fast_isel; |
| 74 | bool allow_machine_outliner; | ||
| 74 | const char *asm_filename; | 75 | const char *asm_filename; |
| 75 | const char *bin_filename; | 76 | const char *bin_filename; |
| 76 | const char *llvm_ir_filename; | 77 | const char *llvm_ir_filename; |
test/behavior/vector.zig+1| ... | @@ -560,6 +560,7 @@ test "vector division operators" { | ... | @@ -560,6 +560,7 @@ test "vector division operators" { |
| 560 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 560 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 561 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 561 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 562 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 562 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 563 | if (comptime builtin.cpu.has(.riscv, .v) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24301 | ||
| 563 | 564 | ||
| 564 | const S = struct { | 565 | const S = struct { |
| 565 | fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void { | 566 | fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void { |
test/link/glibc_compat/build.zig+21-4| ... | @@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void { |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | // Build & run a C test case against a sampling of supported glibc versions | 35 | // Build & run a C test case against a sampling of supported glibc versions |
| 36 | for ([_][]const u8{ | 36 | versions: for ([_][]const u8{ |
| 37 | // "native-linux-gnu.2.0", // fails with a pile of missing symbols. | 37 | // "native-linux-gnu.2.0", // fails with a pile of missing symbols. |
| 38 | "native-linux-gnu.2.2.5", | 38 | "native-linux-gnu.2.2.5", |
| 39 | "native-linux-gnu.2.4", | 39 | "native-linux-gnu.2.4", |
| ... | @@ -52,9 +52,14 @@ pub fn build(b: *std.Build) void { | ... | @@ -52,9 +52,14 @@ pub fn build(b: *std.Build) void { |
| 52 | const glibc_ver = target.result.os.version_range.linux.glibc; | 52 | const glibc_ver = target.result.os.version_range.linux.glibc; |
| 53 | 53 | ||
| 54 | // only build test if glibc version supports the architecture | 54 | // only build test if glibc version supports the architecture |
| 55 | if (target.result.cpu.arch.isAARCH64()) { | 55 | for (std.zig.target.available_libcs) |libc| { |
| 56 | if (glibc_ver.order(.{ .major = 2, .minor = 17, .patch = 0 }) == .lt) { | 56 | if (libc.arch != target.result.cpu.arch or |
| 57 | libc.os != target.result.os.tag or | ||
| 58 | libc.abi != target.result.abi) | ||
| 57 | continue; | 59 | continue; |
| 60 | |||
| 61 | if (libc.glibc_min) |min| { | ||
| 62 | if (glibc_ver.order(min) == .lt) continue :versions; | ||
| 58 | } | 63 | } |
| 59 | } | 64 | } |
| 60 | 65 | ||
| ... | @@ -147,7 +152,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -147,7 +152,7 @@ pub fn build(b: *std.Build) void { |
| 147 | } | 152 | } |
| 148 | 153 | ||
| 149 | // Build & run a Zig test case against a sampling of supported glibc versions | 154 | // Build & run a Zig test case against a sampling of supported glibc versions |
| 150 | for ([_][]const u8{ | 155 | versions: for ([_][]const u8{ |
| 151 | "native-linux-gnu.2.17", // Currently oldest supported, see #17769 | 156 | "native-linux-gnu.2.17", // Currently oldest supported, see #17769 |
| 152 | "native-linux-gnu.2.23", | 157 | "native-linux-gnu.2.23", |
| 153 | "native-linux-gnu.2.28", | 158 | "native-linux-gnu.2.28", |
| ... | @@ -161,6 +166,18 @@ pub fn build(b: *std.Build) void { | ... | @@ -161,6 +166,18 @@ pub fn build(b: *std.Build) void { |
| 161 | 166 | ||
| 162 | const glibc_ver = target.result.os.version_range.linux.glibc; | 167 | const glibc_ver = target.result.os.version_range.linux.glibc; |
| 163 | 168 | ||
| 169 | // only build test if glibc version supports the architecture | ||
| 170 | for (std.zig.target.available_libcs) |libc| { | ||
| 171 | if (libc.arch != target.result.cpu.arch or | ||
| 172 | libc.os != target.result.os.tag or | ||
| 173 | libc.abi != target.result.abi) | ||
| 174 | continue; | ||
| 175 | |||
| 176 | if (libc.glibc_min) |min| { | ||
| 177 | if (glibc_ver.order(min) == .lt) continue :versions; | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 164 | const exe = b.addExecutable(.{ | 181 | const exe = b.addExecutable(.{ |
| 165 | .name = t, | 182 | .name = t, |
| 166 | .root_module = b.createModule(.{ | 183 | .root_module = b.createModule(.{ |
test/standalone/coff_dwarf/build.zig+8| ... | @@ -3,6 +3,14 @@ const builtin = @import("builtin"); | ... | @@ -3,6 +3,14 @@ const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | /// This tests the path where DWARF information is embedded in a COFF binary | 4 | /// This tests the path where DWARF information is embedded in a COFF binary |
| 5 | pub fn build(b: *std.Build) void { | 5 | pub fn build(b: *std.Build) void { |
| 6 | switch (builtin.cpu.arch) { | ||
| 7 | .aarch64, | ||
| 8 | .x86, | ||
| 9 | .x86_64, | ||
| 10 | => {}, | ||
| 11 | else => return, | ||
| 12 | } | ||
| 13 | |||
| 6 | const test_step = b.step("test", "Test it"); | 14 | const test_step = b.step("test", "Test it"); |
| 7 | b.default_step = test_step; | 15 | b.default_step = test_step; |
| 8 | 16 |
test/standalone/stack_iterator/build.zig+5| ... | @@ -8,6 +8,11 @@ pub fn build(b: *std.Build) void { | ... | @@ -8,6 +8,11 @@ pub fn build(b: *std.Build) void { |
| 8 | const target = b.standardTargetOptions(.{}); | 8 | const target = b.standardTargetOptions(.{}); |
| 9 | const optimize = b.standardOptimizeOption(.{}); | 9 | const optimize = b.standardOptimizeOption(.{}); |
| 10 | 10 | ||
| 11 | if (target.result.cpu.arch.isRISCV() and target.result.os.tag == .linux) { | ||
| 12 | // https://github.com/ziglang/zig/issues/24310 | ||
| 13 | return; | ||
| 14 | } | ||
| 15 | |||
| 11 | // Unwinding with a frame pointer | 16 | // Unwinding with a frame pointer |
| 12 | // | 17 | // |
| 13 | // getcontext version: zig std | 18 | // getcontext version: zig std |