summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-06-16 19:25:08 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-06-16 19:42:02 +0300
commitab82dd3f58d7dfd88511705e871e9a41d9185aba (patch)
tree7b9203fd53ea6cfc3c515081138f00df442f5a20
parent3c7736f7456fb84a1917063b18cf5c41c935b4e0 (diff)
downloadguix-patches-ab82dd3f58d7dfd88511705e871e9a41d9185aba.tar
guix-patches-ab82dd3f58d7dfd88511705e871e9a41d9185aba.tar.gz
gnu: llvm-9: Fix building on riscv64-linux.
* gnu/packages/llvm.scm (llvm-12)[arguments]: Add a phase to update config.guess when config is one of the native-inputs. (llvm-10)[native-inputs]: Add config when building for riscv64-linux and the llvm version is less than 11.
-rw-r--r--gnu/packages/llvm.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 7b197bb67b..32625385ff 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -54,6 +54,7 @@
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages gcc)
#:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
@@ -741,6 +742,14 @@ of programming tools as well as libraries with equivalent functionality.")
#:build-type "Release"
#:phases
(modify-phases %standard-phases
+ ,@(if (assoc "config" (package-native-inputs this-package))
+ `((add-after 'unpack 'update-config
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (let ((config.guess (search-input-file
+ (or inputs native-inputs)
+ "/bin/config.guess")))
+ (copy-file config.guess "cmake/config.guess")))))
+ '())
(add-before 'build 'shared-lib-workaround
;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
;; doesn't seem to get the correct rpath to be able to run
@@ -825,7 +834,14 @@ of programming tools as well as libraries with equivalent functionality.")
(uri (llvm-uri "llvm" version))
(sha256
(base32
- "1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"))))))
+ "1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"))))
+ (native-inputs
+ `(("python" ,python-wrapper)
+ ("perl" ,perl)
+ ;; In llvm-11 riscv64 support was added manually to config.guess.
+ ,@(if (target-riscv64?)
+ `(("config" ,config))
+ '())))))
(define-public clang-runtime-10
(clang-runtime-from-llvm