RFR: JDK-8167387: libjimage.so has a bad runpath

Erik Joelsson erik.joelsson at oracle.com
Mon Oct 10 16:00:06 UTC 2016

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 

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

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


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 @@
      CFLAGS_unix := -UDEBUG, \
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
          -export:JIMAGE_PackageToModule \


More information about the build-dev mailing list