guix_mirror_bot pushed a commit to branch java-team
in repository guix.

commit a22f73ede483e465b56d66e01fccf25abe2393f4
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Sat Feb 21 14:50:02 2026 +0900

    gnu: openjdk16: Fix build on powerpc64le.
    
    * gnu/packages/java.scm (openjdk15)
    [implicit-inputs?]: Set to #f.
    [native-inputs]: Add gcc-11.
    (openjdk17) [implicit-inputs?]: Set to #t.
    [native-inputs]: Remove manually added implicit inputs added in openjdk15.
    
    Fixes: <https://issues.guix.gnu.org/79270>
    Change-Id: Ieda25aae528f468403bae8063f2fa199a873cfae
---
 gnu/packages/java.scm | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 995da628b0..6db007519a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1719,18 +1719,31 @@ blacklisted.certs.pem"
       (append libxcursor)))             ;for our patch to work
    (arguments
     (substitute-keyword-arguments (package-arguments base)
+      ((#:implicit-inputs? _ #t)
+       ;; This is necessary to avoid include ordering errors when adding a
+       ;; lower GCC to native-inputs to avoid errors like "error: 'fesetround'
+       ;; was not declared in this scope; did you mean 'setreuid'?"
+       #f)
       ((#:configure-flags flags '%standard-phases)
        #~(cons "--without-gtest"        ;this replaces...
                (delete "--disable-hotspot-gtest" #$flags))))) ;... this
    (native-inputs
-    (modify-inputs (package-native-inputs base)
-      (delete "make"                    ;remove old gnu-make-4.2
-              "openjdk")                ;to remove non-jdk output
-      (append `(,openjdk14 "jdk"))))))
+    (append (modify-inputs (package-native-inputs base)
+              (delete "make"            ;remove old gnu-make-4.2
+                      "openjdk")        ;to remove non-jdk output
+              (append `(,openjdk14 "jdk")))
+            ;; On powerpc64le at least, GCC 14 cannot be used otherwise JDK 15
+            ;; fails to bootstrap JDK 16, with incomprehensible errors like:
+            ;; src/java.base/share/classes/java/lang/reflect/Proxy.java:1311:
+            ;; error: integer number too large.
+            (modify-inputs (%final-inputs)
+              (delete "gcc")
+              (prepend gcc-11))))))
 
 (define-public openjdk16
-  (make-openjdk openjdk15 "16.0.2"
-                "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
+  (make-openjdk
+   openjdk15 "16.0.2"
+   "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
    (source (origin
              (inherit (package-source base))
              (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
@@ -1744,14 +1757,19 @@ blacklisted.certs.pem"
              (inherit (package-source base))
              (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
    (arguments
-    (substitute-keyword-arguments (package-arguments openjdk16)
+    (substitute-keyword-arguments (package-arguments base)
+      ((#:implicit-inputs? _ #t) #t)    ;restore default
       ((#:phases phases)
        #~(modify-phases #$phases
            (replace 'fix-java-shebangs
              (lambda _
                ;; 'blacklisted' was renamed back to 'blocked'.
                (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
-                 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
+                 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))
+   (native-inputs
+    ;; Resume using the implicit inputs, including the current GCC.
+    (fold alist-delete (package-native-inputs base)
+          (map first (%final-inputs))))))
 
 (define-public openjdk18
   (make-openjdk openjdk17 "18.0.2.1"

Reply via email to