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.
This commit is contained in:
Guillaume Le Vaillant 2021-09-18 11:06:10 +02:00
parent 8613652f3f
commit c3892d4ffb
No known key found for this signature in database
GPG key ID: 6BE8208ADF21FE3F

View file

@ -60,7 +60,6 @@
#:use-module (gnu packages elf) #:use-module (gnu packages elf)
#:use-module (gnu packages fontutils) #:use-module (gnu packages fontutils)
#:use-module (gnu packages gawk) #:use-module (gnu packages gawk)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext) #:use-module (gnu packages gettext)
#:use-module (gnu packages gl) #:use-module (gnu packages gl)
#:use-module (gnu packages ghostscript) ;lcms #:use-module (gnu packages ghostscript) ;lcms
@ -1962,8 +1961,12 @@ new Date();"))
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
;; TODO: unbundle libpng and lcms ;; TODO: unbundle libpng and lcms
(invoke "bash" "./configure" (invoke "bash" "./configure"
"--with-extra-cflags=-fcommon" ;; Add flags for compilation with gcc >= 10
(string-append "--with-freetype=" (assoc-ref inputs "freetype")) ,(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-freetype-bundling"
"--disable-warnings-as-errors" "--disable-warnings-as-errors"
"--disable-hotspot-gtest" "--disable-hotspot-gtest"
@ -2091,8 +2094,7 @@ new Date();"))
("libxt" ,libxt) ("libxt" ,libxt)
("libxtst" ,libxtst))) ("libxtst" ,libxtst)))
(native-inputs (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") ("icedtea-8:jdk" ,icedtea-8 "jdk")
;; XXX: The build system fails with newer versions of GNU Make. ;; XXX: The build system fails with newer versions of GNU Make.
("make@4.2" ,gnu-make-4.2) ("make@4.2" ,gnu-make-4.2)
@ -2138,8 +2140,12 @@ new Date();"))
(replace 'configure (replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(invoke "bash" "./configure" (invoke "bash" "./configure"
"--with-extra-cflags=-fcommon" ;; Add flags for compilation with gcc >= 10
(string-append "--with-freetype=" (assoc-ref inputs "freetype")) ,(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-freetype-bundling"
"--disable-warnings-as-errors" "--disable-warnings-as-errors"
"--disable-hotspot-gtest" "--disable-hotspot-gtest"
@ -2157,8 +2163,7 @@ new Date();"))
`(,(gexp-input openjdk9) `(,(gexp-input openjdk9)
,(gexp-input openjdk9 "jdk"))))) ,(gexp-input openjdk9 "jdk")))))
(native-inputs (native-inputs
`(("gcc" ,gcc-9) ; FIXME: segmentation faults when using gcc-10. `(("openjdk9" ,openjdk9)
("openjdk9" ,openjdk9)
("openjdk9:jdk" ,openjdk9 "jdk") ("openjdk9:jdk" ,openjdk9 "jdk")
("make@4.2" ,gnu-make-4.2) ("make@4.2" ,gnu-make-4.2)
("unzip" ,unzip) ("unzip" ,unzip)
@ -2193,7 +2198,11 @@ new Date();"))
#:tests? #f; requires jtreg #:tests? #f; requires jtreg
;; TODO package jtreg ;; TODO package jtreg
#:configure-flags #: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" "--disable-warnings-as-errors"
;; make validate-runpath pass, see: http://issues.guix.info/issue/32894 ;; make validate-runpath pass, see: http://issues.guix.info/issue/32894
"--with-native-debug-symbols=zipped" "--with-native-debug-symbols=zipped"