Open
Bug 578692
Opened 14 years ago
Updated 2 years ago
Use @loader_path instead of @executable_path in internal name of dylib
Categories
(NSPR :: NSPR, defect, P2)
Tracking
(Not tracked)
NEW
4.10.2
People
(Reporter: ted, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
1.37 KB,
patch
|
Details | Diff | Splinter Review |
OS X 10.4's dyld added support for @loader_path in the internal name of dylibs, which is similar to @executable_path, except that it refers to the directory containing the module that loaded your module, not just the executable. So, for example, if some executable from another directory were linked with libxul, with libxul linked to NSPR, currently things would not load because @executable_path would not contain NSPR. However, if we used @loader_path, NSPR could be loaded because it's located next to libxul. I'm not sure if we need to support 10.3 or earlier. If so, I can modify this patch to only use @loader_path when targeting 10.4 or newer.
Comment 1•14 years ago
|
||
Ted: NSPR dropped support for Mac OS X 10.3 in NSPR 4.8. Note that the change you proposed is a semantic change. It is equivalent to the LOAD_WITH_ALTERED_SEARCH_PATH flag for the LoadLibraryEx Win32 function: http://msdn.microsoft.com/en-us/library/ms684179(VS.85).aspx So there is some concern of breaking backward compatibility, but in most cases I've found the @loader_path sematics to be more desirable.
Reporter | ||
Comment 2•14 years ago
|
||
Apparently I had written the patch to support pre-10.4 anyway and forgotten about it. I can drop that if we don't need it. I agree that it's a semantic change, but it seems likely that @loader_path is the more useful behavior. Also, it's always possible to use install_name_tool to change it after-the-fact, so it shouldn't be hard for consumers to change the behavior.
Comment 3•14 years ago
|
||
Comment on attachment 457337 [details] [diff] [review] Use @loader_path Thanks for the patch. Your "Mac OS X >= 10.4" test is incorrect. You must check the major version as well (it's not guaranteed to be 10 forever). Nit: please indent by 4 spaces in nsprpub/configure.in. You can fix both problems by simply hardcoding @loader_path/$@. But you're welcome to fix the "Mac OS X >= 10.4" test.
Attachment #457337 -
Flags: review?(wtc) → review-
Reporter | ||
Updated•14 years ago
|
Assignee: ted.mielczarek → nobody
Status: ASSIGNED → NEW
of course, even with this patch, I can't run tests out of the obj dir: $ ./obj-x86_64-apple-darwin10.8.0/nsprpub/pr/tests/getai -? dyld: Library not loaded: @loader_path/libplc4.dylib Referenced from: /Users/rstory/src/mozilla/clean-osx/./obj-x86_64-apple-darwin10.8.0/nsprpub/pr/tests/getai Reason: image not found Trace/BPT trap $ otool -L obj-x86_64-apple-darwin10.8.0/nsprpub/pr/tests/getai obj-x86_64-apple-darwin10.8.0/nsprpub/pr/tests/getai: @loader_path/libplc4.dylib (compatibility version 1.0.0, current version 1.0.0) @loader_path/libnspr4.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 625.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) but it works if I make a symlink in obj*/dist/bin...
Attachment #457337 -
Attachment is obsolete: true
Updated•11 years ago
|
Priority: -- → P2
Target Milestone: --- → 4.10.2
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•