diff options
| author | Isaac Freund <mail@isaacfreund.com> | 2025-01-29 14:11:23 +0100 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2025-02-10 23:19:48 +0100 |
| commit | 819716b59f941253ae98405bb4b30049aea5f8de (patch) | |
| tree | 0e501e960750e089393647b4bf74a518b18cda61 /lib/std/array_hash_map.zig | |
| parent | 34644511bb6d83aa6575641ef79e5eefb495e3e1 (diff) | |
| download | zig-819716b59f941253ae98405bb4b30049aea5f8de.tar.gz zig-819716b59f941253ae98405bb4b30049aea5f8de.zip | |
link: fix ambiguous names in linker scripts
Currently zig fails to build while linking the system LLVM/C++ libraries
on my Chimera Linux system due to the fact that libc++.so is a linker
script with the following contents:
INPUT(libc++.so.1 -lc++abi -lunwind)
Prior to this commit, zig would try to convert "ambiguous names" in
linker scripts such as libc++.so.1 in this example into -lfoo style
flags. This fails in this case due to the so version number as zig
checks for exactly the .so suffix.
Furthermore, I do not think that this conversion is semantically correct
since converting libfoo.so to -lfoo could theoretically end up resulting
in libfoo.a getting linked which seems wrong when a different file is
specified in the linker script.
With this patch, this attempted conversion is removed. Instead, zig
always first checks if the exact file/path in the linker script exists
relative to the current working directory.
If the file is classified as a library (including versioned shared
objects such as libfoo.so.1), zig then falls back to checking if
the exact file/path in the linker script exists relative to each
directory in the library search path, selecting the first match or
erroring out if none is found.
This behavior fixes the regression that prevents building zig while
linking the system LLVM/C++ libraries on Chimera Linux.
Diffstat (limited to 'lib/std/array_hash_map.zig')
0 files changed, 0 insertions, 0 deletions
