diff mbox series

[bug#63327] gnu: openjdk9: Fix build on aarch64.

Message ID bfe5cba3542670b2244cbedc383d4be95190400e.1683370247.git.mail@cbaines.net
State New
Headers show
Series [bug#63327] gnu: openjdk9: Fix build on aarch64. | expand

Commit Message

Christopher Baines May 6, 2023, 10:50 a.m. UTC
* gnu/packages/java.scm (openjdk9)[arguments]: Add 'patch-for-aarch64 phase to
remove duplicate line in interp_masm_aarch64.hpp.
---
 gnu/packages/java.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)


base-commit: 64086a4fa449a9f6d2f835fcdf5498222b309e3a

Comments

Anthony May 9, 2023, 3:10 a.m. UTC | #1
From: burning2007@ya.ru

Hello!

I've encountered this issue and tested similar solution (patch). It builds successfully. It even allows openjdk@10 to build as well - mine has same build errors as for openjdk@9.

But, on the other hand, it is not sufficient for building jdk@9 itself - please, take a look at https://issues.guix.gnu.org/issue/63069.

P. S. Sorry for attachment in previous message - my email provider does not even have a plain text option in UI.

--
Best regards,

Anthony
Ludovic Courtès May 22, 2023, 2:50 p.m. UTC | #2
Christopher Baines <mail@cbaines.net> skribis:

> * gnu/packages/java.scm (openjdk9)[arguments]: Add 'patch-for-aarch64 phase to
> remove duplicate line in interp_masm_aarch64.hpp.

I’d say go for it if it fixes the problem.

Thanks,
Ludo’.
Andreas Enge July 26, 2023, 2 p.m. UTC | #3
I just ran the patch, and can confirm that it enables the build of openjdk@9
on aarch64. So I have pushed it and am closing this bug.

More discussion at https://issues.guix.gnu.org/issue/63069 .

Andreas
diff mbox series

Patch

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 067284017c..166417a73d 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -884,6 +884,18 @@  (define-public openjdk9
 
        #:phases
        (modify-phases %standard-phases
+         ,@(if (target-aarch64?)
+               `((add-after 'unpack 'patch-for-aarch64
+                   (lambda _
+                     (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
+                       ;; This line is duplicated, so remove both occurrences,
+                       ;; then add back one occurrence by substituting a
+                       ;; comment that occurs once.
+                       (("using MacroAssembler::call_VM_leaf_base;") "")
+                       (("Interpreter specific version of call_VM_base")
+                        "Interpreter specific version of call_VM_base
+  using MacroAssembler::call_VM_leaf_base;")))))
+               '())
          (add-after 'patch-source-shebangs 'fix-java-shebangs
            (lambda _
              ;; This file was "fixed" by patch-source-shebangs, but it requires