Severin Gehwolf eac7e3e
# HG changeset patch
Severin Gehwolf eac7e3e
# User sgehwolf
Severin Gehwolf eac7e3e
# Date 1536682731 -7200
Severin Gehwolf eac7e3e
#      Tue Sep 11 18:18:51 2018 +0200
Severin Gehwolf eac7e3e
# Node ID 7157249fdd4366d95dd68f3d083ebb0ef84c753b
Severin Gehwolf eac7e3e
# Parent  8d86b149e10f0a0896e5fd4d8d407e5fda64a529
Severin Gehwolf eac7e3e
8210425: [x86] sharedRuntimeTrig/sharedRuntimeTrans compiled without optimization
Severin Gehwolf eac7e3e
Reviewed-by: duke
Severin Gehwolf eac7e3e
Severin Gehwolf eac7e3e
diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk
Severin Gehwolf eac7e3e
--- a/make/hotspot/lib/JvmOverrideFiles.gmk
Severin Gehwolf eac7e3e
+++ b/make/hotspot/lib/JvmOverrideFiles.gmk
Severin Gehwolf eac7e3e
@@ -41,20 +41,26 @@
Severin Gehwolf eac7e3e
   BUILD_LIBJVM_shenandoahTraversalGC.cpp_CXXFLAGS := --param inline-unit-growth=1000
Severin Gehwolf eac7e3e
 endif
Severin Gehwolf eac7e3e
 
Severin Gehwolf eac7e3e
+LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NONE)
Severin Gehwolf eac7e3e
+# If the FDLIBM_CFLAGS variable is non-empty we know
Severin Gehwolf eac7e3e
+# that the fdlibm-fork in hotspot can get optimized
Severin Gehwolf eac7e3e
+# by using -ffp-contract=off on GCC/Clang platforms.
Severin Gehwolf eac7e3e
+ifneq ($(FDLIBM_CFLAGS), )
Severin Gehwolf eac7e3e
+  LIBJVM_FDLIBM_COPY_OPT_FLAG := $(CXX_O_FLAG_NORM)
Severin Gehwolf eac7e3e
+endif
Severin Gehwolf eac7e3e
+
Severin Gehwolf eac7e3e
 ifeq ($(OPENJDK_TARGET_OS), linux)
Severin Gehwolf eac7e3e
   BUILD_LIBJVM_ostream.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
Severin Gehwolf eac7e3e
   BUILD_LIBJVM_logFileOutput.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
Severin Gehwolf eac7e3e
 
Severin Gehwolf eac7e3e
-  ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
Severin Gehwolf eac7e3e
-    BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE)
Severin Gehwolf eac7e3e
-    BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE)
Severin Gehwolf eac7e3e
+  BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
Severin Gehwolf eac7e3e
+  BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
Severin Gehwolf eac7e3e
 
Severin Gehwolf eac7e3e
-    ifeq ($(TOOLCHAIN_TYPE), clang)
Severin Gehwolf eac7e3e
-      JVM_PRECOMPILED_HEADER_EXCLUDE := \
Severin Gehwolf eac7e3e
-          sharedRuntimeTrig.cpp \
Severin Gehwolf eac7e3e
-          sharedRuntimeTrans.cpp \
Severin Gehwolf eac7e3e
-          #
Severin Gehwolf eac7e3e
-    endif
Severin Gehwolf eac7e3e
+  ifeq ($(TOOLCHAIN_TYPE), clang)
Severin Gehwolf eac7e3e
+    JVM_PRECOMPILED_HEADER_EXCLUDE := \
Severin Gehwolf eac7e3e
+	sharedRuntimeTrig.cpp \
Severin Gehwolf eac7e3e
+	sharedRuntimeTrans.cpp \
Severin Gehwolf eac7e3e
+	#
Severin Gehwolf eac7e3e
   endif
Severin Gehwolf eac7e3e
 
Severin Gehwolf eac7e3e
   ifeq ($(OPENJDK_TARGET_CPU), x86)