| ... | ... | @@ -76,7 +76,7 @@ pub fn build(b: *Build) void { |
| 76 | 76 | elf_step.dependOn(testLargeBss(b, .{ .target = glibc_target })); |
| 77 | 77 | elf_step.dependOn(testLinkOrder(b, .{ .target = glibc_target })); |
| 78 | 78 | elf_step.dependOn(testLdScript(b, .{ .target = glibc_target })); |
| 79 | | elf_step.dependOn(testLdScriptPathErrors(b, .{ .target = glibc_target })); |
| 79 | elf_step.dependOn(testLdScriptPathError(b, .{ .target = glibc_target })); |
| 80 | 80 | elf_step.dependOn(testMismatchedCpuArchitectureError(b, .{ .target = glibc_target })); |
| 81 | 81 | // https://github.com/ziglang/zig/issues/17451 |
| 82 | 82 | // elf_step.dependOn(testNoEhFrameHdr(b, .{ .target = glibc_target })); |
| ... | ... | @@ -101,7 +101,8 @@ pub fn build(b: *Build) void { |
| 101 | 101 | elf_step.dependOn(testTlsOffsetAlignment(b, .{ .target = glibc_target })); |
| 102 | 102 | elf_step.dependOn(testTlsPic(b, .{ .target = glibc_target })); |
| 103 | 103 | elf_step.dependOn(testTlsSmallAlignment(b, .{ .target = glibc_target })); |
| 104 | | elf_step.dependOn(testUnresolvedErrors(b, .{ .target = glibc_target })); |
| 104 | elf_step.dependOn(testUnknownFileTypeError(b, .{ .target = glibc_target })); |
| 105 | elf_step.dependOn(testUnresolvedError(b, .{ .target = glibc_target })); |
| 105 | 106 | elf_step.dependOn(testWeakExports(b, .{ .target = glibc_target })); |
| 106 | 107 | elf_step.dependOn(testWeakUndefsDso(b, .{ .target = glibc_target })); |
| 107 | 108 | elf_step.dependOn(testZNow(b, .{ .target = glibc_target })); |
| ... | ... | @@ -1604,8 +1605,8 @@ fn testLdScript(b: *Build, opts: Options) *Step { |
| 1604 | 1605 | return test_step; |
| 1605 | 1606 | } |
| 1606 | 1607 | |
| 1607 | | fn testLdScriptPathErrors(b: *Build, opts: Options) *Step { |
| 1608 | | const test_step = addTestStep(b, "ld-script-path-errors", opts); |
| 1608 | fn testLdScriptPathError(b: *Build, opts: Options) *Step { |
| 1609 | const test_step = addTestStep(b, "ld-script-path-error", opts); |
| 1609 | 1610 | |
| 1610 | 1611 | const scripts = WriteFile.create(b); |
| 1611 | 1612 | _ = scripts.add("liba.so", "INPUT(libfoo.so)"); |
| ... | ... | @@ -2834,8 +2835,36 @@ fn testTlsStatic(b: *Build, opts: Options) *Step { |
| 2834 | 2835 | return test_step; |
| 2835 | 2836 | } |
| 2836 | 2837 | |
| 2837 | | fn testUnresolvedErrors(b: *Build, opts: Options) *Step { |
| 2838 | | const test_step = addTestStep(b, "unresolved-errors", opts); |
| 2838 | fn testUnknownFileTypeError(b: *Build, opts: Options) *Step { |
| 2839 | const test_step = addTestStep(b, "unknown-file-type-error", opts); |
| 2840 | |
| 2841 | const dylib = addSharedLibrary(b, "a", .{ |
| 2842 | .target = .{ .cpu_arch = .x86_64, .os_tag = .macos }, |
| 2843 | }); |
| 2844 | addZigSourceBytes(dylib, "export var foo: i32 = 0;"); |
| 2845 | |
| 2846 | const exe = addExecutable(b, "main", opts); |
| 2847 | addCSourceBytes(exe, |
| 2848 | \\extern int foo; |
| 2849 | \\int main() { |
| 2850 | \\ return foo; |
| 2851 | \\} |
| 2852 | , &.{}); |
| 2853 | exe.linkLibrary(dylib); |
| 2854 | exe.linkLibC(); |
| 2855 | |
| 2856 | expectLinkErrors(exe, test_step, &.{ |
| 2857 | "unknown file type", |
| 2858 | "note: while parsing /?/liba.dylib", |
| 2859 | "undefined symbol: foo", |
| 2860 | "note: referenced by /?/a.o:.text", |
| 2861 | }); |
| 2862 | |
| 2863 | return test_step; |
| 2864 | } |
| 2865 | |
| 2866 | fn testUnresolvedError(b: *Build, opts: Options) *Step { |
| 2867 | const test_step = addTestStep(b, "unresolved-error", opts); |
| 2839 | 2868 | |
| 2840 | 2869 | const obj1 = addObject(b, "a", opts); |
| 2841 | 2870 | addCSourceBytes(obj1, |