changeset 8472:a7267e8244b9 jdk7u111-b00

8161262: Fix jdk build with gcc 4.1.2: -fno-strict-overflow not known. Summary: Use -fwrapv on GCC < 4.3. Also handle additional -fno-strict-aliasing cases with earlier compilers. Reviewed-by: andrew
author goetz
date Fri, 15 Jul 2016 17:10:13 +0100
parents f055a87d7910
children 802c570861cb
files make/sun/font/Makefile
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/make/sun/font/Makefile	Wed Jul 13 21:47:10 2016 +0100
+++ b/make/sun/font/Makefile	Fri Jul 15 17:10:13 2016 +0100
@@ -94,13 +94,22 @@
 
 endif # PLATFORM
 
-# Turn off aliasing with GCC for ExtensionSubtables.cpp
-# Turn off strict overflow with GCC for IndicRearrangementProcessor.cpp
+# Turn off aliasing with GCC for ExtensionSubtables.cpp (and others on GCC < 4.3)
+# Turn off strict overflow with GCC for IndicRearrangementProcessor.cpp on GCC >= 4.3
+# Ensure signed integers wrap with GCC for IndicRearrangementProcessor.cpp on GCC < 4.3
 ifeq ($(PLATFORM), linux)
   CXXFLAGS += $(CXXFLAGS_$(@F))
   CXXFLAGS_ExtensionSubtables.o = -fno-strict-aliasing
+ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+  # GCC >= 4.3.  This flag is not known in gcc 4.1.2.
   CXXFLAGS_IndicRearrangementProcessor.o := -fno-strict-overflow
   CXXFLAGS_IndicRearrangementProcessor2.o := -fno-strict-overflow
+else
+  CXXFLAGS_ContextualGlyphSubstProc.o = -fno-strict-aliasing
+  CXXFLAGS_IndicRearrangementProcessor.o := -fwrapv -fno-strict-aliasing
+  CXXFLAGS_IndicRearrangementProcessor2.o := -fwrapv
+  CXXFLAGS_MorphTables2.o = -fno-strict-aliasing
+endif
 endif
 
 #In the non-OpenJDK mode we need to build T2K