← Back to team overview

openjdk team mailing list archive

Bug#897334: openjdk-10: Please include patch to adjust MIN_FLOAT constant on powerpcspe

 

Source: openjdk-10
Version: 10.0.1+10-3
Severity: normal
Tags: patch
User: debian-powerpc@xxxxxxxxxxxxxxxx
Usertags: powerpcspe

Hi!

The openjdk-10 (and 9 and 11) builds fail on powerpcspe with:

Compiling 2916 files for java.base
/bin/chmod -f ug+w /<<PKGBUILDDIR>>/build/jdk/modules/java.base/com/sun/java/util/jar/pack/intrinsic.properties
( /usr/lib/jvm/java-9-openjdk-powerpcspe/bin/java -Xms64M -Xmx1024M -XX:ThreadStackSize=768 -Duser.language=en -Duser.country=US -Xshare:auto --limit-modules java.base,jdk.zipfs,java.compiler.interim,jdk.compiler.interim,jdk.jdeps.interim,jdk.javadoc.interim --add-modules java.compiler.interim,jdk.compiler.interim,jdk.jdeps.interim,jdk.javadoc.interim --module-path /<<PKGBUILDDIR>>/build/buildtools/interim_modules --add-exports java.base/sun.reflect.annotation=jdk.compiler.interim --add-exports java.base/jdk.internal.util.jar=jdk.jdeps.interim --add-exports java.base/jdk.internal.misc=jdk.jdeps.interim -m jdk.compiler.interim/com.sun.tools.javac.Main -g -source 10 -target 10 --doclint-format html5 -encoding ascii -XDignore.symbol.file=true -Xlint:all -Werror -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline --module-source-path "/<<PKGBUILDDIR>>/build/support/gensrc/*:/<<PKGBUILDDIR>>/src/*/linux/classes:/<<PKGBUILDDIR>>/src/*/unix/classes:/<<PKGBUILDDIR>>/src/*/share/classes" --module-path "" --system none -implicit:none -classpath /<<PKGBUILDDIR>>/build/buildtools/depend -Xplugin:"depend /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_pubapi" -d /<<PKGBUILDDIR>>/build/jdk/modules -h /<<PKGBUILDDIR>>/build/support/headers.java.base.tmp @/<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.tmp > >(/usr/bin/tee /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.log) 2> >(/usr/bin/tee /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.log >&2) || ( exitcode=$? && /bin/cp /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.log /<<PKGBUILDDIR>>/build/make-support/failure-logs/jdk_modules_java.base__the.java.base_batch.log && /bin/cp /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.cmdline /<<PKGBUILDDIR>>/build/make-support/failure-logs/jdk_modules_java.base__the.java.base_batch.cmdline && exit $exitcode ) ) && /bin/mv /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch.tmp /<<PKGBUILDDIR>>/build/jdk/modules/java.base/_the.java.base_batch
compiler/java/jar running ...
/<<PKGBUILDDIR>>/src/java.base/share/classes/java/lang/Float.java:95: error: floating point number too small
    public static final float MIN_VALUE = 0x0.000002P-126f; // 1.4e-45f
                                          ^
make[4]: Leaving directory '/<<PKGBUILDDIR>>/make/gensrc'
(cd /<<PKGBUILDDIR>>/make/gensrc/ && /usr/bin/make  -r -R -I /<<PKGBUILDDIR>>/make/common SPEC=/<<PKGBUILDDIR>>/build/spec.gmk MAKE_LOG_FLAGS=""  -f Gensrc-java.desktop.gmk -I/<<PKGBUILDDIR>>/make -I/<<PKGBUILDDIR>>/make/gensrc MODULE=java.desktop )
make[4]: Entering directory '/<<PKGBUILDDIR>>/make/gensrc'
DefineNativeToolchain TOOLCHAIN_DEFAULT  

This is akin to the issue that is addressed on alpha with the alpha-float-const.diff
patch. Looking at the source code in [1], the fix for alpha just uses a different
representation which calculates the float value instead of using a literal. Thus,
I think we can address the issue on powerpcspe by using the same hack here for
MIN_NORMAL which can be represented as Float.intBitsToFloat(0x1).

Attaching a debdiff.

Thanks,
Adrian

