JDK-8209786 : JDK12 fails to build on s390x with gcc 7.3
  • Type: Bug
  • Component: core-libs
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: s390x
  • Submitted: 2018-08-21
  • Updated: 2018-10-02
  • Resolved: 2018-09-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
When compiling with gcc 7.3 on s390x the following error occurs:
Compiling 5349 files for BUILD_DDR_CLASSES
../src/java.base/share/native/libfdlibm/k_rem_pio2.c: In function '__j__kernel_rem_pio2':
../src/java.base/share/native/libfdlibm/k_rem_pio2.c:255:27: error: array subscript is below array bounds [-Werror=array-bounds]
                 for(k=1;iq[jk-k]==0;k++);   /* k = no. of terms needed */
cc1: all warnings being treated as errors
gmake[3]: *** [/data/jenkins/workspace/openjdk11_openj9_build_s390x_linux/openjdk/build/linux-s390x-normal-server-release/support/native/java.base/libfdlibm/k_rem_pio2.o] Error 1

Also a similar error in mlib_ImageLookUp_Bit.c due to left shifting a negative value.

Fix Request This is needed so that s390x builds cleanly with gcc 7.3. No risks I can think of. Applies cleanly.

It has been agreed with the library owners that, libfdlibm error will be compiler option disabled, mediaLib will be code fixed. Webrev here: http://cr.openjdk.java.net/~aleonard/8209786/webrev.02/

I have rebuilt a new patch with appropriate gcc disable warnings for these two modules: http://cr.openjdk.java.net/~aleonard/8209786/webrev.01/

Following some good discussion a more favourable fix has been provided here: http://cr.openjdk.java.net/~aleonard/8209786/webrev.00/

I'm going to investigate compiler options to workaround the issue.

I'd prefer if the fdlibm sources were left alone and the compilation options of that code adjusted instead. In the fullness of time, the remainder of the fdlibm sources will be ported to Java and this class of problem will go away.

The problem relates to more stringent gcc 7.3 compiler checking, in regards to: - validating loop test range - left shifts of negative values

Successfully built on latest jdk12 head and full jdk_core regression suite run.

Webrev fix for this available here: http://cr.openjdk.java.net/~aleonard/gcc73/webrev.00/