From 620f69c3b4cbd581726d2e1b3b1af05ef9ed9e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 24 Nov 2024 04:34:49 +0100 Subject: [PATCH 1/6] compiler-rt: Disable __aeabi_drsub test on armeb. https://github.com/ziglang/zig/issues/22061 --- lib/compiler_rt/arm.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compiler_rt/arm.zig b/lib/compiler_rt/arm.zig index 5a95e9da49..b71829688a 100644 --- a/lib/compiler_rt/arm.zig +++ b/lib/compiler_rt/arm.zig @@ -233,6 +233,7 @@ test "__aeabi_frsub" { test "__aeabi_drsub" { if (!builtin.cpu.arch.isArm() or builtin.cpu.arch.isThumb()) return error.SkipZigTest; + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22061 const inf64 = std.math.inf(f64); const maxf64 = std.math.floatMax(f64); const frsub_data = [_][3]f64{ From 499ad89b41df7d48ea7975ff3014534b7865e619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 24 Nov 2024 04:35:14 +0100 Subject: [PATCH 2/6] std: Disable some vector-related tests on armeb. https://github.com/ziglang/zig/issues/22060 --- lib/std/fmt.zig | 1 + lib/std/simd.zig | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 2f16d849b0..b45194a837 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -2596,6 +2596,7 @@ test "positional/alignment/width/precision" { } test "vector" { + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 if (builtin.target.cpu.arch == .riscv64) { // https://github.com/ziglang/zig/issues/4486 return error.SkipZigTest; diff --git a/lib/std/simd.zig b/lib/std/simd.zig index b02298622d..3413ad127f 100644 --- a/lib/std/simd.zig +++ b/lib/std/simd.zig @@ -462,6 +462,7 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a test "vector prefix scan" { if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893 if (comptime builtin.cpu.arch.isMIPS()) { From 1e61399537999531d2bdb9bc9c2ff51aecbbedf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 24 Nov 2024 04:35:32 +0100 Subject: [PATCH 3/6] test: Disable some vector behavior tests on armeb. https://github.com/ziglang/zig/issues/22060 --- test/behavior/vector.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig index 69de2df55e..5798665d0c 100644 --- a/test/behavior/vector.zig +++ b/test/behavior/vector.zig @@ -639,8 +639,9 @@ test "vector division operators" { } }; - try S.doTheTest(); try comptime S.doTheTest(); + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + try S.doTheTest(); } test "vector bitwise not operator" { @@ -1098,8 +1099,9 @@ test "@addWithOverflow" { } } }; - try S.doTheTest(); try comptime S.doTheTest(); + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + try S.doTheTest(); } test "@subWithOverflow" { @@ -1131,8 +1133,9 @@ test "@subWithOverflow" { } } }; - try S.doTheTest(); try comptime S.doTheTest(); + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + try S.doTheTest(); } test "@mulWithOverflow" { @@ -1154,8 +1157,9 @@ test "@mulWithOverflow" { try expectEqual(expected, overflow); } }; - try S.doTheTest(); try comptime S.doTheTest(); + if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + try S.doTheTest(); } test "@shlWithOverflow" { From df27298aeffa0621f9b899b1a1855098bd8f550f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 24 Nov 2024 04:35:54 +0100 Subject: [PATCH 4/6] test: Add armeb-linux-* to the module test matrix. --- test/tests.zig | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index e123dc1e2b..2777a83cb5 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -354,6 +354,53 @@ const test_targets = blk: { .link_libc = true, }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .eabi, + }, + }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .eabihf, + }, + }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .musleabi, + }, + .link_libc = true, + }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .musleabihf, + }, + .link_libc = true, + }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .gnueabi, + }, + .link_libc = true, + }, + .{ + .target = .{ + .cpu_arch = .armeb, + .os_tag = .linux, + .abi = .gnueabihf, + }, + .link_libc = true, + }, + .{ .target = .{ .cpu_arch = .thumb, From fdc0ed92ce839f7532bff94d9c8127b07e8161d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 24 Nov 2024 04:36:24 +0100 Subject: [PATCH 5/6] test: Add thumbeb-linux-* to the module test matrix. --- test/tests.zig | 68 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/test/tests.zig b/test/tests.zig index 2777a83cb5..fdfd550df6 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -440,7 +440,7 @@ const test_targets = blk: { .target = std.Target.Query.parse(.{ .arch_os_abi = "thumb-linux-musleabi", .cpu_features = "baseline+long_calls", - }) catch @panic("OOM"), + }) catch unreachable, .link_libc = true, .pic = false, // Long calls don't work with PIC. .skip_modules = &.{ @@ -454,7 +454,71 @@ const test_targets = blk: { .target = std.Target.Query.parse(.{ .arch_os_abi = "thumb-linux-musleabihf", .cpu_features = "baseline+long_calls", - }) catch @panic("OOM"), + }) catch unreachable, + .link_libc = true, + .pic = false, // Long calls don't work with PIC. + .skip_modules = &.{ + "behavior", + "c-import", + "compiler-rt", + "universal-libc", + }, + }, + + .{ + .target = .{ + .cpu_arch = .thumbeb, + .os_tag = .linux, + .abi = .eabi, + }, + }, + .{ + .target = .{ + .cpu_arch = .thumbeb, + .os_tag = .linux, + .abi = .eabihf, + }, + }, + .{ + .target = .{ + .cpu_arch = .thumbeb, + .os_tag = .linux, + .abi = .musleabi, + }, + .link_libc = true, + .skip_modules = &.{"std"}, + }, + .{ + .target = .{ + .cpu_arch = .thumbeb, + .os_tag = .linux, + .abi = .musleabihf, + }, + .link_libc = true, + .skip_modules = &.{"std"}, + }, + // Calls are normally lowered to branch instructions that only support +/- 16 MB range when + // targeting Thumb. This is not sufficient for the std test binary linked statically with + // musl, so use long calls to avoid out-of-range relocations. + .{ + .target = std.Target.Query.parse(.{ + .arch_os_abi = "thumbeb-linux-musleabi", + .cpu_features = "baseline+long_calls", + }) catch unreachable, + .link_libc = true, + .pic = false, // Long calls don't work with PIC. + .skip_modules = &.{ + "behavior", + "c-import", + "compiler-rt", + "universal-libc", + }, + }, + .{ + .target = std.Target.Query.parse(.{ + .arch_os_abi = "thumbeb-linux-musleabihf", + .cpu_features = "baseline+long_calls", + }) catch unreachable, .link_libc = true, .pic = false, // Long calls don't work with PIC. .skip_modules = &.{ From 9aa4cf4f8895fe1e61ec92e97c6255df0a58f88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 3 Nov 2024 07:58:49 +0100 Subject: [PATCH 6/6] test: Add aarch64_be-linux-* to the module test matrix. --- test/tests.zig | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index fdfd550df6..6624f21545 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -307,6 +307,30 @@ const test_targets = blk: { .link_libc = true, }, + .{ + .target = .{ + .cpu_arch = .aarch64_be, + .os_tag = .linux, + .abi = .none, + }, + }, + .{ + .target = .{ + .cpu_arch = .aarch64_be, + .os_tag = .linux, + .abi = .musl, + }, + .link_libc = true, + }, + .{ + .target = .{ + .cpu_arch = .aarch64_be, + .os_tag = .linux, + .abi = .gnu, + }, + .link_libc = true, + }, + .{ .target = .{ .cpu_arch = .arm,