> [1] http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811/src/java.base/share/classes/java/lang/Float.java#l79

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@xxxxxxxxxx
`. `'   Freie Universitaet Berlin - glaubitz@xxxxxxxxxxxxxxxxxxx
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
diff -Nru old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff
--- old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	1970-01-01 01:00:00.000000000 +0100
+++ new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	2018-05-01 15:37:59.734953846 +0200
@@ -0,0 +1,11 @@
+--- a/src/java.base/share/classes/java/lang/Float.java	2018-03-13 17:46:28.000000000 +0100
++++ b/src/java.base/share/classes/java/lang/Float.java	2018-05-01 15:35:55.626369726 +0200
+@@ -92,7 +92,7 @@
+      * hexadecimal floating-point literal {@code 0x0.000002P-126f}
+      * and also equal to {@code Float.intBitsToFloat(0x1)}.
+      */
+-    public static final float MIN_VALUE = 0x0.000002P-126f; // 1.4e-45f
++    public static final float MIN_VALUE = Float.intBitsToFloat(0x1);
+ 
+     /**
+      * Maximum exponent a finite {@code float} variable may have.  It
diff -Nru old/openjdk-10-10.0.1+10/debian/rules new/openjdk-10-10.0.1+10/debian/rules
--- old/openjdk-10-10.0.1+10/debian/rules	2018-04-21 05:09:19.000000000 +0200
+++ new/openjdk-10-10.0.1+10/debian/rules	2018-05-01 15:39:25.882144101 +0200
@@ -368,6 +368,11 @@
 	alpha-float-const.diff
 endif
 
+ifneq (,$(filter $(DEB_HOST_ARCH), powerpcspe))
+  COMMON_PATCHES += \
+	powerpcspe-float-const.diff
+endif
+
 ifneq (,$(filter $(DEB_HOST_ARCH), kfreebsd-amd64 kfreebsd-i386))
   COMMON_PATCHES += \
 	kfreebsd-support-jdk.diff \
diff -Nru old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff
--- old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	1970-01-01 01:00:00.000000000 +0100
+++ new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	2018-05-01 15:37:59.734953846 +0200
@@ -0,0 +1,11 @@
+--- a/src/java.base/share/classes/java/lang/Float.java	2018-03-13 17:46:28.000000000 +0100
++++ b/src/java.base/share/classes/java/lang/Float.java	2018-05-01 15:35:55.626369726 +0200
+@@ -92,7 +92,7 @@
+      * hexadecimal floating-point literal {@code 0x0.000002P-126f}
+      * and also equal to {@code Float.intBitsToFloat(0x1)}.
+      */
+-    public static final float MIN_VALUE = 0x0.000002P-126f; // 1.4e-45f
++    public static final float MIN_VALUE = Float.intBitsToFloat(0x1);
+ 
+     /**
+      * Maximum exponent a finite {@code float} variable may have.  It
diff -Nru old/openjdk-10-10.0.1+10/debian/rules new/openjdk-10-10.0.1+10/debian/rules
--- old/openjdk-10-10.0.1+10/debian/rules	2018-04-21 05:09:19.000000000 +0200
+++ new/openjdk-10-10.0.1+10/debian/rules	2018-05-01 15:39:25.882144101 +0200
@@ -368,6 +368,11 @@
 	alpha-float-const.diff
 endif
 
+ifneq (,$(filter $(DEB_HOST_ARCH), powerpcspe))
+  COMMON_PATCHES += \
+	powerpcspe-float-const.diff
+endif
+
 ifneq (,$(filter $(DEB_HOST_ARCH), kfreebsd-amd64 kfreebsd-i386))
   COMMON_PATCHES += \
 	kfreebsd-support-jdk.diff \
diff -Nru old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff
--- old/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	1970-01-01 01:00:00.000000000 +0100
+++ new/openjdk-10-10.0.1+10/debian/patches/powerpcspe-float-const.diff	2018-05-01 15:37:59.734953846 +0200
@@ -0,0 +1,11 @@
+--- a/src/java.base/share/classes/java/lang/Float.java	2018-03-13 17:46:28.000000000 +0100
++++ b/src/java.base/share/classes/java/lang/Float.java	2018-05-01 15:35:55.626369726 +0200
+@@ -92,7 +92,7 @@
+      * hexadecimal floating-point literal {@code 0x0.000002P-126f}
+      * and also equal to {@code Float.intBitsToFloat(0x1)}.
+      */
+-    public static final float MIN_VALUE = 0x0.000002P-126f; // 1.4e-45f
++    public static final float MIN_VALUE = Float.intBitsToFloat(0x1);
+ 
+     /**
+      * Maximum exponent a finite {@code float} variable may have.  It
diff -Nru old/openjdk-10-10.0.1+10/debian/rules new/openjdk-10-10.0.1+10/debian/rules
--- old/openjdk-10-10.0.1+10/debian/rules	2018-04-21 05:09:19.000000000 +0200
+++ new/openjdk-10-10.0.1+10/debian/rules	2018-05-01 15:39:25.882144101 +0200
@@ -368,6 +368,11 @@
 	alpha-float-const.diff
 endif
 
+ifneq (,$(filter $(DEB_HOST_ARCH), powerpcspe))
+  COMMON_PATCHES += \
+	powerpcspe-float-const.diff
+endif
+
 ifneq (,$(filter $(DEB_HOST_ARCH), kfreebsd-amd64 kfreebsd-i386))
   COMMON_PATCHES += \
 	kfreebsd-support-jdk.diff \