> Please review this fairly trivial one line fix, the proposed patch is in the 
> comments of the JBS issue, duplicated here for consistency:
> 
> diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 
> --- a/common/autoconf/flags.m4 
> +++ b/common/autoconf/flags.m4 
> @@ -355,7 +355,7 @@ 
>         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 
> -current_version 1.0.0 $PICFLAG" 
>         JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" 
>       fi 
> - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' 
> + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path[$]1' 
>       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" 
>       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' 
>       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' 
> 
> Existing use of the macro for macosx do not provide an argument, this results 
> in RPATH being set to @loader_path, which is fine. New use of the macro will 
> be consistent with linux.

Ok, so it needs to be a two line fix, different sections for gcc and clang:

diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -355,7 +355,7 @@
         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 
-current_version 1.0.0 $PICFLAG"
         JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
       fi
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path[$]1'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
@@ -375,7 +375,7 @@
       # Linking is different on MacOSX
       PICFLAG=''
       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 
-current_version 1.0.0 $PICFLAG"
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path[$]1'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'

This time I actually verified it:
$ grep SET_EXECUTABLE_ORIGIN build/macosx-x64-debug/spec.gmk 
SET_EXECUTABLE_ORIGIN=-Wl,-rpath,@loader_path$1

-DrD-

Reply via email to