| author | |
| committer | |
| log | c3906718b343c20e4021e68e68a9c163a98c2741 |
| tree | bcdd69a2fd160842f5a72a7a054d8fae042b35ab |
| parent | 837e0f9c377d66f323926427551cc7db84a7151d |
| parent | 23cb2b26626dafacfc5e0b567a43b88e1a22fe18 |
| signature |
11 files changed, 378 insertions(+), 61 deletions(-)
lib/compiler/build_runner.zig+7-5| ... | ... | @@ -241,8 +241,9 @@ pub fn main() !void { |
| 241 | 241 | // but it is handled by the parent process. The build runner |
| 242 | 242 | // only sees this flag. |
| 243 | 243 | graph.system_package_mode = true; |
| 244 | } else if (mem.eql(u8, arg, "--glibc-runtimes")) { | |
| 245 | builder.glibc_runtimes_dir = nextArgOrFatal(args, &arg_idx); | |
| 244 | } else if (mem.eql(u8, arg, "--libc-runtimes") or mem.eql(u8, arg, "--glibc-runtimes")) { | |
| 245 | // --glibc-runtimes was the old name of the flag; kept for compatibility for now. | |
| 246 | builder.libc_runtimes_dir = nextArgOrFatal(args, &arg_idx); | |
| 246 | 247 | } else if (mem.eql(u8, arg, "--verbose-link")) { |
| 247 | 248 | builder.verbose_link = true; |
| 248 | 249 | } else if (mem.eql(u8, arg, "--verbose-air")) { |
| ... | ... | @@ -1279,9 +1280,10 @@ fn usage(b: *std.Build, out_stream: anytype) !void { |
| 1279 | 1280 | \\ -fqemu, -fno-qemu Integration with system-installed QEMU to execute |
| 1280 | 1281 | \\ foreign-architecture programs on Linux hosts |
| 1281 | 1282 | \\ (default: no) |
| 1282 | \\ --glibc-runtimes [path] Enhances QEMU integration by providing glibc built | |
| 1283 | \\ for multiple foreign architectures, allowing | |
| 1284 | \\ execution of non-native programs that link with glibc. | |
| 1283 | \\ --libc-runtimes [path] Enhances QEMU integration by providing dynamic libc | |
| 1284 | \\ (e.g. glibc or musl) built for multiple foreign | |
| 1285 | \\ architectures, allowing execution of non-native | |
| 1286 | \\ programs that link with libc. | |
| 1285 | 1287 | \\ -frosetta, -fno-rosetta Rely on Rosetta to execute x86_64 programs on |
| 1286 | 1288 | \\ ARM64 macOS hosts. (default: no) |
| 1287 | 1289 | \\ -fwasmtime, -fno-wasmtime Integration with system-installed wasmtime to |
lib/std/Build.zig+3-2| ... | ... | @@ -79,7 +79,8 @@ enable_wine: bool = false, |
| 79 | 79 | /// this will be the directory $glibc-build-dir/install/glibcs |
| 80 | 80 | /// Given the example of the aarch64 target, this is the directory |
| 81 | 81 | /// that contains the path `aarch64-linux-gnu/lib/ld-linux-aarch64.so.1`. |
| 82 | glibc_runtimes_dir: ?[]const u8 = null, | |
| 82 | /// Also works for dynamic musl. | |
| 83 | libc_runtimes_dir: ?[]const u8 = null, | |
| 83 | 84 | |
| 84 | 85 | dep_prefix: []const u8 = "", |
| 85 | 86 | |
| ... | ... | @@ -390,7 +391,7 @@ fn createChildOnly( |
| 390 | 391 | .enable_rosetta = parent.enable_rosetta, |
| 391 | 392 | .enable_wasmtime = parent.enable_wasmtime, |
| 392 | 393 | .enable_wine = parent.enable_wine, |
| 393 | .glibc_runtimes_dir = parent.glibc_runtimes_dir, | |
| 394 | .libc_runtimes_dir = parent.libc_runtimes_dir, | |
| 394 | 395 | .dep_prefix = parent.fmt("{s}{s}.", .{ parent.dep_prefix, dep_name }), |
| 395 | 396 | .modules = .init(allocator), |
| 396 | 397 | .named_writefiles = .init(allocator), |
lib/std/Build/Step/Run.zig+21-23| ... | ... | @@ -1026,11 +1026,11 @@ fn runCommand( |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | const root_target = exe.rootModuleTarget(); |
| 1029 | const need_cross_glibc = root_target.isGnuLibC() and | |
| 1030 | exe.is_linking_libc; | |
| 1029 | const need_cross_libc = exe.is_linking_libc and | |
| 1030 | (root_target.isGnuLibC() or (root_target.isMuslLibC() and exe.linkage == .dynamic)); | |
| 1031 | 1031 | const other_target = exe.root_module.resolved_target.?.result; |
| 1032 | 1032 | switch (std.zig.system.getExternalExecutor(b.graph.host.result, &other_target, .{ |
| 1033 | .qemu_fixes_dl = need_cross_glibc and b.glibc_runtimes_dir != null, | |
| 1033 | .qemu_fixes_dl = need_cross_libc and b.libc_runtimes_dir != null, | |
| 1034 | 1034 | .link_libc = exe.is_linking_libc, |
| 1035 | 1035 | })) { |
| 1036 | 1036 | .native, .rosetta => { |
| ... | ... | @@ -1047,31 +1047,29 @@ fn runCommand( |
| 1047 | 1047 | }, |
| 1048 | 1048 | .qemu => |bin_name| { |
| 1049 | 1049 | if (b.enable_qemu) { |
| 1050 | const glibc_dir_arg = if (need_cross_glibc) | |
| 1051 | b.glibc_runtimes_dir orelse | |
| 1052 | return failForeign(run, "--glibc-runtimes", argv[0], exe) | |
| 1053 | else | |
| 1054 | null; | |
| 1055 | ||
| 1056 | 1050 | try interp_argv.append(bin_name); |
| 1057 | 1051 | |
| 1058 | if (glibc_dir_arg) |dir| { | |
| 1059 | try interp_argv.append("-L"); | |
| 1060 | try interp_argv.append(b.pathJoin(&.{ | |
| 1061 | dir, | |
| 1062 | try std.zig.target.glibcRuntimeTriple( | |
| 1063 | b.allocator, | |
| 1064 | root_target.cpu.arch, | |
| 1065 | root_target.os.tag, | |
| 1066 | root_target.abi, | |
| 1067 | ), | |
| 1068 | })); | |
| 1052 | if (need_cross_libc) { | |
| 1053 | if (b.libc_runtimes_dir) |dir| { | |
| 1054 | try interp_argv.append("-L"); | |
| 1055 | try interp_argv.append(b.pathJoin(&.{ | |
| 1056 | dir, | |
| 1057 | try if (root_target.isGnuLibC()) std.zig.target.glibcRuntimeTriple( | |
| 1058 | b.allocator, | |
| 1059 | root_target.cpu.arch, | |
| 1060 | root_target.os.tag, | |
| 1061 | root_target.abi, | |
| 1062 | ) else if (root_target.isMuslLibC()) std.zig.target.muslRuntimeTriple( | |
| 1063 | b.allocator, | |
| 1064 | root_target.cpu.arch, | |
| 1065 | root_target.abi, | |
| 1066 | ) else unreachable, | |
| 1067 | })); | |
| 1068 | } else return failForeign(run, "--libc-runtimes", argv[0], exe); | |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | try interp_argv.appendSlice(argv); |
| 1072 | } else { | |
| 1073 | return failForeign(run, "-fqemu", argv[0], exe); | |
| 1074 | } | |
| 1072 | } else return failForeign(run, "-fqemu", argv[0], exe); | |
| 1075 | 1073 | }, |
| 1076 | 1074 | .darling => |bin_name| { |
| 1077 | 1075 | if (b.enable_darling) { |
lib/std/Target.zig+10-28| ... | ... | @@ -838,7 +838,6 @@ pub const Abi = enum { |
| 838 | 838 | .aix => if (arch == .powerpc) .eabihf else .none, |
| 839 | 839 | .haiku => switch (arch) { |
| 840 | 840 | .arm, |
| 841 | .thumb, | |
| 842 | 841 | .powerpc, |
| 843 | 842 | => .eabihf, |
| 844 | 843 | else => .none, |
| ... | ... | @@ -877,22 +876,13 @@ pub const Abi = enum { |
| 877 | 876 | }, |
| 878 | 877 | .freebsd => switch (arch) { |
| 879 | 878 | .arm, |
| 880 | .armeb, | |
| 881 | .thumb, | |
| 882 | .thumbeb, | |
| 883 | 879 | .powerpc, |
| 884 | 880 | => .eabihf, |
| 885 | // Soft float tends to be more common for MIPS. | |
| 886 | .mips, | |
| 887 | .mipsel, | |
| 888 | => .eabi, | |
| 889 | 881 | else => .none, |
| 890 | 882 | }, |
| 891 | 883 | .netbsd => switch (arch) { |
| 892 | 884 | .arm, |
| 893 | 885 | .armeb, |
| 894 | .thumb, | |
| 895 | .thumbeb, | |
| 896 | 886 | .powerpc, |
| 897 | 887 | => .eabihf, |
| 898 | 888 | // Soft float tends to be more common for MIPS. |
| ... | ... | @@ -903,7 +893,6 @@ pub const Abi = enum { |
| 903 | 893 | }, |
| 904 | 894 | .openbsd => switch (arch) { |
| 905 | 895 | .arm, |
| 906 | .thumb, | |
| 907 | 896 | => .eabi, |
| 908 | 897 | .powerpc, |
| 909 | 898 | => .eabihf, |
| ... | ... | @@ -2205,7 +2194,6 @@ pub const DynamicLinker = struct { |
| 2205 | 2194 | |
| 2206 | 2195 | .haiku => switch (cpu.arch) { |
| 2207 | 2196 | .arm, |
| 2208 | .thumb, | |
| 2209 | 2197 | .aarch64, |
| 2210 | 2198 | .m68k, |
| 2211 | 2199 | .powerpc, |
| ... | ... | @@ -2234,9 +2222,7 @@ pub const DynamicLinker = struct { |
| 2234 | 2222 | |
| 2235 | 2223 | .linux => if (abi.isAndroid()) |
| 2236 | 2224 | switch (cpu.arch) { |
| 2237 | .arm, | |
| 2238 | .thumb, | |
| 2239 | => if (abi == .androideabi) init("/system/bin/linker") else none, | |
| 2225 | .arm => if (abi == .androideabi) init("/system/bin/linker") else none, | |
| 2240 | 2226 | |
| 2241 | 2227 | .aarch64, |
| 2242 | 2228 | .riscv64, |
| ... | ... | @@ -2454,19 +2440,11 @@ pub const DynamicLinker = struct { |
| 2454 | 2440 | |
| 2455 | 2441 | .freebsd => switch (cpu.arch) { |
| 2456 | 2442 | .arm, |
| 2457 | .armeb, | |
| 2458 | .thumb, | |
| 2459 | .thumbeb, | |
| 2460 | 2443 | .aarch64, |
| 2461 | .mips, | |
| 2462 | .mipsel, | |
| 2463 | .mips64, | |
| 2464 | .mips64el, | |
| 2465 | 2444 | .powerpc, |
| 2466 | 2445 | .powerpc64, |
| 2467 | 2446 | .powerpc64le, |
| 2468 | 2447 | .riscv64, |
| 2469 | .sparc64, | |
| 2470 | 2448 | .x86, |
| 2471 | 2449 | .x86_64, |
| 2472 | 2450 | => initFmt("{s}/libexec/ld-elf.so.1", .{ |
| ... | ... | @@ -2481,8 +2459,6 @@ pub const DynamicLinker = struct { |
| 2481 | 2459 | .netbsd => switch (cpu.arch) { |
| 2482 | 2460 | .arm, |
| 2483 | 2461 | .armeb, |
| 2484 | .thumb, | |
| 2485 | .thumbeb, | |
| 2486 | 2462 | .aarch64, |
| 2487 | 2463 | .aarch64_be, |
| 2488 | 2464 | .m68k, |
| ... | ... | @@ -2491,6 +2467,8 @@ pub const DynamicLinker = struct { |
| 2491 | 2467 | .mips64, |
| 2492 | 2468 | .mips64el, |
| 2493 | 2469 | .powerpc, |
| 2470 | .powerpc64, | |
| 2471 | .riscv32, | |
| 2494 | 2472 | .riscv64, |
| 2495 | 2473 | .sparc, |
| 2496 | 2474 | .sparc64, |
| ... | ... | @@ -2502,7 +2480,6 @@ pub const DynamicLinker = struct { |
| 2502 | 2480 | |
| 2503 | 2481 | .openbsd => switch (cpu.arch) { |
| 2504 | 2482 | .arm, |
| 2505 | .thumb, | |
| 2506 | 2483 | .aarch64, |
| 2507 | 2484 | .mips64, |
| 2508 | 2485 | .mips64el, |
| ... | ... | @@ -2530,11 +2507,16 @@ pub const DynamicLinker = struct { |
| 2530 | 2507 | }, |
| 2531 | 2508 | |
| 2532 | 2509 | .illumos, |
| 2510 | => switch (cpu.arch) { | |
| 2511 | .x86, | |
| 2512 | .x86_64, | |
| 2513 | => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}), | |
| 2514 | else => none, | |
| 2515 | }, | |
| 2516 | ||
| 2533 | 2517 | .solaris, |
| 2534 | 2518 | => switch (cpu.arch) { |
| 2535 | .sparc, | |
| 2536 | 2519 | .sparc64, |
| 2537 | .x86, | |
| 2538 | 2520 | .x86_64, |
| 2539 | 2521 | => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}), |
| 2540 | 2522 | else => none, |
lib/std/fs/test.zig+1| ... | ... | @@ -1394,6 +1394,7 @@ test "pwritev, preadv" { |
| 1394 | 1394 | test "setEndPos" { |
| 1395 | 1395 | // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission) |
| 1396 | 1396 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 1397 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23806 | |
| 1397 | 1398 | |
| 1398 | 1399 | var tmp = tmpDir(.{}); |
| 1399 | 1400 | defer tmp.cleanup(); |
lib/std/hash/xxhash.zig+3| ... | ... | @@ -781,6 +781,7 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64) |
| 781 | 781 | |
| 782 | 782 | test "xxhash3" { |
| 783 | 783 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 784 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 | |
| 784 | 785 | |
| 785 | 786 | const H = XxHash3; |
| 786 | 787 | // Non-Seeded Tests |
| ... | ... | @@ -814,6 +815,7 @@ test "xxhash3" { |
| 814 | 815 | |
| 815 | 816 | test "xxhash3 smhasher" { |
| 816 | 817 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 818 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 | |
| 817 | 819 | |
| 818 | 820 | const Test = struct { |
| 819 | 821 | fn do() !void { |
| ... | ... | @@ -827,6 +829,7 @@ test "xxhash3 smhasher" { |
| 827 | 829 | |
| 828 | 830 | test "xxhash3 iterative api" { |
| 829 | 831 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 832 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 | |
| 830 | 833 | |
| 831 | 834 | const Test = struct { |
| 832 | 835 | fn do() !void { |
lib/std/os/linux/test.zig+2| ... | ... | @@ -8,6 +8,8 @@ const expectEqual = std.testing.expectEqual; |
| 8 | 8 | const fs = std.fs; |
| 9 | 9 | |
| 10 | 10 | test "fallocate" { |
| 11 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23809 | |
| 12 | ||
| 11 | 13 | var tmp = std.testing.tmpDir(.{}); |
| 12 | 14 | defer tmp.cleanup(); |
| 13 | 15 |
lib/std/posix/test.zig+2| ... | ... | @@ -1391,6 +1391,8 @@ fn expectMode(dir: posix.fd_t, file: []const u8, mode: posix.mode_t) !void { |
| 1391 | 1391 | } |
| 1392 | 1392 | |
| 1393 | 1393 | test "fchmodat smoke test" { |
| 1394 | if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23808 | |
| 1395 | ||
| 1394 | 1396 | if (!std.fs.has_executable_bit) return error.SkipZigTest; |
| 1395 | 1397 | |
| 1396 | 1398 | var tmp = tmpDir(.{}); |
lib/std/zig/target.zig+14| ... | ... | @@ -131,6 +131,20 @@ pub fn glibcRuntimeTriple( |
| 131 | 131 | }; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | /// Returns the subdirectory triple to be used to find the correct musl for the given `arch` and | |
| 135 | /// `abi` in an installation directory. | |
| 136 | /// | |
| 137 | /// `abi` must be a musl ABI, i.e. `.isMusl()`. | |
| 138 | pub fn muslRuntimeTriple( | |
| 139 | allocator: Allocator, | |
| 140 | arch: std.Target.Cpu.Arch, | |
| 141 | abi: std.Target.Abi, | |
| 142 | ) Allocator.Error![]const u8 { | |
| 143 | assert(abi.isMusl()); | |
| 144 | ||
| 145 | return std.Target.linuxTripleSimple(allocator, arch, .linux, abi); | |
| 146 | } | |
| 147 | ||
| 134 | 148 | pub fn osArchName(target: std.Target) [:0]const u8 { |
| 135 | 149 | return switch (target.os.tag) { |
| 136 | 150 | .linux => switch (target.cpu.arch) { |
test/behavior/basic.zig+1| ... | ... | @@ -1204,6 +1204,7 @@ test "arrays and vectors with big integers" { |
| 1204 | 1204 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 1205 | 1205 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1206 | 1206 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1207 | if (builtin.zig_backend == .stage2_llvm and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23805 | |
| 1207 | 1208 | |
| 1208 | 1209 | inline for (.{ u65528, u65529, u65535 }) |Int| { |
| 1209 | 1210 | var a: [1]Int = undefined; |
test/tests.zig+314-3| ... | ... | @@ -20,6 +20,7 @@ pub const StackTracesContext = @import("src/StackTrace.zig"); |
| 20 | 20 | pub const DebuggerContext = @import("src/Debugger.zig"); |
| 21 | 21 | |
| 22 | 22 | const TestTarget = struct { |
| 23 | linkage: ?std.builtin.LinkMode = null, | |
| 23 | 24 | target: std.Target.Query = .{}, |
| 24 | 25 | optimize_mode: std.builtin.OptimizeMode = .Debug, |
| 25 | 26 | link_libc: ?bool = null, |
| ... | ... | @@ -30,8 +31,9 @@ const TestTarget = struct { |
| 30 | 31 | strip: ?bool = null, |
| 31 | 32 | skip_modules: []const []const u8 = &.{}, |
| 32 | 33 | |
| 33 | // This is intended for targets that are known to be slow to compile, or require a newer LLVM | |
| 34 | // version than is present on the CI machines, etc. | |
| 34 | // This is intended for targets that, for any reason, shouldn't be run as part of a normal test | |
| 35 | // invocation. This could be because of a slow backend, requiring a newer LLVM version, being | |
| 36 | // too niche, etc. | |
| 35 | 37 | extra_target: bool = false, |
| 36 | 38 | }; |
| 37 | 39 | |
| ... | ... | @@ -240,6 +242,15 @@ const test_targets = blk: { |
| 240 | 242 | }, |
| 241 | 243 | .link_libc = true, |
| 242 | 244 | }, |
| 245 | .{ | |
| 246 | .target = .{ | |
| 247 | .cpu_arch = .x86_64, | |
| 248 | .os_tag = .linux, | |
| 249 | .abi = .musl, | |
| 250 | }, | |
| 251 | .linkage = .dynamic, | |
| 252 | .link_libc = true, | |
| 253 | }, | |
| 243 | 254 | .{ |
| 244 | 255 | .target = .{ |
| 245 | 256 | .cpu_arch = .x86_64, |
| ... | ... | @@ -248,6 +259,16 @@ const test_targets = blk: { |
| 248 | 259 | }, |
| 249 | 260 | .link_libc = true, |
| 250 | 261 | }, |
| 262 | .{ | |
| 263 | .target = .{ | |
| 264 | .cpu_arch = .x86_64, | |
| 265 | .os_tag = .linux, | |
| 266 | .abi = .muslx32, | |
| 267 | }, | |
| 268 | .linkage = .dynamic, | |
| 269 | .link_libc = true, | |
| 270 | .extra_target = true, | |
| 271 | }, | |
| 251 | 272 | .{ |
| 252 | 273 | .target = .{ |
| 253 | 274 | .cpu_arch = .x86_64, |
| ... | ... | @@ -273,6 +294,17 @@ const test_targets = blk: { |
| 273 | 294 | }, |
| 274 | 295 | .link_libc = true, |
| 275 | 296 | }, |
| 297 | // https://github.com/ziglang/zig/issues/7935 | |
| 298 | // .{ | |
| 299 | // .target = .{ | |
| 300 | // .cpu_arch = .x86, | |
| 301 | // .os_tag = .linux, | |
| 302 | // .abi = .musl, | |
| 303 | // }, | |
| 304 | // .linkage = .dynamic, | |
| 305 | // .link_libc = true, | |
| 306 | // .extra_target = true, | |
| 307 | // }, | |
| 276 | 308 | .{ |
| 277 | 309 | .target = .{ |
| 278 | 310 | .cpu_arch = .x86, |
| ... | ... | @@ -297,6 +329,15 @@ const test_targets = blk: { |
| 297 | 329 | }, |
| 298 | 330 | .link_libc = true, |
| 299 | 331 | }, |
| 332 | .{ | |
| 333 | .target = .{ | |
| 334 | .cpu_arch = .aarch64, | |
| 335 | .os_tag = .linux, | |
| 336 | .abi = .musl, | |
| 337 | }, | |
| 338 | .linkage = .dynamic, | |
| 339 | .link_libc = true, | |
| 340 | }, | |
| 300 | 341 | .{ |
| 301 | 342 | .target = .{ |
| 302 | 343 | .cpu_arch = .aarch64, |
| ... | ... | @@ -329,6 +370,16 @@ const test_targets = blk: { |
| 329 | 370 | }, |
| 330 | 371 | .link_libc = true, |
| 331 | 372 | }, |
| 373 | .{ | |
| 374 | .target = .{ | |
| 375 | .cpu_arch = .aarch64_be, | |
| 376 | .os_tag = .linux, | |
| 377 | .abi = .musl, | |
| 378 | }, | |
| 379 | .linkage = .dynamic, | |
| 380 | .link_libc = true, | |
| 381 | .extra_target = true, | |
| 382 | }, | |
| 332 | 383 | .{ |
| 333 | 384 | .target = .{ |
| 334 | 385 | .cpu_arch = .aarch64_be, |
| ... | ... | @@ -360,6 +411,17 @@ const test_targets = blk: { |
| 360 | 411 | }, |
| 361 | 412 | .link_libc = true, |
| 362 | 413 | }, |
| 414 | // Crashes in weird ways when applying relocations. | |
| 415 | // .{ | |
| 416 | // .target = .{ | |
| 417 | // .cpu_arch = .arm, | |
| 418 | // .os_tag = .linux, | |
| 419 | // .abi = .musleabi, | |
| 420 | // }, | |
| 421 | // .linkage = .dynamic, | |
| 422 | // .link_libc = true, | |
| 423 | // .extra_target = true, | |
| 424 | // }, | |
| 363 | 425 | .{ |
| 364 | 426 | .target = .{ |
| 365 | 427 | .cpu_arch = .arm, |
| ... | ... | @@ -368,6 +430,17 @@ const test_targets = blk: { |
| 368 | 430 | }, |
| 369 | 431 | .link_libc = true, |
| 370 | 432 | }, |
| 433 | // Crashes in weird ways when applying relocations. | |
| 434 | // .{ | |
| 435 | // .target = .{ | |
| 436 | // .cpu_arch = .arm, | |
| 437 | // .os_tag = .linux, | |
| 438 | // .abi = .musleabihf, | |
| 439 | // }, | |
| 440 | // .linkage = .dynamic, | |
| 441 | // .link_libc = true, | |
| 442 | // .extra_target = true, | |
| 443 | // }, | |
| 371 | 444 | .{ |
| 372 | 445 | .target = .{ |
| 373 | 446 | .cpu_arch = .arm, |
| ... | ... | @@ -407,6 +480,17 @@ const test_targets = blk: { |
| 407 | 480 | }, |
| 408 | 481 | .link_libc = true, |
| 409 | 482 | }, |
| 483 | // Crashes in weird ways when applying relocations. | |
| 484 | // .{ | |
| 485 | // .target = .{ | |
| 486 | // .cpu_arch = .armeb, | |
| 487 | // .os_tag = .linux, | |
| 488 | // .abi = .musleabi, | |
| 489 | // }, | |
| 490 | // .linkage = .dynamic, | |
| 491 | // .link_libc = true, | |
| 492 | // .extra_target = true, | |
| 493 | // }, | |
| 410 | 494 | .{ |
| 411 | 495 | .target = .{ |
| 412 | 496 | .cpu_arch = .armeb, |
| ... | ... | @@ -415,6 +499,17 @@ const test_targets = blk: { |
| 415 | 499 | }, |
| 416 | 500 | .link_libc = true, |
| 417 | 501 | }, |
| 502 | // Crashes in weird ways when applying relocations. | |
| 503 | // .{ | |
| 504 | // .target = .{ | |
| 505 | // .cpu_arch = .armeb, | |
| 506 | // .os_tag = .linux, | |
| 507 | // .abi = .musleabihf, | |
| 508 | // }, | |
| 509 | // .linkage = .dynamic, | |
| 510 | // .link_libc = true, | |
| 511 | // .extra_target = true, | |
| 512 | // }, | |
| 418 | 513 | .{ |
| 419 | 514 | .target = .{ |
| 420 | 515 | .cpu_arch = .armeb, |
| ... | ... | @@ -516,6 +611,19 @@ const test_targets = blk: { |
| 516 | 611 | // https://github.com/llvm/llvm-project/pull/111217 |
| 517 | 612 | .skip_modules = &.{"std"}, |
| 518 | 613 | }, |
| 614 | // Currently crashes in qemu-hexagon. | |
| 615 | // .{ | |
| 616 | // .target = .{ | |
| 617 | // .cpu_arch = .hexagon, | |
| 618 | // .os_tag = .linux, | |
| 619 | // .abi = .musl, | |
| 620 | // }, | |
| 621 | // .linkage = .dynamic, | |
| 622 | // .link_libc = true, | |
| 623 | // // https://github.com/llvm/llvm-project/pull/111217 | |
| 624 | // .skip_modules = &.{"std"}, | |
| 625 | // .extra_target = true, | |
| 626 | // }, | |
| 519 | 627 | |
| 520 | 628 | .{ |
| 521 | 629 | .target = .{ |
| ... | ... | @@ -534,6 +642,17 @@ const test_targets = blk: { |
| 534 | 642 | .link_libc = true, |
| 535 | 643 | .skip_modules = &.{"std"}, |
| 536 | 644 | }, |
| 645 | .{ | |
| 646 | .target = .{ | |
| 647 | .cpu_arch = .loongarch64, | |
| 648 | .os_tag = .linux, | |
| 649 | .abi = .musl, | |
| 650 | }, | |
| 651 | .linkage = .dynamic, | |
| 652 | .link_libc = true, | |
| 653 | .skip_modules = &.{"std"}, | |
| 654 | .extra_target = true, | |
| 655 | }, | |
| 537 | 656 | .{ |
| 538 | 657 | .target = .{ |
| 539 | 658 | .cpu_arch = .loongarch64, |
| ... | ... | @@ -566,6 +685,16 @@ const test_targets = blk: { |
| 566 | 685 | }, |
| 567 | 686 | .link_libc = true, |
| 568 | 687 | }, |
| 688 | .{ | |
| 689 | .target = .{ | |
| 690 | .cpu_arch = .mips, | |
| 691 | .os_tag = .linux, | |
| 692 | .abi = .musleabi, | |
| 693 | }, | |
| 694 | .linkage = .dynamic, | |
| 695 | .link_libc = true, | |
| 696 | .extra_target = true, | |
| 697 | }, | |
| 569 | 698 | .{ |
| 570 | 699 | .target = .{ |
| 571 | 700 | .cpu_arch = .mips, |
| ... | ... | @@ -574,6 +703,16 @@ const test_targets = blk: { |
| 574 | 703 | }, |
| 575 | 704 | .link_libc = true, |
| 576 | 705 | }, |
| 706 | .{ | |
| 707 | .target = .{ | |
| 708 | .cpu_arch = .mips, | |
| 709 | .os_tag = .linux, | |
| 710 | .abi = .musleabihf, | |
| 711 | }, | |
| 712 | .linkage = .dynamic, | |
| 713 | .link_libc = true, | |
| 714 | .extra_target = true, | |
| 715 | }, | |
| 577 | 716 | .{ |
| 578 | 717 | .target = .{ |
| 579 | 718 | .cpu_arch = .mips, |
| ... | ... | @@ -613,13 +752,33 @@ const test_targets = blk: { |
| 613 | 752 | }, |
| 614 | 753 | .link_libc = true, |
| 615 | 754 | }, |
| 755 | .{ | |
| 756 | .target = .{ | |
| 757 | .cpu_arch = .mipsel, | |
| 758 | .os_tag = .linux, | |
| 759 | .abi = .musleabi, | |
| 760 | }, | |
| 761 | .linkage = .dynamic, | |
| 762 | .link_libc = true, | |
| 763 | .extra_target = true, | |
| 764 | }, | |
| 765 | .{ | |
| 766 | .target = .{ | |
| 767 | .cpu_arch = .mipsel, | |
| 768 | .os_tag = .linux, | |
| 769 | .abi = .musleabihf, | |
| 770 | }, | |
| 771 | .link_libc = true, | |
| 772 | }, | |
| 616 | 773 | .{ |
| 617 | 774 | .target = .{ |
| 618 | 775 | .cpu_arch = .mipsel, |
| 619 | 776 | .os_tag = .linux, |
| 620 | 777 | .abi = .musleabihf, |
| 621 | 778 | }, |
| 779 | .linkage = .dynamic, | |
| 622 | 780 | .link_libc = true, |
| 781 | .extra_target = true, | |
| 623 | 782 | }, |
| 624 | 783 | .{ |
| 625 | 784 | .target = .{ |
| ... | ... | @@ -653,6 +812,34 @@ const test_targets = blk: { |
| 653 | 812 | }, |
| 654 | 813 | .link_libc = true, |
| 655 | 814 | }, |
| 815 | .{ | |
| 816 | .target = .{ | |
| 817 | .cpu_arch = .mips64, | |
| 818 | .os_tag = .linux, | |
| 819 | .abi = .muslabi64, | |
| 820 | }, | |
| 821 | .linkage = .dynamic, | |
| 822 | .link_libc = true, | |
| 823 | .extra_target = true, | |
| 824 | }, | |
| 825 | .{ | |
| 826 | .target = .{ | |
| 827 | .cpu_arch = .mips64, | |
| 828 | .os_tag = .linux, | |
| 829 | .abi = .muslabin32, | |
| 830 | }, | |
| 831 | .link_libc = true, | |
| 832 | }, | |
| 833 | .{ | |
| 834 | .target = .{ | |
| 835 | .cpu_arch = .mips64, | |
| 836 | .os_tag = .linux, | |
| 837 | .abi = .muslabin32, | |
| 838 | }, | |
| 839 | .linkage = .dynamic, | |
| 840 | .link_libc = true, | |
| 841 | .extra_target = true, | |
| 842 | }, | |
| 656 | 843 | .{ |
| 657 | 844 | .target = .{ |
| 658 | 845 | .cpu_arch = .mips64, |
| ... | ... | @@ -661,6 +848,14 @@ const test_targets = blk: { |
| 661 | 848 | }, |
| 662 | 849 | .link_libc = true, |
| 663 | 850 | }, |
| 851 | .{ | |
| 852 | .target = .{ | |
| 853 | .cpu_arch = .mips64, | |
| 854 | .os_tag = .linux, | |
| 855 | .abi = .gnuabin32, | |
| 856 | }, | |
| 857 | .link_libc = true, | |
| 858 | }, | |
| 664 | 859 | |
| 665 | 860 | .{ |
| 666 | 861 | .target = .{ |
| ... | ... | @@ -677,6 +872,34 @@ const test_targets = blk: { |
| 677 | 872 | }, |
| 678 | 873 | .link_libc = true, |
| 679 | 874 | }, |
| 875 | .{ | |
| 876 | .target = .{ | |
| 877 | .cpu_arch = .mips64el, | |
| 878 | .os_tag = .linux, | |
| 879 | .abi = .muslabi64, | |
| 880 | }, | |
| 881 | .linkage = .dynamic, | |
| 882 | .link_libc = true, | |
| 883 | .extra_target = true, | |
| 884 | }, | |
| 885 | .{ | |
| 886 | .target = .{ | |
| 887 | .cpu_arch = .mips64el, | |
| 888 | .os_tag = .linux, | |
| 889 | .abi = .muslabin32, | |
| 890 | }, | |
| 891 | .link_libc = true, | |
| 892 | }, | |
| 893 | .{ | |
| 894 | .target = .{ | |
| 895 | .cpu_arch = .mips64el, | |
| 896 | .os_tag = .linux, | |
| 897 | .abi = .muslabin32, | |
| 898 | }, | |
| 899 | .linkage = .dynamic, | |
| 900 | .link_libc = true, | |
| 901 | .extra_target = true, | |
| 902 | }, | |
| 680 | 903 | .{ |
| 681 | 904 | .target = .{ |
| 682 | 905 | .cpu_arch = .mips64el, |
| ... | ... | @@ -685,6 +908,14 @@ const test_targets = blk: { |
| 685 | 908 | }, |
| 686 | 909 | .link_libc = true, |
| 687 | 910 | }, |
| 911 | .{ | |
| 912 | .target = .{ | |
| 913 | .cpu_arch = .mips64el, | |
| 914 | .os_tag = .linux, | |
| 915 | .abi = .gnuabin32, | |
| 916 | }, | |
| 917 | .link_libc = true, | |
| 918 | }, | |
| 688 | 919 | |
| 689 | 920 | .{ |
| 690 | 921 | .target = .{ |
| ... | ... | @@ -708,13 +939,37 @@ const test_targets = blk: { |
| 708 | 939 | }, |
| 709 | 940 | .link_libc = true, |
| 710 | 941 | }, |
| 942 | .{ | |
| 943 | .target = .{ | |
| 944 | .cpu_arch = .powerpc, | |
| 945 | .os_tag = .linux, | |
| 946 | .abi = .musleabi, | |
| 947 | }, | |
| 948 | .linkage = .dynamic, | |
| 949 | .link_libc = true, | |
| 950 | // https://github.com/ziglang/zig/issues/2256 | |
| 951 | .skip_modules = &.{"std"}, | |
| 952 | .extra_target = true, | |
| 953 | }, | |
| 954 | .{ | |
| 955 | .target = .{ | |
| 956 | .cpu_arch = .powerpc, | |
| 957 | .os_tag = .linux, | |
| 958 | .abi = .musleabihf, | |
| 959 | }, | |
| 960 | .link_libc = true, | |
| 961 | }, | |
| 711 | 962 | .{ |
| 712 | 963 | .target = .{ |
| 713 | 964 | .cpu_arch = .powerpc, |
| 714 | 965 | .os_tag = .linux, |
| 715 | 966 | .abi = .musleabihf, |
| 716 | 967 | }, |
| 968 | .linkage = .dynamic, | |
| 717 | 969 | .link_libc = true, |
| 970 | // https://github.com/ziglang/zig/issues/2256 | |
| 971 | .skip_modules = &.{"std"}, | |
| 972 | .extra_target = true, | |
| 718 | 973 | }, |
| 719 | 974 | .{ |
| 720 | 975 | .target = .{ |
| ... | ... | @@ -752,6 +1007,16 @@ const test_targets = blk: { |
| 752 | 1007 | }, |
| 753 | 1008 | .link_libc = true, |
| 754 | 1009 | }, |
| 1010 | .{ | |
| 1011 | .target = .{ | |
| 1012 | .cpu_arch = .powerpc64, | |
| 1013 | .os_tag = .linux, | |
| 1014 | .abi = .musl, | |
| 1015 | }, | |
| 1016 | .linkage = .dynamic, | |
| 1017 | .link_libc = true, | |
| 1018 | .extra_target = true, | |
| 1019 | }, | |
| 755 | 1020 | // Requires ELFv1 linker support. |
| 756 | 1021 | // .{ |
| 757 | 1022 | // .target = .{ |
| ... | ... | @@ -776,6 +1041,16 @@ const test_targets = blk: { |
| 776 | 1041 | }, |
| 777 | 1042 | .link_libc = true, |
| 778 | 1043 | }, |
| 1044 | .{ | |
| 1045 | .target = .{ | |
| 1046 | .cpu_arch = .powerpc64le, | |
| 1047 | .os_tag = .linux, | |
| 1048 | .abi = .musl, | |
| 1049 | }, | |
| 1050 | .linkage = .dynamic, | |
| 1051 | .link_libc = true, | |
| 1052 | .extra_target = true, | |
| 1053 | }, | |
| 779 | 1054 | .{ |
| 780 | 1055 | .target = .{ |
| 781 | 1056 | .cpu_arch = .powerpc64le, |
| ... | ... | @@ -814,6 +1089,16 @@ const test_targets = blk: { |
| 814 | 1089 | }, |
| 815 | 1090 | .link_libc = true, |
| 816 | 1091 | }, |
| 1092 | .{ | |
| 1093 | .target = .{ | |
| 1094 | .cpu_arch = .riscv32, | |
| 1095 | .os_tag = .linux, | |
| 1096 | .abi = .musl, | |
| 1097 | }, | |
| 1098 | .linkage = .dynamic, | |
| 1099 | .link_libc = true, | |
| 1100 | .extra_target = true, | |
| 1101 | }, | |
| 817 | 1102 | .{ |
| 818 | 1103 | .target = .{ |
| 819 | 1104 | .cpu_arch = .riscv32, |
| ... | ... | @@ -852,6 +1137,16 @@ const test_targets = blk: { |
| 852 | 1137 | }, |
| 853 | 1138 | .link_libc = true, |
| 854 | 1139 | }, |
| 1140 | .{ | |
| 1141 | .target = .{ | |
| 1142 | .cpu_arch = .riscv64, | |
| 1143 | .os_tag = .linux, | |
| 1144 | .abi = .musl, | |
| 1145 | }, | |
| 1146 | .linkage = .dynamic, | |
| 1147 | .link_libc = true, | |
| 1148 | .extra_target = true, | |
| 1149 | }, | |
| 855 | 1150 | .{ |
| 856 | 1151 | .target = .{ |
| 857 | 1152 | .cpu_arch = .riscv64, |
| ... | ... | @@ -885,6 +1180,17 @@ const test_targets = blk: { |
| 885 | 1180 | }, |
| 886 | 1181 | .link_libc = true, |
| 887 | 1182 | }, |
| 1183 | // Currently hangs in qemu-s390x. | |
| 1184 | // .{ | |
| 1185 | // .target = .{ | |
| 1186 | // .cpu_arch = .s390x, | |
| 1187 | // .os_tag = .linux, | |
| 1188 | // .abi = .musl, | |
| 1189 | // }, | |
| 1190 | // .linkage = .dynamic, | |
| 1191 | // .link_libc = true, | |
| 1192 | // .extra_target = true, | |
| 1193 | // }, | |
| 888 | 1194 | .{ |
| 889 | 1195 | .target = .{ |
| 890 | 1196 | .cpu_arch = .s390x, |
| ... | ... | @@ -1518,6 +1824,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1518 | 1824 | .use_lld = test_target.use_lld, |
| 1519 | 1825 | .zig_lib_dir = b.path("lib"), |
| 1520 | 1826 | }); |
| 1827 | these_tests.linkage = test_target.linkage; | |
| 1521 | 1828 | if (options.no_builtin) these_tests.no_builtin = true; |
| 1522 | 1829 | if (options.build_options) |build_options| { |
| 1523 | 1830 | these_tests.root_module.addOptions("build_options", build_options); |
| ... | ... | @@ -1532,11 +1839,14 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1532 | 1839 | else |
| 1533 | 1840 | ""; |
| 1534 | 1841 | const use_lld = if (test_target.use_lld == false) "-no-lld" else ""; |
| 1842 | const linkage_name = if (test_target.linkage) |linkage| switch (linkage) { | |
| 1843 | inline else => |t| "-" ++ @tagName(t), | |
| 1844 | } else ""; | |
| 1535 | 1845 | const use_pic = if (test_target.pic == true) "-pic" else ""; |
| 1536 | 1846 | |
| 1537 | 1847 | for (options.include_paths) |include_path| these_tests.addIncludePath(b.path(include_path)); |
| 1538 | 1848 | |
| 1539 | const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{ | |
| 1849 | const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}{s}", .{ | |
| 1540 | 1850 | options.name, |
| 1541 | 1851 | triple_txt, |
| 1542 | 1852 | model_txt, |
| ... | ... | @@ -1545,6 +1855,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1545 | 1855 | single_threaded_suffix, |
| 1546 | 1856 | backend_suffix, |
| 1547 | 1857 | use_lld, |
| 1858 | linkage_name, | |
| 1548 | 1859 | use_pic, |
| 1549 | 1860 | }); |
| 1550 | 1861 |