From 9f31375ff638192c9bdd1a42efb8e1d6968af044 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Thu, 12 Feb 2015 12:39:12 -0500 Subject: [PATCH] Fix build and add more debug info Fix building with gcc 5 by ignoring return-local-addr warning. The warning only occurs on non-JIT architectures and is safe to ignore. Otherwise -Werror causes the build to fail. Include additional debugging information for java class files such as local variables. Run tests during the build to make sure that information is present in the final jars. --- java-1.8.0-openjdk.spec | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 4567541..e8c842f 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -637,7 +637,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 20.%{buildver}%{?dist} +Release: 21.%{buildver}%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -1064,8 +1064,8 @@ export CFLAGS="$CFLAGS -mieee" EXTRA_CFLAGS="-fstack-protector-strong" #see https://bugzilla.redhat.com/show_bug.cgi?id=1120792 -EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-devirtualize" -EXTRA_CPP_FLAGS="-fno-devirtualize" +EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-devirtualize -Wno-return-local-addr" +EXTRA_CPP_FLAGS="-fno-devirtualize -Wno-return-local-addr" # PPC/PPC64 needs -fno-tree-vectorize since -O3 would # otherwise generate wrong code producing segfaults. %ifarch %{power64} ppc @@ -1123,6 +1123,7 @@ bash ../../configure \ make \ DEBUG_BINARIES=true \ + JAVAC_FLAGS=-g \ STRIP_POLICY=no_strip \ POST_STRIP_CMD="" \ LOG=trace \ @@ -1170,7 +1171,17 @@ if [ -f "$ZERO_JVM" ] ; then fi # Check src.zip has all sources. See RHBZ#1130490 -jar -tf $JAVA_HOME/src.zip | grep Unsafe +jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe' + +# Check class files include useful debugging information +$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable + +# Check generated class files include useful debugging information +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from" +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable +$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable #build cycles done @@ -1677,6 +1688,11 @@ end %changelog +* Thu Feb 12 2015 Omair Majid - 1:1.8.0.40-21.b25 +- Fix building with gcc 5 by ignoring return-local-addr warning +- Include additional debugging info for java class files and test that they are + present + * Thu Feb 12 2015 Jiri Vanek - 1:1.8.0.40-20.b25 - bumped to b25 - removed upstreamed patch11 hotspot-build-j-directive.patch