Bug 244803

Summary: java/openjdk11: Fails to build on 13-CURRENT
Product: Ports & Packages Reporter: Yasuhiro Kimura <yasu>
Component: Individual Port(s)Assignee: Kirill Ponomarev <krion>
Status: Closed FIXED    
Severity: Affects Some People CC: Trond.Endrestol, glewis, java, koobs
Priority: --- Flags: bugzilla: maintainer-feedback? (java)
koobs: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244947
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244961
Attachments:
Description Flags
Patch for src/hotspot/share/runtime/arguments.cpp
none
Patch for src/hotspot/share/runtime/sharedRuntime.cpp
none
Patch for src/java.base/share/native/libfdlibm/e_asin.c
none
Patch for Clang 10 none

Description Yasuhiro Kimura freebsd_committer freebsd_triage 2020-03-14 06:15:18 UTC
After updating 13-CURRENT amd64 to base r358964, build fails as
following.

----------------------------------------------------------------------
gmake[4]: Entering directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/gensrc'
Compiling 11 properties into resource bundles for java.logging
gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/gensrc'
/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/src/hotspot/share/runtime/arguments.cpp:1461:35: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
      if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) {
                                  ^  ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake[4]: *** [lib/CompileJvm.gmk:157: /wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/build/bsd-x86_64-normal-server-release/hotspot/variant-server/libjvm/objs/arguments.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/hotspot'
gmake[3]: *** [make/Main.gmk:261: hotspot-server-libs] Error 2
gmake[3]: *** Waiting for unfinished jobs....
Compiling 11 properties into resource bundles for java.base
Compiling 6 properties into resource bundles for java.base
gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/gensrc'
gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1'

ERROR: Build failed for target 'images' in configuration 'bsd-x86_64-normal-server-release' (exit code 2) 
gmake[3]: Entering directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1'

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_objs_arguments.o:
/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/src/hotspot/share/runtime/arguments.cpp:1461:35: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
      if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) {
                                  ^  ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

* All command lines available in /wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/build/bsd-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1'
gmake[2]: *** [/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/Init.gmk:305: main] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1'
gmake[1]: *** [/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/make/Init.gmk:186: images] Error 2gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/java/openjdk11
build of java/openjdk11 | openjdk11-11.0.6+10.1_1 ended at Sat Mar 14 10:23:41 JST 2020
build time: 00:01:30
!!! build failure encountered !!!
----------------------------------------------------------------------

Full build log is available with following URL.

https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/curamd64-original/2020-03-14_08h34m08s/logs/openjdk11-11.0.6+10.1_1.log
Comment 1 Trond Endrestøl 2020-03-20 20:32:37 UTC
Created attachment 212554 [details]
Patch for src/hotspot/share/runtime/arguments.cpp

Patch 1 of 3. Turned pointer comparison into a regular C-style string comparison.
Comment 2 Trond Endrestøl 2020-03-20 20:34:11 UTC
Created attachment 212555 [details]
Patch for src/hotspot/share/runtime/sharedRuntime.cpp

Patch 2 of 3. Clang 10 needs the extra parenthesis.
Comment 3 Trond Endrestøl 2020-03-20 20:37:17 UTC
Created attachment 212557 [details]
Patch for src/java.base/share/native/libfdlibm/e_asin.c

Patch 3 of 3. Added curly braces around the else block.

With these three patches in place, java/openjdk11 built successfully on base/head r359017, amd64.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2020-03-24 08:33:23 UTC
Seeing the following error building openjdk-jdk11u-jdk-11.0.6-10-1 on CURRENT (13, amd53, r359028, GENERIC-NODEBUG 

* For target hotspot_variant-server_libjvm_objs_sharedRuntime.o:
/var/tmp/tmpfs0/usr/home/koobs/repos/freebsd/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.6-10-1/src/hotspot/share/runtime/sharedRuntime.cpp:2809:85: error: expression does not compute the number of elements in this array; element type is 'double', not 'relocInfo' [-Werror,-Wsizeof-array-div]
      buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
                                                                          ~~~~~~~~  ^
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2020-03-24 08:59:33 UTC
@Trond Can you produce a single patch against the port, fixing the errors you've identified using `make makepatch` [1] please:

[1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/slow-patch.html
Comment 6 Trond Endrestøl 2020-03-29 08:04:44 UTC
Created attachment 212818 [details]
Patch for Clang 10
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-04-14 13:05:29 UTC
A commit references this bug:

Author: krion
Date: Tue Apr 14 13:05:22 UTC 2020
New revision: 531679
URL: https://svnweb.freebsd.org/changeset/ports/531679

Log:
  Fix build on HEAD.

  PR:		244803
  Submitted by:	Yasuhiro KIMURA <yasu_AT_utahime__dot__org>

Changes:
  head/java/openjdk11/files/patch-src_hotspot_share_runtime_arguments.cpp
  head/java/openjdk11/files/patch-src_hotspot_share_runtime_sharedRuntime.cpp
  head/java/openjdk11/files/patch-src_java.base_share_native_libfdlibm_e__asin.c
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2020-04-14 22:47:47 UTC
^Triage: Assign to committer resolving

Is the quarterly port also affected?
Comment 9 Greg Lewis freebsd_committer freebsd_triage 2020-04-15 02:20:42 UTC
Note, I think the patch for e_asin.c is incorrect.

See https://svnweb.freebsd.org/base/head/lib/msun/src/e_asin.c?revision=317349&view=markup#l87
Comment 10 Greg Lewis freebsd_committer freebsd_triage 2020-04-15 02:28:52 UTC
Ignore my last comment, these are equivalent changes.
Comment 11 Greg Lewis freebsd_committer freebsd_triage 2020-04-18 02:08:45 UTC
This has been superseded by the 11.0.7 port update.
Comment 12 Kirill Ponomarev freebsd_committer freebsd_triage 2020-05-13 07:37:59 UTC
it seems it's fixed now