-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RPATH and dylib install_name on OSX #3034
Conversation
fyi - @DanHeidinga |
Related to #36. |
@@ -47,7 +47,7 @@ $(UMA_EXETARGET): $(UMA_OBJECTS) $(UMA_TARGET_LIBRARIES) | |||
UMA_BEGIN_DASH_L = | |||
UMA_END_DASH_L = | |||
|
|||
UMA_EXE_POSTFIX_FLAGS += -lm -liconv -lc -ldl -lutil -Wl,-rpath,\$$ORIGIN | |||
UMA_EXE_POSTFIX_FLAGS += -lm -liconv -lc -ldl -lutil -Wl,-rpath,@loader_path/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why /.
on the end of the path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it should work without /.
. I will verify and remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified; works without /.
; removed it.
On OSX, -rpath,\$$ORIGIN doesn't work. -rpath needs to correspond to either @executable_path, @loader_path or some other path. More information can be seen in the man pages of dyld. I have chosen to set rpath as "-rpath,@loader_path/.". @loader_path points to the directory where dylib being loaded exists. This works since libjvm is able to load all the dependent dylibs. When naming dylibs, @rpath/ should be appended to dylib names. Example: @rpath/libj9thr29.dylib. Appending @rpath to the dylib name instructs the dynamic linker to search the list of run paths for the dylib. Reference: https://wincent.com/wiki/%40executable_path%2C_%40load_path_and_%40rpath Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
ec28b2a
to
92f40d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
File is osx only which isn't in the builds yet. Merging as is |
On OSX, -rpath,\$$ORIGIN doesn't work. -rpath needs to correspond to
either @executable_path, @loader_path or some other path. More
information can be seen in the man pages of dyld. I have chosen to set
rpath as "-rpath,@loader_path/.". @loader_path points to the directory
where dylib being loaded exists. This works since libjvm is able to load
all the dependent dylibs.
When naming dylibs, @rpath/ should be appended to dylib names. Example:
@rpath/libj9thr29.dylib. Appending @rpath to the dylib name instructs
the dynamic linker to search the list of run paths for the dylib.
Reference:
https://wincent.com/wiki/%40executable_path%2C_%40load_path_and_%40rpath
Signed-off-by: Babneet Singh sbabneet@ca.ibm.com