guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: icedtea-7: Fix build.


From: guix-commits
Subject: 01/02: gnu: icedtea-7: Fix build.
Date: Tue, 14 Sep 2021 15:44:29 -0400 (EDT)

glv pushed a commit to branch core-updates-frozen
in repository guix.

commit 1fec7c43f8d8e00ad729f6666456d44a3e5e1c74
Author: Guillaume Le Vaillant <glv@posteo.net>
AuthorDate: Tue Sep 14 21:18:39 2021 +0200

    gnu: icedtea-7: Fix build.
    
    * gnu/packages/java.scm (icedtea-7)[arguments]: Add 'fix-openjdk' phase.
      Update 'install-keystore' phase.
---
 gnu/packages/java.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index c803a17..03941ba 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1286,6 +1286,25 @@ bootstrapping purposes.")
                               
"openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
                  (("attr/xattr.h") "sys/xattr.h"))
                #t))
+           (add-after 'unpack 'fix-openjdk
+             (lambda _
+               (substitute* "openjdk.src/jdk/make/common/Defs-linux.gmk"
+                 (("CFLAGS_COMMON   = -fno-strict-aliasing" all)
+                  (string-append all " -fcommon")))
+               (substitute*
+                   
'("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
+                     
"openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
+                 (("#include <sys/sysctl.h>")
+                  "#include <linux/sysctl.h>"))
+               ;; It looks like the "h = 31 * h + c" line of the jsum()
+               ;; function gets miscompiled. After a few iterations of the loop
+               ;; the result of "31 * h" is always 0x8000000000000000.
+               ;; Bad optimization maybe...
+               ;; Transform "31 * h + c" into a convoluted "32 * h + c - h"
+               ;; as a workaround.
+               (substitute* "openjdk.src/hotspot/src/share/vm/memory/dump.cpp"
+                 (("h = 31 \\* h \\+ c;")
+                  "jlong h0 = h;\nfor(int i = 0; i < 5; i++) h += h;\nh += c - 
h0;"))))
            (add-after 'unpack 'fix-x11-extension-include-path
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
@@ -1621,7 +1640,7 @@ bootstrapping purposes.")
                  (setlocale LC_ALL "en_US.utf8")
                  (setenv "LC_ALL" "en_US.utf8")
 
-                 (for-each import-cert (find-files certs-dir "\\.pem$"))
+                 (for-each import-cert (find-files certs-dir "\\.crt$"))
                  (mkdir-p (string-append (assoc-ref outputs "out")
                                          "/lib/security"))
                  (mkdir-p (string-append (assoc-ref outputs "jdk")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]