From de5bac17c7555cd76df264b0677218dea20d50f2 Mon Sep 17 00:00:00 2001 From: simonis Date: Thu, 5 Jan 2017 14:25:07 +0100 Subject: [PATCH] 8172053: (ppc64) Downport of 8170153 breaks build on linux/ppc64 (big endian) Reviewed-by: dholmes, erikj --- make/lib/CoreLibraries.gmk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk index 910144408..389e6b922 100644 --- a/make/lib/CoreLibraries.gmk +++ b/make/lib/CoreLibraries.gmk @@ -42,6 +42,11 @@ ifeq ($(OPENJDK_TARGET_OS), linux) endif ifneq ($(OPENJDK_TARGET_OS), macosx) + # Unfortunately, '-ffp-contract' is only available since gcc 4.6. For ppc64le + # that's no problem since ppc64le support only appeared in gcc 4.8.3. But on + # ppc64 (big endian) we traditionally compiled with gcc 4.3 which only knows + # '-mno-fused-madd'. However, that's still not enough to get the float + # computations right - we additionally have to supply '-fno-strict-aliasing'. $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \ STATIC_LIBRARY := fdlibm, \ OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ @@ -52,7 +57,7 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ CFLAGS_windows_debug := -DLOGGING, \ CFLAGS_aix := -qfloat=nomaf, \ - CFLAGS_linux_ppc64 := -ffp-contract=off, \ + CFLAGS_linux_ppc64 := -mno-fused-madd -fno-strict-aliasing, \ CFLAGS_linux_ppc64le := -ffp-contract=off, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ -- GitLab