diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-10-14 22:24:46 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-10-23 16:27:38 -0700 |
| commit | 5b016e290a5ba335b295afeae104af6b3396a425 (patch) | |
| tree | 370ce44e11911967fefd986c42c53c12c22f320b /test | |
| parent | a4cc344aa0947f5b0d0e1a872e6d003b8e580976 (diff) | |
| download | zig-5b016e290a5ba335b295afeae104af6b3396a425.tar.gz zig-5b016e290a5ba335b295afeae104af6b3396a425.zip | |
move ld script processing to the frontend
along with the relevant logic, making the libraries within subject to
the same search criteria as all the other libraries.
this unfortunately means doing file system access on all .so files when
targeting ELF to determine if they are linker scripts, however, I have a
plan to address this.
Diffstat (limited to 'test')
| -rw-r--r-- | test/link/elf.zig | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/test/link/elf.zig b/test/link/elf.zig index f6891cf17e..0b8aa45141 100644 --- a/test/link/elf.zig +++ b/test/link/elf.zig @@ -2165,13 +2165,11 @@ fn testLdScriptPathError(b: *Build, opts: Options) *Step { exe.addLibraryPath(scripts.getDirectory()); exe.linkLibC(); - expectLinkErrors( - exe, - test_step, - .{ - .contains = "error: missing library dependency: GNU ld script '/?/liba.so' requires 'libfoo.so', but file not found", - }, - ); + // TODO: A future enhancement could make this error message also mention + // the file that references the missing library. + expectLinkErrors(exe, test_step, .{ + .stderr_contains = "error: unable to find dynamic system library 'foo' using strategy 'no_fallback'. searched paths:", + }); return test_step; } @@ -3907,16 +3905,8 @@ fn testUnknownFileTypeError(b: *Build, opts: Options) *Step { exe.linkLibrary(dylib); exe.linkLibC(); - // TODO: improve the test harness to be able to selectively match lines in error output - // while avoiding jankiness - // expectLinkErrors(exe, test_step, .{ .exact = &.{ - // "error: invalid token in LD script: '\\x00\\x00\\x00\\x0c\\x00\\x00\\x00/usr/lib/dyld\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0d' (0:989)", - // "note: while parsing /?/liba.dylib", - // "error: unexpected error: parsing input file failed with error InvalidLdScript", - // "note: while parsing /?/liba.dylib", - // } }); expectLinkErrors(exe, test_step, .{ - .starts_with = "error: invalid token in LD script: '\\x00\\x00\\x00\\x0c\\x00\\x00\\x00/usr/lib/dyld\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0d' (", + .contains = "error: failed to parse shared object: BadMagic", }); return test_step; |
