summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2021-09-18 11:06:10 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2021-09-18 11:18:41 +0200
commitc3892d4ffb0fc52d5a6a503f358f06768a7636e8 (patch)
treee6f2f704fe1e6aeeef69aa3436b6a323c42102d5 /gnu/packages
parent8613652f3f80105f35db13d6d9308257bbff8474 (diff)
downloadguix-c3892d4ffb0fc52d5a6a503f358f06768a7636e8.tar.gz
gnu: openjdk: Fix compiling with gcc 10.
* gnu/packages/java.scm (openjdk9, openjdk10, openjdk11)[arguments]: Add
  '-fcommon', '-fno-delete-null-pointer-checks' and '-fno-lifetime-dse'
  to CFLAGS.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/java.scm29
1 files changed, 19 insertions, 10 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 9b0beaa541..7358affe1d 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -60,7 +60,6 @@
   #:use-module (gnu packages elf)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gawk)
-  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages ghostscript) ;lcms
@@ -1962,8 +1961,12 @@ new Date();"))
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; TODO: unbundle libpng and lcms
              (invoke "bash" "./configure"
-                     "--with-extra-cflags=-fcommon"
-                     (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
+                     ;; Add flags for compilation with gcc >= 10
+                     ,(string-append "--with-extra-cflags=-fcommon"
+                                     " -fno-delete-null-pointer-checks"
+                                     " -fno-lifetime-dse")
+                     (string-append "--with-freetype="
+                                    (assoc-ref inputs "freetype"))
                      "--disable-freetype-bundling"
                      "--disable-warnings-as-errors"
                      "--disable-hotspot-gtest"
@@ -2091,8 +2094,7 @@ new Date();"))
        ("libxt" ,libxt)
        ("libxtst" ,libxtst)))
     (native-inputs
-     `(("gcc" ,gcc-9) ; FIXME: segmentation faults when using gcc-10.
-       ("icedtea-8" ,icedtea-8)
+     `(("icedtea-8" ,icedtea-8)
        ("icedtea-8:jdk" ,icedtea-8 "jdk")
        ;; XXX: The build system fails with newer versions of GNU Make.
        ("make@4.2" ,gnu-make-4.2)
@@ -2138,8 +2140,12 @@ new Date();"))
            (replace 'configure
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (invoke "bash" "./configure"
-                       "--with-extra-cflags=-fcommon"
-                       (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
+                       ;; Add flags for compilation with gcc >= 10
+                       ,(string-append "--with-extra-cflags=-fcommon"
+                                       " -fno-delete-null-pointer-checks"
+                                       " -fno-lifetime-dse")
+                       (string-append "--with-freetype="
+                                      (assoc-ref inputs "freetype"))
                        "--disable-freetype-bundling"
                        "--disable-warnings-as-errors"
                        "--disable-hotspot-gtest"
@@ -2157,8 +2163,7 @@ new Date();"))
         `(,(gexp-input openjdk9)
           ,(gexp-input openjdk9 "jdk")))))
     (native-inputs
-     `(("gcc" ,gcc-9) ; FIXME: segmentation faults when using gcc-10.
-       ("openjdk9" ,openjdk9)
+     `(("openjdk9" ,openjdk9)
        ("openjdk9:jdk" ,openjdk9 "jdk")
        ("make@4.2" ,gnu-make-4.2)
        ("unzip" ,unzip)
@@ -2193,7 +2198,11 @@ new Date();"))
        #:tests? #f; requires jtreg
        ;; TODO package jtreg
        #:configure-flags
-       `("--disable-option-checking" ; --enable-fast-install default flag errors otherwise
+       `(;; Add flags for compilation with gcc >= 10
+         ,(string-append "--with-extra-cflags=-fcommon"
+                         " -fno-delete-null-pointer-checks"
+                         " -fno-lifetime-dse")
+         "--disable-option-checking" ; --enable-fast-install default flag errors otherwise
          "--disable-warnings-as-errors"
          ;; make validate-runpath pass, see: http://issues.guix.info/issue/32894
          "--with-native-debug-symbols=zipped"