RFR: JDK-8169255: Link gtestLauncher statically if libjvm is configured for static linking
Erik Joelsson
erik.joelsson at oracle.com
Fri Nov 4 14:22:46 UTC 2016
In the build, we have a global setting for linking libstdc++ static or
dynamic on Linux. All libraries and executables that go in the product
honor this setting. The gtestLauncher currently doesn't. This causes
trouble in testing where some machines might not have the 32bit
libstdc++.so installed. Since installing that library is not needed for
just running the product, it's awkward to have to install it to run
certain tests.
This patch adds the LIBCXX flags from configure when linking
gtestLauncher. The resulting file actually comes out a little bit
smaller, so there is no footprint overhead. The tests still pass.
Bug: https://bugs.openjdk.java.net/browse/JDK-8169255
Patch:
diff -r 246f6fb74bf1 make/lib/CompileGtest.gmk
--- a/make/lib/CompileGtest.gmk
+++ b/make/lib/CompileGtest.gmk
@@ -107,6 +107,7 @@
LDFLAGS := $(LDFLAGS_JDKEXE), \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call
SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_solaris := -library=stlport4, \
+ LIBS_linux := $(LIBCXX), \
LIBS_unix := -ljvm, \
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
/Erik
More information about the build-dev
mailing list