gnu: ghc: Use a LibFFI variant without static trampolines.

* gnu/packages/haskell.scm (ghc-7, ghc-8.0, ghc-8.4)[inputs]: Change from
LIBFFI to LIBFFI-SANS-STATIC-TRAMPOLINES.
* gnu/packages/libffi.scm (libffi-sans-static-trampolines): New variable.
This commit is contained in:
Marius Bakke 2022-08-11 19:02:53 +02:00
parent 121f6e0b0c
commit 4620080578
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
2 changed files with 26 additions and 3 deletions

View File

@ -423,7 +423,11 @@ libraries are included in this package.")
(inputs
`(("gmp" ,gmp)
("ncurses" ,ncurses)
("libffi" ,libffi)
;; Use a LibFFI variant without static trampolines to work around
;; <https://gitlab.haskell.org/ghc/ghc/-/issues/20051>.
("libffi" ,libffi-sans-static-trampolines)
("ghc-testsuite"
,(origin
(method url-fetch)
@ -597,7 +601,11 @@ interactive environment for the functional language Haskell.")
(inputs
`(("gmp" ,gmp)
("ncurses" ,ncurses)
("libffi" ,libffi)
;; Use a LibFFI variant without static trampolines to work around
;; <https://gitlab.haskell.org/ghc/ghc/-/issues/20051>.
("libffi" ,libffi-sans-static-trampolines)
("ghc-testsuite"
,(origin
(method url-fetch)
@ -696,7 +704,9 @@ interactive environment for the functional language Haskell.")
(sha256
(base32 "1ch4j2asg7pr52ai1hwzykxyj553wndg7wq93i47ql4fllspf48i"))))
(inputs
(list gmp ncurses libffi))
;; Note: GHC < 9 requires LibFFI < 3.4, or a variant without static
;; trampolines.
(list gmp ncurses libffi-sans-static-trampolines))
(native-inputs
`(("perl" ,perl)
("python" ,python) ; for tests

View File

@ -28,8 +28,10 @@
#:use-module (gnu packages)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (gnu packages check)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
@ -78,6 +80,17 @@ conversions for values passed between the two languages.")
;; See <https://github.com/atgreen/libffi/blob/master/LICENSE>.
(license expat)))
;; Provide a variant without static trampolines as some packages
;; (particularly GHC < 9) cannot handle them. See
;; <https://github.com/libffi/libffi/pull/647> for a discussion.
(define-public libffi-sans-static-trampolines
(hidden-package
(package/inherit libffi
(arguments
(substitute-keyword-arguments (package-arguments libffi)
((#:configure-flags flags #~'())
#~(append #$flags '("--disable-exec-static-tramp"))))))))
(define-public python-cffi
(package
(name "python-cffi")