Bug 255662 - java/openjdk11: Add armv6 / armv7 support
Summary: java/openjdk11: Add armv6 / armv7 support
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Mikael Urankar
URL:
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2021-05-06 16:08 UTC by Mikael Urankar
Modified: 2024-10-09 14:58 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (java)
koobs: maintainer-feedback? (glewis)


Attachments
v0 (3.35 KB, patch)
2021-05-06 16:08 UTC, Mikael Urankar
no flags Details | Diff
log file when running portmaster java/openjdk11 with qemu-arm-static (6.49 KB, text/plain)
2021-09-18 09:59 UTC, Martin Birgmeier
no flags Details
RPI-B panic message when trying to install openjdk11 (451.50 KB, image/jpeg)
2021-09-18 13:35 UTC, Martin Birgmeier
no flags Details
v1 (4.97 KB, patch)
2024-10-09 11:19 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer freebsd_triage 2021-05-06 16:08:06 UTC
Created attachment 224730 [details]
v0

The bootstrap is on freefall: /home/mikael/bootstrap-openjdk11-arm-12-11.0.5.10.1.tar.xz
Comment 1 Greg Lewis freebsd_committer freebsd_triage 2021-05-13 03:47:58 UTC
Thanks Mikael.  I've copied your bootstrap over into the same distribution directory where I've got the others.  In a few hours you should be able to test the bootstrap change to make sure it works.
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-05-18 16:00:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=362eb92da22191ba1aa95524f86a62afc9d92496

commit 362eb92da22191ba1aa95524f86a62afc9d92496
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2021-05-18 15:57:36 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2021-05-18 15:57:36 +0000

    java/openjdk11: Add armv6 / armv7 support

    PR:             255662
    Approved by:    portmgr (tier 2 blanket)

 java/bootstrap-openjdk11/Makefile |  8 ++++----
 java/bootstrap-openjdk11/distinfo |  2 ++
 java/openjdk11/Makefile           | 10 +++++-----
 3 files changed, 11 insertions(+), 9 deletions(-)
Comment 3 Martin Birgmeier 2021-09-17 16:18:41 UTC
I am trying this on armv6, and the bootstrap vm says that it is for armv7 only.

Therefore, the build of openjdk11 on armv6 fails.

-- Martin
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2021-09-17 18:15:32 UTC
I don't have access to an armv6 board right now, do you have a build log?

The bootstrap seems correct:

readelf -A bootstrap-openjdk11/bin/java | grep CPU_arch
  Tag_CPU_arch: ARM v6

file bootstrap-openjdk11/bin/java: ELF 32-bit LSB executable, ARM, EABI5 version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.2

Thanks.
Comment 5 Martin Birgmeier 2021-09-18 09:36:59 UTC
This first log is from an emulation using qemu-user-static. The failure at the "cd" command at the end is strange - that directory is perfectly reachable and writable.

This is interesting (all with qemu-user-static):

[0]# /usr/local/bootstrap-openjdk11/bin/javac -version
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
[1]# 

I'll try with a real Raspberry-Pi B+ a little later.

-- Martin
Comment 6 Martin Birgmeier 2021-09-18 09:59:26 UTC
Created attachment 227974 [details]
log file when running portmaster java/openjdk11 with qemu-arm-static
Comment 7 Martin Birgmeier 2021-09-18 13:35:07 UTC
Created attachment 227980 [details]
RPI-B panic message when trying to install openjdk11

So the rpi-b simply panicked...
Comment 8 Martin Birgmeier 2021-09-18 14:01:01 UTC
And furthermore on the RPI-B:

[0]# /usr/local/bootstrap-openjdk11/bin/javac -version
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
[1]# 

-- Martin
Comment 9 Mikael Urankar freebsd_committer freebsd_triage 2021-09-18 14:44:41 UTC
I'm afraid that armv6 is not supported in server mode:
https://github.com/battleblow/openjdk-jdk11u/blob/bsd-port/src/hotspot/cpu/arm/vm_version_arm_32.cpp#L238

I've built this bootstrap on an armv7 board inside an armv6 chroot and never triggered this issue....

It's possible to use the zero mode but it'll require a new bootstrap.
Comment 10 Ed Maste freebsd_committer freebsd_triage 2024-06-19 17:22:37 UTC
FreeBSD armv6 support is going to be retired before FreeBSD 15.0.
Comment 11 Ronald Klop freebsd_committer freebsd_triage 2024-09-27 07:50:05 UTC
At least the build on armv7 gets pretty far nowadays.
https://pkg-status.freebsd.org/ampere2/data/main-armv7-default/p0047206c1c4f_s666303f59/logs/openjdk11-11.0.24+8.1_1.log

Does anybody have a clue what this is about?

/wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/hotspot/cpu/arm/assembler_arm_64.cpp:47:24: error: no member named 'LogicalImmediate' in 'Assembler'
   47 | inline bool Assembler::LogicalImmediate::has_equal_subpatterns(uintx imm, int size) {
      |             ~~~~~~~~~~~^


Googling these terms only pointed me to the pkg fallout emails. :-)
Comment 12 Mikael Urankar freebsd_committer freebsd_triage 2024-10-04 14:07:38 UTC
(In reply to Ronald Klop from comment #11)
This conditional doesn't work:
https://github.com/battleblow/jdk11u/blob/bsd-port/make/hotspot/lib/CompileJvm.gmk#L111

"call isTargetCpu, bsd-arm" should probably be "call isTargetCpu, arm"
Comment 13 Mikael Urankar freebsd_committer freebsd_triage 2024-10-09 11:19:56 UTC
Created attachment 254105 [details]
v1

This patch fixes the build on armv7
Comment 14 Ronald Klop freebsd_committer freebsd_triage 2024-10-09 14:58:31 UTC
(In reply to Mikael Urankar from comment #13)
Great patch. Thanks. Was busy on this also. Will test your patch this soon.

Are all the changes in the patch like _MACHINE_CPUFUNC_H_ and __bool_true_false_are_defined also acceptable on non-armv7 architectures (amd64, aarch64, etc.) or do we need to make them conditional?