| ... | @@ -76,6 +76,7 @@ pub fn build(b: *Build) void { | ... | @@ -76,6 +76,7 @@ pub fn build(b: *Build) void { |
| 76 | elf_step.dependOn(testLargeBss(b, .{ .target = glibc_target })); | 76 | elf_step.dependOn(testLargeBss(b, .{ .target = glibc_target })); |
| 77 | elf_step.dependOn(testLinkOrder(b, .{ .target = glibc_target })); | 77 | elf_step.dependOn(testLinkOrder(b, .{ .target = glibc_target })); |
| 78 | elf_step.dependOn(testLdScript(b, .{ .target = glibc_target })); | 78 | elf_step.dependOn(testLdScript(b, .{ .target = glibc_target })); |
| | 79 | elf_step.dependOn(testLdScriptPathErrors(b, .{ .target = glibc_target })); |
| 79 | // https://github.com/ziglang/zig/issues/17451 | 80 | // https://github.com/ziglang/zig/issues/17451 |
| 80 | // elf_step.dependOn(testNoEhFrameHdr(b, .{ .target = glibc_target })); | 81 | // elf_step.dependOn(testNoEhFrameHdr(b, .{ .target = glibc_target })); |
| 81 | elf_step.dependOn(testPie(b, .{ .target = glibc_target })); | 82 | elf_step.dependOn(testPie(b, .{ .target = glibc_target })); |
| ... | @@ -1602,6 +1603,27 @@ fn testLdScript(b: *Build, opts: Options) *Step { | ... | @@ -1602,6 +1603,27 @@ fn testLdScript(b: *Build, opts: Options) *Step { |
| 1602 | return test_step; | 1603 | return test_step; |
| 1603 | } | 1604 | } |
| 1604 | | 1605 | |
| | 1606 | fn testLdScriptPathErrors(b: *Build, opts: Options) *Step { |
| | 1607 | const test_step = addTestStep(b, "ld-script-path-errors", opts); |
| | 1608 | |
| | 1609 | const scripts = WriteFile.create(b); |
| | 1610 | _ = scripts.add("liba.so", "INPUT(libfoo.so)"); |
| | 1611 | |
| | 1612 | const exe = addExecutable(b, "main", opts); |
| | 1613 | addCSourceBytes(exe, "int main() { return 0; }", &.{}); |
| | 1614 | exe.linkSystemLibrary2("a", .{}); |
| | 1615 | exe.addLibraryPath(scripts.getDirectory()); |
| | 1616 | exe.linkLibC(); |
| | 1617 | |
| | 1618 | expectLinkErrors(exe, test_step, &.{ |
| | 1619 | "error: missing library dependency: GNU ld script '/?/liba.so' requires 'libfoo.so', but file not found", |
| | 1620 | "note: tried libfoo.so", |
| | 1621 | "note: tried /?/libfoo.so", |
| | 1622 | }); |
| | 1623 | |
| | 1624 | return test_step; |
| | 1625 | } |
| | 1626 | |
| 1605 | fn testLinkingC(b: *Build, opts: Options) *Step { | 1627 | fn testLinkingC(b: *Build, opts: Options) *Step { |
| 1606 | const test_step = addTestStep(b, "linking-c", opts); | 1628 | const test_step = addTestStep(b, "linking-c", opts); |
| 1607 | | 1629 | |