File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,13 +391,25 @@ function find_libraries(oh::ObjectHandle)
391391 rpath = RPath (oh)
392392 sonames = [path (dl) for dl in DynamicLinks (oh)]
393393
394- # Remote '@rpath/' prefix if it exists
394+ # Remove '@rpath/' prefix if it exists
395395 function strip_rpath (soname)
396396 if startswith (soname, " @rpath/" )
397397 return soname[8 : end ]
398398 end
399+ return soname
400+ end
401+
402+ # Translate `@loader_path/` to the actual path of the binary
403+ function strip_loader_path (soname)
404+ if startswith (soname, " @loader_path/" )
405+ return joinpath (dirname (path (oh)), soname[14 : end ])
406+ end
399407 return soname
400408 end
401409
402- return Dict (s => find_library (oh, strip_rpath (s)) for s in sonames)
410+ # Get rid of confusing loader tokens
411+ sonames = strip_rpath .(sonames)
412+ sonames = strip_loader_path .(sonames)
413+
414+ return Dict (s => find_library (oh, s) for s in sonames)
403415end
You can’t perform that action at this time.
0 commit comments