authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-03 14:25:30+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-11-03 14:25:30+01:00
log2f003f39b28176f08de51271eb66b5f3a54c7aae
tree8aa5be07f5749b49a2103bda726771473f29bbbd
parent947b7195bf4628cc4658fec9e2f5b30a1318132b
parent621487d5abcf9006b3e38f96c49a533c1835e7a3
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21599 from alexrp/thumb-porting


33 files changed, 174 insertions(+), 103 deletions(-)

lib/compiler/aro/aro/toolchains/Linux.zig+1-1
......@@ -40,7 +40,7 @@ fn buildExtraOpts(self: *Linux, tc: *const Toolchain) !void {
4040 self.extra_opts.appendAssumeCapacity("relro");
4141 }
4242
43 if (target.cpu.arch.isARM() or target.cpu.arch.isAARCH64() or is_android) {
43 if ((target.cpu.arch.isArm() and !target.cpu.arch.isThumb()) or target.cpu.arch.isAARCH64() or is_android) {
4444 try self.extra_opts.ensureUnusedCapacity(gpa, 2);
4545 self.extra_opts.appendAssumeCapacity("-z");
4646 self.extra_opts.appendAssumeCapacity("max-page-size=4096");
lib/compiler_rt/arm.zig+3-5
......@@ -10,7 +10,7 @@ pub const panic = common.panic;
1010
1111comptime {
1212 if (!builtin.is_test) {
13 if (arch.isArmOrThumb()) {
13 if (arch.isArm()) {
1414 @export(&__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = common.linkage, .visibility = common.visibility });
1515 @export(&__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = common.linkage, .visibility = common.visibility });
1616 @export(&__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = common.linkage, .visibility = common.visibility });
......@@ -206,7 +206,7 @@ fn __aeabi_drsub(a: f64, b: f64) callconv(.AAPCS) f64 {
206206}
207207
208208test "__aeabi_frsub" {
209 if (!builtin.cpu.arch.isARM()) return error.SkipZigTest;
209 if (!builtin.cpu.arch.isArm() or builtin.cpu.arch.isThumb()) return error.SkipZigTest;
210210 const inf32 = std.math.inf(f32);
211211 const maxf32 = std.math.floatMax(f32);
212212 const frsub_data = [_][3]f32{
......@@ -226,14 +226,13 @@ test "__aeabi_frsub" {
226226 [_]f32{ maxf32, -maxf32, -inf32 },
227227 [_]f32{ -maxf32, maxf32, inf32 },
228228 };
229 if (!builtin.cpu.arch.isARM()) return error.SkipZigTest;
230229 for (frsub_data) |data| {
231230 try std.testing.expectApproxEqAbs(data[2], __aeabi_frsub(data[0], data[1]), 0.001);
232231 }
233232}
234233
235234test "__aeabi_drsub" {
236 if (!builtin.cpu.arch.isARM()) return error.SkipZigTest;
235 if (!builtin.cpu.arch.isArm() or builtin.cpu.arch.isThumb()) return error.SkipZigTest;
237236 const inf64 = std.math.inf(f64);
238237 const maxf64 = std.math.floatMax(f64);
239238 const frsub_data = [_][3]f64{
......@@ -253,7 +252,6 @@ test "__aeabi_drsub" {
253252 [_]f64{ maxf64, -maxf64, -inf64 },
254253 [_]f64{ -maxf64, maxf64, inf64 },
255254 };
256 if (!builtin.cpu.arch.isARM()) return error.SkipZigTest;
257255 for (frsub_data) |data| {
258256 try std.testing.expectApproxEqAbs(data[2], __aeabi_drsub(data[0], data[1]), 0.000001);
259257 }
lib/compiler_rt/clzsi2_test.zig+1-1
......@@ -268,7 +268,7 @@ test "clzsi2" {
268268 try test__clzsi2(0xFE000000, 0);
269269 try test__clzsi2(0xFF000000, 0);
270270 // arm and thumb1 assume input a != 0
271 if (!builtin.cpu.arch.isArmOrThumb())
271 if (!builtin.cpu.arch.isArm())
272272 try test__clzsi2(0x00000000, 32);
273273 try test__clzsi2(0x00000001, 31);
274274 try test__clzsi2(0x00000002, 30);
lib/compiler_rt/common.zig+1-1
......@@ -29,7 +29,7 @@ pub const want_aeabi = switch (builtin.abi) {
2929 },
3030 else => false,
3131};
32pub const want_mingw_arm_abi = builtin.cpu.arch.isArmOrThumb() and builtin.target.isMinGW();
32pub const want_mingw_arm_abi = builtin.cpu.arch.isArm() and builtin.target.isMinGW();
3333
3434pub const want_ppc_abi = builtin.cpu.arch.isPowerPC();
3535
lib/std/Target.zig+7-10
......@@ -1383,31 +1383,28 @@ pub const Cpu = struct {
13831383 };
13841384 }
13851385
1386 pub inline fn isARM(arch: Arch) bool {
1386 /// Note that this includes Thumb.
1387 pub inline fn isArm(arch: Arch) bool {
13871388 return switch (arch) {
13881389 .arm, .armeb => true,
1389 else => false,
1390 else => arch.isThumb(),
13901391 };
13911392 }
13921393
1393 pub inline fn isAARCH64(arch: Arch) bool {
1394 pub inline fn isThumb(arch: Arch) bool {
13941395 return switch (arch) {
1395 .aarch64, .aarch64_be => true,
1396 .thumb, .thumbeb => true,
13961397 else => false,
13971398 };
13981399 }
13991400
1400 pub inline fn isThumb(arch: Arch) bool {
1401 pub inline fn isAARCH64(arch: Arch) bool {
14011402 return switch (arch) {
1402 .thumb, .thumbeb => true,
1403 .aarch64, .aarch64_be => true,
14031404 else => false,
14041405 };
14051406 }
14061407
1407 pub inline fn isArmOrThumb(arch: Arch) bool {
1408 return arch.isARM() or arch.isThumb();
1409 }
1410
14111408 pub inline fn isWasm(arch: Arch) bool {
14121409 return switch (arch) {
14131410 .wasm32, .wasm64 => true,
lib/std/math/gamma.zig+1-1
......@@ -263,7 +263,7 @@ test gamma {
263263}
264264
265265test "gamma.special" {
266 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
266 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
267267
268268 inline for (&.{ f32, f64 }) |T| {
269269 try expect(std.math.isNan(gamma(T, -std.math.nan(T))));
lib/std/math/isnan.zig+1-1
......@@ -32,7 +32,7 @@ test isSignalNan {
3232 // TODO: Signalling NaN values get converted to quiet NaN values in
3333 // some cases where they shouldn't such that this can fail.
3434 // See https://github.com/ziglang/zig/issues/14366
35 if (!builtin.cpu.arch.isArmOrThumb() and
35 if (!builtin.cpu.arch.isArm() and
3636 !builtin.cpu.arch.isAARCH64() and
3737 !builtin.cpu.arch.isPowerPC() and
3838 builtin.zig_backend != .stage2_c)
lib/std/os/linux.zig+2-2
......@@ -509,7 +509,7 @@ fn getauxvalImpl(index: usize) callconv(.C) usize {
509509const require_aligned_register_pair =
510510 builtin.cpu.arch.isPowerPC32() or
511511 builtin.cpu.arch.isMIPS32() or
512 builtin.cpu.arch.isArmOrThumb();
512 builtin.cpu.arch.isArm();
513513
514514// Split a 64bit value into a {LSB,MSB} pair.
515515// The LE/BE variants specify the endianness to assume.
......@@ -2334,7 +2334,7 @@ pub fn process_vm_writev(pid: pid_t, local: []const iovec_const, remote: []const
23342334}
23352335
23362336pub fn fadvise(fd: fd_t, offset: i64, len: i64, advice: usize) usize {
2337 if (comptime native_arch.isArmOrThumb() or native_arch.isPowerPC32()) {
2337 if (comptime native_arch.isArm() or native_arch.isPowerPC32()) {
23382338 // These architectures reorder the arguments so that a register is not skipped to align the
23392339 // register number that `offset` is passed in.
23402340
lib/std/simd.zig+1-1
......@@ -18,7 +18,7 @@ pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu)
1818 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .prefer_256_bit, .avx2 }) and !std.Target.x86.featureSetHas(cpu.features, .prefer_128_bit)) break :blk 256;
1919 if (std.Target.x86.featureSetHas(cpu.features, .sse)) break :blk 128;
2020 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .mmx, .@"3dnow" })) break :blk 64;
21 } else if (cpu.arch.isArmOrThumb()) {
21 } else if (cpu.arch.isArm()) {
2222 if (std.Target.arm.featureSetHas(cpu.features, .neon)) break :blk 128;
2323 } else if (cpu.arch.isAARCH64()) {
2424 // SVE allows up to 2048 bits in the specification, as of 2022 the most powerful machine has implemented 512-bit
lib/std/start.zig+1-1
......@@ -495,7 +495,7 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn {
495495 // ARMv6 targets (and earlier) have no support for TLS in hardware.
496496 // FIXME: Elide the check for targets >= ARMv7 when the target feature API
497497 // becomes less verbose (and more usable).
498 if (comptime native_arch.isArmOrThumb()) {
498 if (comptime native_arch.isArm()) {
499499 if (at_hwcap & std.os.linux.HWCAP.TLS == 0) {
500500 // FIXME: Make __aeabi_read_tp call the kernel helper kuser_get_tls
501501 // For the time being use a simple trap instead of a @panic call to
lib/std/zig/system.zig+1-1
......@@ -401,7 +401,7 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target {
401401 }
402402
403403 // https://github.com/llvm/llvm-project/issues/105978
404 if (result.cpu.arch.isArmOrThumb() and result.floatAbi() == .soft) {
404 if (result.cpu.arch.isArm() and result.floatAbi() == .soft) {
405405 result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2));
406406 }
407407
src/Compilation.zig+7-5
......@@ -1795,8 +1795,8 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
17951795 .{ .glibc_crt_file = .crtn_o },
17961796 });
17971797 }
1798 if (!is_dyn_lib) {
1799 try comp.queueJob(.{ .glibc_crt_file = .scrt1_o });
1798 if (glibc.needsCrt0(comp.config.output_mode)) |f| {
1799 try comp.queueJobs(&.{.{ .glibc_crt_file = f }});
18001800 }
18011801 try comp.queueJobs(&[_]Job{
18021802 .{ .glibc_shared_objects = {} },
......@@ -5628,8 +5628,8 @@ pub fn addCCArgs(
56285628 try argv.append("-mthumb");
56295629 }
56305630
5631 if (target_util.supports_fpic(target) and mod.pic) {
5632 try argv.append("-fPIC");
5631 if (target_util.supports_fpic(target)) {
5632 try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC");
56335633 }
56345634
56355635 try argv.ensureUnusedCapacity(2);
......@@ -6266,6 +6266,7 @@ pub fn build_crt_file(
62666266 comp: *Compilation,
62676267 root_name: []const u8,
62686268 output_mode: std.builtin.OutputMode,
6269 pic: ?bool,
62696270 misc_task_tag: MiscTask,
62706271 prog_node: std.Progress.Node,
62716272 /// These elements have to get mutated to add the owner module after it is
......@@ -6318,7 +6319,8 @@ pub fn build_crt_file(
63186319 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
63196320 .valgrind = false,
63206321 .unwind_tables = false,
6321 .pic = comp.root_mod.pic,
6322 // Some CRT objects (rcrt1.o, Scrt1.o) are opinionated about PIC.
6323 .pic = pic orelse comp.root_mod.pic,
63226324 .optimize_mode = comp.compilerRtOptMode(),
63236325 .structured_cfg = comp.root_mod.structured_cfg,
63246326 },
src/codegen/c.zig+1-1
......@@ -5190,7 +5190,7 @@ fn asmInputNeedsLocal(f: *Function, constraint: []const u8, value: CValue) bool
51905190 return switch (constraint[0]) {
51915191 '{' => true,
51925192 'i', 'r' => false,
5193 'I' => !target.cpu.arch.isArmOrThumb(),
5193 'I' => !target.cpu.arch.isArm(),
51945194 else => switch (value) {
51955195 .constant => |val| switch (dg.pt.zcu.intern_pool.indexToKey(val.toIntern())) {
51965196 .ptr => |ptr| if (ptr.byte_offset == 0) switch (ptr.base_addr) {
src/codegen/llvm.zig+3-3
......@@ -496,7 +496,7 @@ const DataLayoutBuilder = struct {
496496 if (idx != size) try writer.print(":{d}", .{idx});
497497 }
498498 }
499 if (self.target.cpu.arch.isArmOrThumb())
499 if (self.target.cpu.arch.isArm())
500500 try writer.writeAll("-Fi8") // for thumb interwork
501501 else if (self.target.cpu.arch == .powerpc64 and
502502 self.target.os.tag != .freebsd and
......@@ -763,7 +763,7 @@ const DataLayoutBuilder = struct {
763763 else => {},
764764 }
765765 },
766 .vector => if (self.target.cpu.arch.isArmOrThumb()) {
766 .vector => if (self.target.cpu.arch.isArm()) {
767767 switch (size) {
768768 128 => abi = 64,
769769 else => {},
......@@ -829,7 +829,7 @@ const DataLayoutBuilder = struct {
829829 else => {},
830830 },
831831 .aggregate => if (self.target.os.tag == .uefi or self.target.os.tag == .windows or
832 self.target.cpu.arch.isArmOrThumb())
832 self.target.cpu.arch.isArm())
833833 {
834834 pref = @min(pref, self.target.ptrBitWidth());
835835 } else switch (self.target.cpu.arch) {
src/codegen/llvm/Builder.zig+4-4
......@@ -9831,9 +9831,9 @@ pub fn printUnbuffered(
98319831 });
98329832 switch (extra.weights) {
98339833 .none => {},
9834 .unpredictable => try writer.writeAll(", !unpredictable !{}"),
9834 .unpredictable => try writer.writeAll("!unpredictable !{}"),
98359835 _ => try writer.print("{}", .{
9836 try metadata_formatter.fmt(", !prof ", @as(Metadata, @enumFromInt(@intFromEnum(extra.weights)))),
9836 try metadata_formatter.fmt("!prof ", @as(Metadata, @enumFromInt(@intFromEnum(extra.weights)))),
98379837 }),
98389838 }
98399839 },
......@@ -10112,9 +10112,9 @@ pub fn printUnbuffered(
1011210112 try writer.writeAll(" ]");
1011310113 switch (extra.data.weights) {
1011410114 .none => {},
10115 .unpredictable => try writer.writeAll(", !unpredictable !{}"),
10115 .unpredictable => try writer.writeAll("!unpredictable !{}"),
1011610116 _ => try writer.print("{}", .{
10117 try metadata_formatter.fmt(", !prof ", @as(Metadata, @enumFromInt(@intFromEnum(extra.data.weights)))),
10117 try metadata_formatter.fmt("!prof ", @as(Metadata, @enumFromInt(@intFromEnum(extra.data.weights)))),
1011810118 }),
1011910119 }
1012010120 },
src/glibc.zig+13-6
......@@ -221,7 +221,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
221221 .owner = comp.root_mod,
222222 },
223223 };
224 return comp.build_crt_file("crti", .Obj, .@"glibc crti.o", prog_node, &files);
224 return comp.build_crt_file("crti", .Obj, null, .@"glibc crti.o", prog_node, &files);
225225 },
226226 .crtn_o => {
227227 var args = std.ArrayList([]const u8).init(arena);
......@@ -242,7 +242,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
242242 .owner = undefined,
243243 },
244244 };
245 return comp.build_crt_file("crtn", .Obj, .@"glibc crtn.o", prog_node, &files);
245 return comp.build_crt_file("crtn", .Obj, null, .@"glibc crtn.o", prog_node, &files);
246246 },
247247 .scrt1_o => {
248248 const start_o: Compilation.CSourceFile = blk: {
......@@ -295,7 +295,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
295295 };
296296 var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o };
297297 const basename = if (comp.config.output_mode == .Exe and !comp.config.pie) "crt1" else "Scrt1";
298 return comp.build_crt_file(basename, .Obj, .@"glibc Scrt1.o", prog_node, &files);
298 return comp.build_crt_file(basename, .Obj, null, .@"glibc Scrt1.o", prog_node, &files);
299299 },
300300 .libc_nonshared_a => {
301301 const s = path.sep_str;
......@@ -413,7 +413,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
413413 files_index += 1;
414414 }
415415 const files = files_buf[0..files_index];
416 return comp.build_crt_file("c_nonshared", .Lib, .@"glibc libc_nonshared.a", prog_node, files);
416 return comp.build_crt_file("c_nonshared", .Lib, null, .@"glibc libc_nonshared.a", prog_node, files);
417417 },
418418 }
419419}
......@@ -440,7 +440,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![
440440 try result.appendSlice("sparc" ++ s ++ "sparc32");
441441 }
442442 }
443 } else if (arch.isARM()) {
443 } else if (arch.isArm()) {
444444 try result.appendSlice("arm");
445445 } else if (arch.isMIPS()) {
446446 if (!mem.eql(u8, basename, "crti.S") and !mem.eql(u8, basename, "crtn.S")) {
......@@ -604,7 +604,7 @@ fn add_include_dirs_arch(
604604 try args.append("-I");
605605 try args.append(try path.join(arena, &[_][]const u8{ dir, "x86" }));
606606 }
607 } else if (arch.isARM()) {
607 } else if (arch.isArm()) {
608608 if (opt_nptl) |nptl| {
609609 try args.append("-I");
610610 try args.append(try path.join(arena, &[_][]const u8{ dir, "arm", nptl }));
......@@ -1359,3 +1359,10 @@ pub fn needsCrtiCrtn(target: std.Target) bool {
13591359 else => true,
13601360 };
13611361}
1362
1363pub fn needsCrt0(output_mode: std.builtin.OutputMode) ?CrtFile {
1364 return switch (output_mode) {
1365 .Obj, .Lib => null,
1366 .Exe => .scrt1_o,
1367 };
1368}
src/libunwind.zig+1-1
......@@ -136,7 +136,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
136136 if (!comp.config.any_non_single_threaded) {
137137 try cflags.append("-D_LIBUNWIND_HAS_NO_THREADS");
138138 }
139 if (target.cpu.arch.isArmOrThumb() and target.abi.floatAbi() == .hard) {
139 if (target.cpu.arch.isArm() and target.abi.floatAbi() == .hard) {
140140 try cflags.append("-DCOMPILER_RT_ARMHF_TARGET");
141141 }
142142 try cflags.append("-Wno-bitwise-conditional-parentheses");
src/link/Coff.zig+4-6
......@@ -1865,12 +1865,10 @@ fn linkWithLLD(coff: *Coff, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
18651865 try argv.append("-MACHINE:X86");
18661866 } else if (target.cpu.arch == .x86_64) {
18671867 try argv.append("-MACHINE:X64");
1868 } else if (target.cpu.arch.isARM()) {
1869 if (target.ptrBitWidth() == 32) {
1870 try argv.append("-MACHINE:ARM");
1871 } else {
1872 try argv.append("-MACHINE:ARM64");
1873 }
1868 } else if (target.cpu.arch == .thumb) {
1869 try argv.append("-MACHINE:ARM");
1870 } else if (target.cpu.arch == .aarch64) {
1871 try argv.append("-MACHINE:ARM64");
18741872 }
18751873
18761874 for (comp.force_undefined_symbols.keys()) |symbol| {
src/link/Elf.zig+1-1
......@@ -1823,7 +1823,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s
18231823 }
18241824
18251825 if (link_mode == .static) {
1826 if (target.cpu.arch.isArmOrThumb()) {
1826 if (target.cpu.arch.isArm()) {
18271827 try argv.append("-Bstatic");
18281828 } else {
18291829 try argv.append("-static");
src/mingw.zig+3-3
......@@ -41,7 +41,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
4141 .owner = undefined,
4242 },
4343 };
44 return comp.build_crt_file("crt2", .Obj, .@"mingw-w64 crt2.o", prog_node, &files);
44 return comp.build_crt_file("crt2", .Obj, null, .@"mingw-w64 crt2.o", prog_node, &files);
4545 },
4646
4747 .dllcrt2_o => {
......@@ -56,7 +56,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
5656 .owner = undefined,
5757 },
5858 };
59 return comp.build_crt_file("dllcrt2", .Obj, .@"mingw-w64 dllcrt2.o", prog_node, &files);
59 return comp.build_crt_file("dllcrt2", .Obj, null, .@"mingw-w64 dllcrt2.o", prog_node, &files);
6060 },
6161
6262 .mingw32_lib => {
......@@ -118,7 +118,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
118118 } else {
119119 @panic("unsupported arch");
120120 }
121 return comp.build_crt_file("mingw32", .Lib, .@"mingw-w64 mingw32.lib", prog_node, c_source_files.items);
121 return comp.build_crt_file("mingw32", .Lib, null, .@"mingw-w64 mingw32.lib", prog_node, c_source_files.items);
122122 },
123123 }
124124}
src/musl.zig+6-8
......@@ -38,7 +38,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
3838 .owner = undefined,
3939 },
4040 };
41 return comp.build_crt_file("crti", .Obj, .@"musl crti.o", prog_node, &files);
41 return comp.build_crt_file("crti", .Obj, null, .@"musl crti.o", prog_node, &files);
4242 },
4343 .crtn_o => {
4444 var args = std.ArrayList([]const u8).init(arena);
......@@ -50,7 +50,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
5050 .owner = undefined,
5151 },
5252 };
53 return comp.build_crt_file("crtn", .Obj, .@"musl crtn.o", prog_node, &files);
53 return comp.build_crt_file("crtn", .Obj, null, .@"musl crtn.o", prog_node, &files);
5454 },
5555 .crt1_o => {
5656 var args = std.ArrayList([]const u8).init(arena);
......@@ -68,13 +68,12 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
6868 .owner = undefined,
6969 },
7070 };
71 return comp.build_crt_file("crt1", .Obj, .@"musl crt1.o", prog_node, &files);
71 return comp.build_crt_file("crt1", .Obj, null, .@"musl crt1.o", prog_node, &files);
7272 },
7373 .rcrt1_o => {
7474 var args = std.ArrayList([]const u8).init(arena);
7575 try addCcArgs(comp, arena, &args, false);
7676 try args.appendSlice(&[_][]const u8{
77 "-fPIC",
7877 "-fno-stack-protector",
7978 "-DCRT",
8079 });
......@@ -87,13 +86,12 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
8786 .owner = undefined,
8887 },
8988 };
90 return comp.build_crt_file("rcrt1", .Obj, .@"musl rcrt1.o", prog_node, &files);
89 return comp.build_crt_file("rcrt1", .Obj, true, .@"musl rcrt1.o", prog_node, &files);
9190 },
9291 .scrt1_o => {
9392 var args = std.ArrayList([]const u8).init(arena);
9493 try addCcArgs(comp, arena, &args, false);
9594 try args.appendSlice(&[_][]const u8{
96 "-fPIC",
9795 "-fno-stack-protector",
9896 "-DCRT",
9997 });
......@@ -106,7 +104,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
106104 .owner = undefined,
107105 },
108106 };
109 return comp.build_crt_file("Scrt1", .Obj, .@"musl Scrt1.o", prog_node, &files);
107 return comp.build_crt_file("Scrt1", .Obj, true, .@"musl Scrt1.o", prog_node, &files);
110108 },
111109 .libc_a => {
112110 // When there is a src/<arch>/foo.* then it should substitute for src/foo.*
......@@ -199,7 +197,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
199197 .owner = undefined,
200198 };
201199 }
202 return comp.build_crt_file("c", .Lib, .@"musl libc.a", prog_node, c_source_files.items);
200 return comp.build_crt_file("c", .Lib, null, .@"musl libc.a", prog_node, c_source_files.items);
203201 },
204202 .libc_so => {
205203 const optimize_mode = comp.compilerRtOptMode();
src/wasi_libc.zig+7-7
......@@ -81,7 +81,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
8181 .owner = undefined,
8282 },
8383 };
84 return comp.build_crt_file("crt1-reactor", .Obj, .@"wasi crt1-reactor.o", prog_node, &files);
84 return comp.build_crt_file("crt1-reactor", .Obj, null, .@"wasi crt1-reactor.o", prog_node, &files);
8585 },
8686 .crt1_command_o => {
8787 var args = std.ArrayList([]const u8).init(arena);
......@@ -96,7 +96,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
9696 .owner = undefined,
9797 },
9898 };
99 return comp.build_crt_file("crt1-command", .Obj, .@"wasi crt1-command.o", prog_node, &files);
99 return comp.build_crt_file("crt1-command", .Obj, null, .@"wasi crt1-command.o", prog_node, &files);
100100 },
101101 .libc_a => {
102102 var libc_sources = std.ArrayList(Compilation.CSourceFile).init(arena);
......@@ -150,7 +150,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
150150 }
151151 }
152152
153 try comp.build_crt_file("c", .Lib, .@"wasi libc.a", prog_node, libc_sources.items);
153 try comp.build_crt_file("c", .Lib, null, .@"wasi libc.a", prog_node, libc_sources.items);
154154 },
155155 .libwasi_emulated_process_clocks_a => {
156156 var args = std.ArrayList([]const u8).init(arena);
......@@ -167,7 +167,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
167167 .owner = undefined,
168168 });
169169 }
170 try comp.build_crt_file("wasi-emulated-process-clocks", .Lib, .@"libwasi-emulated-process-clocks.a", prog_node, emu_clocks_sources.items);
170 try comp.build_crt_file("wasi-emulated-process-clocks", .Lib, null, .@"libwasi-emulated-process-clocks.a", prog_node, emu_clocks_sources.items);
171171 },
172172 .libwasi_emulated_getpid_a => {
173173 var args = std.ArrayList([]const u8).init(arena);
......@@ -184,7 +184,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
184184 .owner = undefined,
185185 });
186186 }
187 try comp.build_crt_file("wasi-emulated-getpid", .Lib, .@"libwasi-emulated-getpid.a", prog_node, emu_getpid_sources.items);
187 try comp.build_crt_file("wasi-emulated-getpid", .Lib, null, .@"libwasi-emulated-getpid.a", prog_node, emu_getpid_sources.items);
188188 },
189189 .libwasi_emulated_mman_a => {
190190 var args = std.ArrayList([]const u8).init(arena);
......@@ -201,7 +201,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
201201 .owner = undefined,
202202 });
203203 }
204 try comp.build_crt_file("wasi-emulated-mman", .Lib, .@"libwasi-emulated-mman.a", prog_node, emu_mman_sources.items);
204 try comp.build_crt_file("wasi-emulated-mman", .Lib, null, .@"libwasi-emulated-mman.a", prog_node, emu_mman_sources.items);
205205 },
206206 .libwasi_emulated_signal_a => {
207207 var emu_signal_sources = std.ArrayList(Compilation.CSourceFile).init(arena);
......@@ -238,7 +238,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
238238 }
239239 }
240240
241 try comp.build_crt_file("wasi-emulated-signal", .Lib, .@"libwasi-emulated-signal.a", prog_node, emu_signal_sources.items);
241 try comp.build_crt_file("wasi-emulated-signal", .Lib, null, .@"libwasi-emulated-signal.a", prog_node, emu_signal_sources.items);
242242 },
243243 }
244244}
test/behavior/cast.zig+2-2
......@@ -124,7 +124,7 @@ test "@floatFromInt(f80)" {
124124 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
125125 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
126126 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
127 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
127 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
128128 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
129129 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
130130
......@@ -1362,7 +1362,7 @@ test "cast f16 to wider types" {
13621362 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
13631363 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13641364 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1365 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1365 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
13661366 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
13671367 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
13681368
test/behavior/eval.zig+1-1
......@@ -522,7 +522,7 @@ test "runtime 128 bit integer division" {
522522 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
523523 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
524524 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
525 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
525 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
526526 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
527527 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
528528
test/behavior/floatop.zig+7-7
......@@ -126,7 +126,7 @@ test "cmp f16" {
126126 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
127127 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
128128 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
129 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
129 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
130130
131131 try testCmp(f16);
132132 try comptime testCmp(f16);
......@@ -135,7 +135,7 @@ test "cmp f16" {
135135test "cmp f32/f64" {
136136 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
137137 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
138 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
138 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
139139
140140 try testCmp(f32);
141141 try comptime testCmp(f32);
......@@ -146,7 +146,7 @@ test "cmp f32/f64" {
146146test "cmp f128" {
147147 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
148148 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
149 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
149 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
150150 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
151151 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
152152 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
......@@ -1009,7 +1009,7 @@ test "@abs f32/f64" {
10091009test "@abs f80/f128/c_longdouble" {
10101010 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
10111011 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1012 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1012 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
10131013 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
10141014 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
10151015 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
......@@ -1134,7 +1134,7 @@ test "@floor f32/f64" {
11341134test "@floor f80/f128/c_longdouble" {
11351135 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
11361136 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1137 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1137 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
11381138 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
11391139 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
11401140 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
......@@ -1232,7 +1232,7 @@ test "@ceil f32/f64" {
12321232test "@ceil f80/f128/c_longdouble" {
12331233 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
12341234 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1235 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1235 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
12361236 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
12371237 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
12381238 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
......@@ -1330,7 +1330,7 @@ test "@trunc f32/f64" {
13301330test "@trunc f80/f128/c_longdouble" {
13311331 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
13321332 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1333 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1333 if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
13341334 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13351335 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
13361336 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
test/behavior/math.zig+7-7
......@@ -780,7 +780,7 @@ test "128-bit multiplication" {
780780 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
781781 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
782782 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
783 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
783 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
784784 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
785785
786786 {
......@@ -1369,7 +1369,7 @@ test "remainder division" {
13691369 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13701370 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
13711371 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
1372 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1372 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
13731373 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
13741374
13751375 if (builtin.zig_backend == .stage2_llvm and builtin.os.tag == .windows) {
......@@ -1522,7 +1522,7 @@ test "@round f80" {
15221522 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
15231523 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
15241524 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1525 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1525 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
15261526 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
15271527 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
15281528
......@@ -1535,7 +1535,7 @@ test "@round f128" {
15351535 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
15361536 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
15371537 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1538 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
1538 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
15391539 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
15401540 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
15411541
......@@ -1579,7 +1579,7 @@ test "NaN comparison" {
15791579 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
15801580 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
15811581 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1582 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
1582 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
15831583
15841584 try testNanEqNan(f16);
15851585 try testNanEqNan(f32);
......@@ -1735,7 +1735,7 @@ test "runtime comparison to NaN is comptime-known" {
17351735 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
17361736 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
17371737 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1738 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
1738 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
17391739
17401740 const S = struct {
17411741 fn doTheTest(comptime F: type, x: F) void {
......@@ -1766,7 +1766,7 @@ test "runtime int comparison to inf is comptime-known" {
17661766 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
17671767 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
17681768 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1769 if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
1769 if (builtin.cpu.arch.isArm() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
17701770
17711771 const S = struct {
17721772 fn doTheTest(comptime F: type, x: u32) void {
test/behavior/maximum_minimum.zig+1-1
......@@ -122,7 +122,7 @@ test "@min/max for floats" {
122122 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
123123 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
124124 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
125 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
125 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
126126 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
127127 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
128128
test/behavior/muladd.zig+4-4
......@@ -58,7 +58,7 @@ test "@mulAdd f80" {
5858 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
5959 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
6060 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
61 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
61 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
6262 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
6363 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
6464
......@@ -79,7 +79,7 @@ test "@mulAdd f128" {
7979 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
8080 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
8181 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
82 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
82 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
8383 if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
8484 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
8585
......@@ -189,7 +189,7 @@ test "vector f80" {
189189 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
190190 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
191191 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
192 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
192 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
193193 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
194194
195195 try comptime vector80();
......@@ -216,7 +216,7 @@ test "vector f128" {
216216 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
217217 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
218218 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
219 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
219 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
220220 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
221221
222222 try comptime vector128();
test/behavior/saturating_arithmetic.zig+2-2
......@@ -164,7 +164,7 @@ test "saturating multiplication <= 32 bits" {
164164 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
165165 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
166166 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
167 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
167 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
168168 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
169169
170170 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {
......@@ -264,7 +264,7 @@ test "saturating multiplication" {
264264 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
265265 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
266266 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
267 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
267 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
268268 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
269269
270270 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .wasm32) {
test/behavior/struct.zig+3-3
......@@ -419,7 +419,7 @@ test "packed struct 24bits" {
419419 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
420420 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
421421 if (builtin.cpu.arch == .wasm32) return error.SkipZigTest; // TODO
422 if (comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; // TODO
422 if (comptime builtin.cpu.arch.isArm()) return error.SkipZigTest; // TODO
423423 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
424424 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
425425
......@@ -818,7 +818,7 @@ test "non-packed struct with u128 entry in union" {
818818 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
819819 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
820820 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
821 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
821 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
822822 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
823823
824824 const U = union(enum) {
......@@ -941,7 +941,7 @@ test "tuple assigned to variable" {
941941
942942test "comptime struct field" {
943943 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
944 if (comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; // TODO
944 if (comptime builtin.cpu.arch.isArm()) return error.SkipZigTest; // TODO
945945
946946 const T = struct {
947947 a: i32,
test/behavior/vector.zig+2-2
......@@ -101,7 +101,7 @@ test "vector float operators" {
101101 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
102102 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
103103 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
104 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
104 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
105105 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
106106
107107 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
......@@ -753,7 +753,7 @@ test "vector reduce operation" {
753753 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
754754 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
755755 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
756 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
756 if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArm()) return error.SkipZigTest;
757757 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
758758 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21091
759759
test/c_abi/main.zig+3-3
......@@ -10,7 +10,7 @@ const builtin = @import("builtin");
1010const print = std.debug.print;
1111const expect = std.testing.expect;
1212const expectEqual = std.testing.expectEqual;
13const have_i128 = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isARM() and
13const have_i128 = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isArm() and
1414 !builtin.cpu.arch.isMIPS() and !builtin.cpu.arch.isPowerPC32();
1515
1616const have_f128 = builtin.cpu.arch.isX86() and !builtin.os.tag.isDarwin();
......@@ -181,7 +181,7 @@ extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat;
181181extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble;
182182
183183const complex_abi_compatible = builtin.cpu.arch != .x86 and !builtin.cpu.arch.isMIPS() and
184 !builtin.cpu.arch.isARM() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV();
184 !builtin.cpu.arch.isArm() and !builtin.cpu.arch.isPowerPC32() and !builtin.cpu.arch.isRISCV();
185185
186186test "C ABI complex float" {
187187 if (!complex_abi_compatible) return error.SkipZigTest;
......@@ -5553,7 +5553,7 @@ extern fn c_f16_struct(f16_struct) f16_struct;
55535553test "f16 struct" {
55545554 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest;
55555555 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest;
5556 if (builtin.cpu.arch.isARM() and builtin.mode != .Debug) return error.SkipZigTest;
5556 if (builtin.cpu.arch.isArm() and builtin.mode != .Debug) return error.SkipZigTest;
55575557
55585558 const a = c_f16_struct(.{ .a = 12 });
55595559 try expect(a.a == 34);
test/tests.zig+72-1
......@@ -28,6 +28,7 @@ const TestTarget = struct {
2828 use_lld: ?bool = null,
2929 pic: ?bool = null,
3030 strip: ?bool = null,
31 skip_modules: []const []const u8 = &.{},
3132
3233 // This is intended for targets that are known to be slow to compile. These are acceptable to
3334 // run in CI, but should not be run on developer machines by default. As an example, at the time
......@@ -337,6 +338,70 @@ const test_targets = blk: {
337338 .link_libc = true,
338339 },
339340
341 .{
342 .target = .{
343 .cpu_arch = .thumb,
344 .os_tag = .linux,
345 .abi = .eabi,
346 },
347 },
348 .{
349 .target = .{
350 .cpu_arch = .thumb,
351 .os_tag = .linux,
352 .abi = .eabihf,
353 },
354 },
355 .{
356 .target = .{
357 .cpu_arch = .thumb,
358 .os_tag = .linux,
359 .abi = .musleabi,
360 },
361 .link_libc = true,
362 .skip_modules = &.{"std"},
363 },
364 .{
365 .target = .{
366 .cpu_arch = .thumb,
367 .os_tag = .linux,
368 .abi = .musleabihf,
369 },
370 .link_libc = true,
371 .skip_modules = &.{"std"},
372 },
373 // Calls are normally lowered to branch instructions that only support +/- 16 MB range when
374 // targeting Thumb. This is not sufficient for the std test binary linked statically with
375 // musl, so use long calls to avoid out-of-range relocations.
376 .{
377 .target = std.Target.Query.parse(.{
378 .arch_os_abi = "thumb-linux-musleabi",
379 .cpu_features = "baseline+long_calls",
380 }) catch @panic("OOM"),
381 .link_libc = true,
382 .pic = false, // Long calls don't work with PIC.
383 .skip_modules = &.{
384 "behavior",
385 "c-import",
386 "compiler-rt",
387 "universal-libc",
388 },
389 },
390 .{
391 .target = std.Target.Query.parse(.{
392 .arch_os_abi = "thumb-linux-musleabihf",
393 .cpu_features = "baseline+long_calls",
394 }) catch @panic("OOM"),
395 .link_libc = true,
396 .pic = false, // Long calls don't work with PIC.
397 .skip_modules = &.{
398 "behavior",
399 "c-import",
400 "compiler-rt",
401 "universal-libc",
402 },
403 },
404
340405 .{
341406 .target = .{
342407 .cpu_arch = .mips,
......@@ -1225,7 +1290,13 @@ const ModuleTestOptions = struct {
12251290pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
12261291 const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc);
12271292
1228 for (test_targets) |test_target| {
1293 for_targets: for (test_targets) |test_target| {
1294 if (test_target.skip_modules.len > 0) {
1295 for (test_target.skip_modules) |skip_mod| {
1296 if (std.mem.eql(u8, options.name, skip_mod)) continue :for_targets;
1297 }
1298 }
1299
12291300 if (!options.test_slow_targets and test_target.slow_backend) continue;
12301301
12311302 if (options.skip_non_native and !test_target.target.isNative())