File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -391,13 +391,25 @@ function find_libraries(oh::ObjectHandle)
391
391
rpath = RPath (oh)
392
392
sonames = [path (dl) for dl in DynamicLinks (oh)]
393
393
394
- # Remote '@rpath/' prefix if it exists
394
+ # Remove '@rpath/' prefix if it exists
395
395
function strip_rpath (soname)
396
396
if startswith (soname, " @rpath/" )
397
397
return soname[8 : end ]
398
398
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
399
407
return soname
400
408
end
401
409
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)
403
415
end
You can’t perform that action at this time.
0 commit comments