Opened 3 months ago
Last modified 3 months ago
#70404 closed defect
llvm-18: libLLVM.dylib not loaded at runtime — at Version 2
Reported by: | sletz (Stéphane Letz) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | cjones051073 (Chris Jones), jeremyhu (Jeremy Huddleston Sequoia) | |
Port: | llvm-18 llvm-devel |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
My project using llvm-18 correctly build but I get this error at runtime:
Library not loaded: '@rpath/libLLVM.dylib'
The same happens with llvm-devel and the project is correctly working with llvm-17.
Change History (2)
comment:1 Changed 3 months ago by jmroot (Joshua Root)
Cc: | cjones051073 jeremyhu added |
---|---|
Keywords: | llvm-18 removed |
Port: | llvm-18 llvm-devel added |
Summary: | Link with with llvm-18 → llvm-18: libLLVM.dylib not loaded at runtime |
comment:2 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
Note: See
TracTickets for help on using
tickets.
The way that rpath works on macOS is that when you link with a library that uses rpath, you have to supply a linker flag to tell it what
@rpath
should expand to. Looks like our llvm ports have been using@rpath
for libLLVM.dylib for a long time, so if old versions worked without you having to specify the rpath manually, maybe that's something that can be fixed in the new llvm versions. Until then, you can do it manually, for example by using the linker flag-rpath /opt/local/libexec/llvm-18/lib
.