United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6851829 solaris build fails with 5.8 compilers
6851829 : solaris build fails with 5.8 compilers

Details
Type:
Bug
Submit Date:
2009-06-16
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2009-07-15
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs16
Fixed Versions:
hs16

Related Reports
Backport:
Backport:

Sub Tasks

Description
Solaris builds with the CC 5.8 compilers (used for jdk6 update builds) fail while compiling adlc:

Compiling /net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ios", line 150: Error: std::ios::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&).
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 75:     Where: While specializing "std::ios ".
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 75:     Where: Specialized in std::ostream .
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 351:     Where: Specialized in non-template code.
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ios", line 150: Error: std::wios::copyfmt hides the function std::ios_base::copyfmt(const std::ios_base&).
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 75:     Where: While specializing "std::wios ".
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 75:     Where: Specialized in std::wostream .
"/net/mykonos.sfbay/export/pub/SunOS-5-x86/SS11/prod/include/CC/Cstd/./ostream", line 354:     Where: Specialized in non-template code.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/forms.hpp", line 140: Error: globals is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/forms.hpp", line 141: Error: globals is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/forms.hpp", line 422: Error: ptr is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 381: Error: oper is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 382: Error: opc is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 383: Error: internal_name is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 386: Error: inst is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 388: Error: place is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/archDesc.hpp", line 388: Error: index is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 1158: Error: native is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 1163: Error: native is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 1168: Error: native is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 1173: Error: native is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 2085: Error: statement is unreachable.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 2979: Error: instr is defined but not used.
"/net/mykonos.sfbay/export/ws/hs/hotspot/src/share/vm/adlc/adlparse.cpp", line 3014: Error: instr is defined but not used.
18 Error(s) detected.
gmake[2]: *** [../generated/adfiles/adlparse.o] Error 18

$ CC -V
CC: Sun C++ 5.8 2005/10/13

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/d1fe2c2fbdac
                                     
2009-06-24
EVALUATION

Since some of the errors are in system headers we can only disable the "+w -errwarn" on SS11 and below.

There are three ways to fix this problem:

1. Remove the "+w -errwarn" again, but I would like to keep it as it found a number of bugs in ADLC when I switched it on.

2. Disable "+w -errwarn" in adlc.make for SS11 and below.

3. Enable "+w -errwarn" in sparcWorks.make for SS12 and above for the whole HotSpot build and try to fix all errors coming up.

I'd like to do 3., but it seems not to be trivial.  Since there are already a couple of "foo hides the function bar" when compiling the first file and I'm not sure what else is popping up.
                                     
2009-06-17
SUGGESTED FIX

diff -r c6386080541b make/solaris/makefiles/adlc.make
--- a/make/solaris/makefiles/adlc.make
+++ b/make/solaris/makefiles/adlc.make
@@ -68,7 +68,9 @@ endif
 
 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 # Compiler warnings are treated as errors
-CFLAGS_WARN = +w -errwarn
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+  CFLAGS_WARN = +w -errwarn
+endif
 CFLAGS += $(CFLAGS_WARN)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
                                     
2009-06-17
WORK AROUND

Disable treating warnings as errors:

   $ gmake product CFLAGS_WARN=
                                     
2009-06-16



Hardware and Software, Engineered to Work Together