| author | |
| committer | |
| log | 30aeb41a19d3ac15c89190cd546cbe7c05c60ac8 |
| tree | 541225ae59e2494310f2da5739498e6c49517179 |
| parent | 2fce991d2ab1dfc6d591b560607ef0edecc7db19 |
If the shared library is a relative path, dirname will return null causing a segfault. In the case I debugged, the current directory was already in RPATH so just ignoring this case seems a reasonable fix. After this fix "make" and "make test" pass for mimalloc.
Closes #137661 files changed, 1 insertions(+), 1 deletions(-)
src/link/Elf.zig+1-1| ... | ... | @@ -1636,7 +1636,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v |
| 1636 | 1636 | } |
| 1637 | 1637 | for (self.base.options.objects) |obj| { |
| 1638 | 1638 | if (Compilation.classifyFileExt(obj.path) == .shared_library) { |
| 1639 | const lib_dir_path = std.fs.path.dirname(obj.path).?; | |
| 1639 | const lib_dir_path = std.fs.path.dirname(obj.path) orelse continue; | |
| 1640 | 1640 | if ((try rpath_table.fetchPut(lib_dir_path, {})) == null) { |
| 1641 | 1641 | try argv.append("-rpath"); |
| 1642 | 1642 | try argv.append(lib_dir_path); |