| ... | ... | @@ -77,6 +77,7 @@ pub fn build(b: *Build) void { |
| 77 | 77 | elf_step.dependOn(testLinkOrder(b, .{ .target = glibc_target })); |
| 78 | 78 | elf_step.dependOn(testLdScript(b, .{ .target = glibc_target })); |
| 79 | 79 | elf_step.dependOn(testLdScriptPathErrors(b, .{ .target = glibc_target })); |
| 80 | elf_step.dependOn(testMismatchedCpuArchitectureError(b, .{ .target = glibc_target })); |
| 80 | 81 | // https://github.com/ziglang/zig/issues/17451 |
| 81 | 82 | // elf_step.dependOn(testNoEhFrameHdr(b, .{ .target = glibc_target })); |
| 82 | 83 | elf_step.dependOn(testPie(b, .{ .target = glibc_target })); |
| ... | ... | @@ -100,7 +101,7 @@ pub fn build(b: *Build) void { |
| 100 | 101 | elf_step.dependOn(testTlsOffsetAlignment(b, .{ .target = glibc_target })); |
| 101 | 102 | elf_step.dependOn(testTlsPic(b, .{ .target = glibc_target })); |
| 102 | 103 | elf_step.dependOn(testTlsSmallAlignment(b, .{ .target = glibc_target })); |
| 103 | | elf_step.dependOn(testUnresolved(b, .{ .target = glibc_target })); |
| 104 | elf_step.dependOn(testUnresolvedErrors(b, .{ .target = glibc_target })); |
| 104 | 105 | elf_step.dependOn(testWeakExports(b, .{ .target = glibc_target })); |
| 105 | 106 | elf_step.dependOn(testWeakUndefsDso(b, .{ .target = glibc_target })); |
| 106 | 107 | elf_step.dependOn(testZNow(b, .{ .target = glibc_target })); |
| ... | ... | @@ -1624,6 +1625,33 @@ fn testLdScriptPathErrors(b: *Build, opts: Options) *Step { |
| 1624 | 1625 | return test_step; |
| 1625 | 1626 | } |
| 1626 | 1627 | |
| 1628 | fn testMismatchedCpuArchitectureError(b: *Build, opts: Options) *Step { |
| 1629 | const test_step = addTestStep(b, "mismatched-cpu-architecture-error", opts); |
| 1630 | |
| 1631 | const obj = addObject(b, "a", .{ |
| 1632 | .target = .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu }, |
| 1633 | }); |
| 1634 | addCSourceBytes(obj, "int foo;", &.{}); |
| 1635 | obj.strip = true; |
| 1636 | |
| 1637 | const exe = addExecutable(b, "main", opts); |
| 1638 | addCSourceBytes(exe, |
| 1639 | \\extern int foo; |
| 1640 | \\int main() { |
| 1641 | \\ return foo; |
| 1642 | \\} |
| 1643 | , &.{}); |
| 1644 | exe.addObject(obj); |
| 1645 | exe.linkLibC(); |
| 1646 | |
| 1647 | expectLinkErrors(exe, test_step, &.{ |
| 1648 | "invalid cpu architecture: expected 'x86_64', but found 'aarch64'", |
| 1649 | "note: while parsing /?/a.o", |
| 1650 | }); |
| 1651 | |
| 1652 | return test_step; |
| 1653 | } |
| 1654 | |
| 1627 | 1655 | fn testLinkingC(b: *Build, opts: Options) *Step { |
| 1628 | 1656 | const test_step = addTestStep(b, "linking-c", opts); |
| 1629 | 1657 | |
| ... | ... | @@ -2806,8 +2834,8 @@ fn testTlsStatic(b: *Build, opts: Options) *Step { |
| 2806 | 2834 | return test_step; |
| 2807 | 2835 | } |
| 2808 | 2836 | |
| 2809 | | fn testUnresolved(b: *Build, opts: Options) *Step { |
| 2810 | | const test_step = addTestStep(b, "unresolved", opts); |
| 2837 | fn testUnresolvedErrors(b: *Build, opts: Options) *Step { |
| 2838 | const test_step = addTestStep(b, "unresolved-errors", opts); |
| 2811 | 2839 | |
| 2812 | 2840 | const obj1 = addObject(b, "a", opts); |
| 2813 | 2841 | addCSourceBytes(obj1, |