RFR(XS): 8161262: Fix jdk build with gcc 4.1.2: -fno-strict-overflow not known.

Andrew Hughes gnu.andrew at redhat.com
Wed Jul 13 15:50:27 UTC 2016


----- Original Message -----
> Hi,
> 
> we are building the jdk7u ppc port on gcc 4.1.2.  This fails since
> "8147466: Add -fno-strict-overflow to IndicRearrangementProcessor{,2}.cpp"
> as the gcc flag introduced there is not known to gcc 4.1.2.
> I just guard it by the compiler version.
> 
> Please review this change.
> http://cr.openjdk.java.net/~goetz/wr16/8161262-jdkGcc412/webrev.01/
> 
> Best regards,
>   Goetz.
> 

Thanks for this. It was on my list to fix, following the earlier
post about it.

This webrev solves the problem of the unknown flag on earlier GCCs, but it
still leaves the warning present on those GCCs. We have this fix
in RHEL 5 for the earlier GCC:

diff -r dc86038147b2 make/sun/font/Makefile
--- openjdk/jdk/make/sun/font/Makefile  Mon Jan 18 18:22:09 2016 +0000
+++ openjdk/jdk/make/sun/font/Makefile  Tue Jan 19 05:35:16 2016 +0000
@@ -95,12 +95,14 @@
 endif # PLATFORM
 
 # Turn off aliasing with GCC for ExtensionSubtables.cpp
-# Turn off strict overflow with GCC for IndicRearrangementProcessor.cpp
+# Ensure signed integers wrap with GCC for IndicRearrangementProcessor.cpp
 ifeq ($(PLATFORM), linux)
   CXXFLAGS += $(CXXFLAGS_$(@F))
+  CXXFLAGS_ContextualGlyphSubstProc.o = -fno-strict-aliasing
   CXXFLAGS_ExtensionSubtables.o = -fno-strict-aliasing
-  CXXFLAGS_IndicRearrangementProcessor.o := -fno-strict-overflow
-  CXXFLAGS_IndicRearrangementProcessor2.o := -fno-strict-overflow
+  CXXFLAGS_IndicRearrangementProcessor.o := -fwrapv -fno-strict-aliasing
+  CXXFLAGS_IndicRearrangementProcessor2.o := -fwrapv
+  CXXFLAGS_MorphTables2.o = -fno-strict-aliasing
 endif
 
 # Turn on infinality rendering support when requested

Making that the else clause seems like a better solution:

+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

Omair did post a fix for the actual overflow [0], but it's still waiting
on someone to review it for 9 :-(

Incidentally, can you hold back on further patches until after the CPU?
It's due in less than a week and any changes to 7u at the moment mean
I have to integrate them with the CPU work.

[0] http://mail.openjdk.java.net/pipermail/2d-dev/2016-February/006356.html
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222




More information about the jdk7u-dev mailing list