changeset 2566:bfdaab44fa5a

Fixed build with GCC 4.7 2012-05-11 Andrew John Hughes <ahughes@redhat.com> * NEWS: List GCC 4.7 fixes. 2012-01-30 Deepak Bhole <dbhole@redhat.com> Added patches to fix building with GCC 4.7 * patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch: New patch. Makes methods return NULL instead of boolean when they return a pointer. * patches/openjdk/remove-mimpure-option-to-gcc.patch: New patch. Removes the invalid -mimpure-text option to GCC.
author Andrew John Hughes <ahughes@redhat.com>
date Fri, 11 May 2012 11:00:19 +0100
parents 8bcd76a839dd
children 1a5fc82ba3b8
files ChangeLog Makefile.am NEWS patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch patches/openjdk/remove-mimpure-option-to-gcc.patch
diffstat 5 files changed, 193 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 11 10:52:57 2012 +0100
+++ b/ChangeLog	Fri May 11 11:00:19 2012 +0100
@@ -1,3 +1,16 @@
+2012-05-11  Andrew John Hughes  <ahughes@redhat.com>
+
+	* NEWS: List GCC 4.7 fixes.
+
+2012-01-30  Deepak Bhole <dbhole@redhat.com>
+
+	Added patches to fix building with GCC 4.7
+	* patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch:
+	New patch. Makes methods return NULL instead of boolean when they return a
+	pointer.
+	* patches/openjdk/remove-mimpure-option-to-gcc.patch: New patch. Removes
+	the invalid -mimpure-text option to GCC.
+
 2011-10-26  Omair Majid  <omajid@redhat.com>
 
 	S7103224: collision between __LEAF define in interfaceSupport.hpp and
--- a/Makefile.am	Fri May 11 10:52:57 2012 +0100
+++ b/Makefile.am	Fri May 11 11:00:19 2012 +0100
@@ -382,7 +382,9 @@
 	patches/openjdk/7091528-javadoc_class_files.patch \
 	patches/idresolver_fix.patch \
 	patches/openjdk/6792400-Avoid_loading_Normalizer_resources.patch \
-	patches/openjdk/7103224-glibc_name_collision.patch
+	patches/openjdk/7103224-glibc_name_collision.patch \
+	patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch \
+	patches/openjdk/remove-mimpure-option-to-gcc.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
--- a/NEWS	Fri May 11 10:52:57 2012 +0100
+++ b/NEWS	Fri May 11 11:00:19 2012 +0100
@@ -10,12 +10,15 @@
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
 New in release 1.10.7 (2012-XX-XX):
+
+* Fixed build with GCC 4.7
 * Bug fixes
   - PR732: Use xsltproc for bootstrap xslt in place of Xerces/Xalan
   - PR881: Sign tests (wsse.policy.basic) failures with OpenJDK6
 * Backports
   - S6792400: Avoid loading of Normalizer resources for simple uses
   - S7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
+  - S7140882: Don't return booleans from methods returning pointers
 
 New in release 1.10.6 (2012-02-14):
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7140882-dont-return-booleans-from-methods-returning-pointers.patch	Fri May 11 11:00:19 2012 +0100
@@ -0,0 +1,12 @@
+diff -ur openjdk.orig/hotspot/src/share/vm/opto/loopnode.cpp openjdk/hotspot/src/share/vm/opto/loopnode.cpp
+--- openjdk.orig/hotspot/src/share/vm/opto/loopnode.cpp	2011-11-14 17:07:36.000000000 -0500
++++ openjdk/hotspot/src/share/vm/opto/loopnode.cpp	2012-01-30 11:25:10.648080484 -0500
+@@ -546,7 +546,7 @@
+ Node* CountedLoopNode::match_incr_with_optional_truncation(
+                       Node* expr, Node** trunc1, Node** trunc2, const TypeInt** trunc_type) {
+   // Quick cutouts:
+-  if (expr == NULL || expr->req() != 3)  return false;
++  if (expr == NULL || expr->req() != 3)  return NULL;
+ 
+   Node *t1 = NULL;
+   Node *t2 = NULL;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/remove-mimpure-option-to-gcc.patch	Fri May 11 11:00:19 2012 +0100
@@ -0,0 +1,162 @@
+diff -ur openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk
+--- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk	2011-11-14 17:11:39.000000000 -0500
++++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk	2012-01-30 11:27:47.181487274 -0500
+@@ -94,7 +94,7 @@
+   endif
+   endif
+   # Option used to create a shared library
+-  SHARED_LIBRARY_FLAG = -shared -mimpure-text
++  SHARED_LIBRARY_FLAG = -shared
+   SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
+ 
+ endif
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt	2012-01-30 11:27:47.186487189 -0500
+@@ -90,7 +90,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/gctest/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+@@ -90,7 +90,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/heapTracker/sample.makefile.txt	2012-01-30 11:27:47.186487189 -0500
+@@ -94,7 +94,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/heapViewer/sample.makefile.txt	2012-01-30 11:27:47.184487223 -0500
+@@ -90,7 +90,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	2012-01-30 11:27:47.189487139 -0500
+@@ -130,7 +130,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES= -lnsl -ldl -lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/index.html openjdk/jdk/src/share/demo/jvmti/index.html
+--- openjdk.orig/jdk/src/share/demo/jvmti/index.html	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/index.html	2012-01-30 11:27:47.183487240 -0500
+@@ -308,7 +308,7 @@
+ <code><ul>
+ gcc -O2 -fPIC -pthread -DLINUX -c <i>*.c</i>
+ <br>
+-gcc -z defs -static-libgcc -shared -mimpure-text -o <i>libXXX.so *.o</i> -lc
++gcc -z defs -static-libgcc -shared -o <i>libXXX.so *.o</i> -lc
+ </code></ul>
+ <br>
+ For AMD64:
+@@ -316,7 +316,7 @@
+ <code><ul>
+ gcc -O2 -fPIC -pthread -DLINUX -D_LP64=1 -c <i>*.c</i>
+ <br>
+-gcc -z defs -static-libgcc -shared -mimpure-text -o <i>libXXX.so *.o</i> -lc
++gcc -z defs -static-libgcc -shared -o <i>libXXX.so *.o</i> -lc
+ </code></ul>
+ <br>
+ </li>
+@@ -339,7 +339,7 @@
+ </li>
+ 
+ <li>
+-Library: Use -static-libgcc -mimpure-text.
++Library: Use -static-libgcc.
+ <br>
+ When building the shared library (-shared option), this option
+ allows for maximum portability of the library between different
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+@@ -90,7 +90,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/minst/sample.makefile.txt	2012-01-30 11:27:47.187487172 -0500
+@@ -94,7 +94,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/mtrace/sample.makefile.txt	2012-01-30 11:27:47.188487155 -0500
+@@ -94,7 +94,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/versionCheck/sample.makefile.txt	2012-01-30 11:27:47.185487206 -0500
+@@ -90,7 +90,7 @@
+     OBJECTS=$(SOURCES:%.c=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=-lc
+     # Building a shared library
+diff -ur openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt
+--- openjdk.orig/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2011-11-14 17:12:10.000000000 -0500
++++ openjdk/jdk/src/share/demo/jvmti/waiters/sample.makefile.txt	2012-01-30 11:27:47.188487155 -0500
+@@ -91,7 +91,7 @@
+     OBJECTS=$(SOURCES:%.cpp=%.o)
+     # Library name and options needed to build it
+     LIBRARY=lib$(LIBNAME).so
+-    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
++    LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
+     # Libraries we are dependent on
+     LIBRARIES=
+     # Building a shared library