--- a/jdk/make/lib/CoreLibraries.gmk Fri Dec 02 16:18:10 2016 +0100
+++ b/jdk/make/lib/CoreLibraries.gmk Mon Nov 28 11:13:38 2016 -0500
@@ -33,10 +33,22 @@
# libfdlibm is statically linked with libjava below and not delivered into the
# product on its own.
-BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+BUILD_LIBFDLIBM_OPTIMIZATION := NONE
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+ BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+endif
-ifneq ($(OPENJDK_TARGET_OS), solaris)
- BUILD_LIBFDLIBM_OPTIMIZATION := NONE
+ifeq ($(OPENJDK_TARGET_OS), linux)
+ ifeq ($(OPENJDK_TARGET_CPU), ppc64)
+ BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+ else ifeq ($(OPENJDK_TARGET_CPU), ppc64le)
+ BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+ else ifeq ($(OPENJDK_TARGET_CPU), s390x)
+ BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+ else ifeq ($(OPENJDK_TARGET_CPU), aarch64)
+ BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+ endif
endif
LIBFDLIBM_SRC := $(JDK_TOPDIR)/src/java.base/share/native/libfdlibm
@@ -51,6 +63,10 @@
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
CFLAGS_windows_debug := -DLOGGING, \
CFLAGS_aix := -qfloat=nomaf, \
+ CFLAGS_linux_ppc64 := -ffp-contract=off, \
+ CFLAGS_linux_ppc64le := -ffp-contract=off, \
+ CFLAGS_linux_s390x := -ffp-contract=off, \
+ CFLAGS_linux_aarch64 := -ffp-contract=off, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
ARFLAGS := $(ARFLAGS), \