On Solaris libjimage.so has a weird extra runpath set, pointing into the install directory of Solaris Studio.

JDK-8160630 changed libjimage to be compiled as C++ library as it should be. I forgot to add the linker flags LDFLAGS_CXX_JDK to the LDFLAGS of that library. All other C++ libraries in the JDK has these flags set. On Solaris one of them is -norunpath, which seems to be the missing option here.

Verified that the below fix results in a binary without the extra runpath.

Bug: https://bugs.openjdk.java.net/browse/JDK-8167387

Patch:

diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk
--- a/make/lib/CoreLibraries.gmk
+++ b/make/lib/CoreLibraries.gmk
@@ -255,7 +255,7 @@
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
     CFLAGS_unix := -UDEBUG, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
-    LDFLAGS := $(LDFLAGS_JDKLIB) \
+    LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
         -export:JIMAGE_PackageToModule \

/Erik

Reply via email to