# HG changeset patch # User stuefe # Date 1482222303 -3600 # Tue Dec 20 09:25:03 2016 +0100 # Node ID 2bcd5fc08f4b5f47b81c1136337e97718d3149d5 # Parent d637600f977a28775eb645bd48b80ae51de9ea6c 8171408: [aix] TOC overflow when linking the gtest libjvm.so Reviewed-by: dholmes, simonis, erikj diff --git a/make/lib/CompileGtest.gmk b/make/lib/CompileGtest.gmk --- a/make/lib/CompileGtest.gmk +++ b/make/lib/CompileGtest.gmk @@ -54,6 +54,13 @@ # Disabling switch warning for clang because of test source. +# Note: On AIX, the gtest test classes linked into the libjvm.so push the TOC +# size beyond 64k, so we need to link with bigtoc. However, this means that +# -qpic=large would be advisable to lessen the performance effect of bigtoc. +# But we want to avoid imposing -qpic=large onto the regular libjvm.so, which +# has no problem with its TOC, so do this only for object files which are +# exclusive to the gtest libjvm.so. + $(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \ TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ LIBRARY := jvm, \ @@ -72,6 +79,7 @@ CFLAGS_windows := -EHsc, \ CFLAGS_solaris := -DGTEST_HAS_EXCEPTIONS=0 -library=stlport4, \ CFLAGS_macosx := -DGTEST_OS_MAC=1, \ + CFLAGS_aix := -qpic=large, \ CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \ DISABLED_WARNINGS_gcc := undef, \ @@ -80,6 +88,7 @@ DISABLED_WARNINGS_solstudio := identexpected, \ LDFLAGS := $(JVM_LDFLAGS), \ LDFLAGS_solaris := -library=stlport4 $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_aix := -bbigtoc, \ LIBS := $(JVM_LIBS), \ OPTIMIZATION := $(JVM_OPTIMIZATION), \ MAPFILE := $(GTEST_JVM_MAPFILE), \