summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorEfraim Flashner <[email protected]>2025-01-26 15:17:48 +0200
committerEfraim Flashner <[email protected]>2025-01-26 17:15:48 +0200
commit259a5085fbc81d53c827f009460fee7cd4849560 (patch)
tree7455b3fd4e19ac2891d396bd7ae881c533728f83 /gnu/packages/llvm.scm
parentbe058cf6fcf01be49e98b8a646e1ffdb34130db6 (diff)
gnu: llvm-18: Fix cross-building.
* gnu/packages/llvm.scm (llvm-18)[arguments]: When cross-building use an updated set of configure-flags. Change-Id: Ibe6a7798288c3899857c1ae2c94984b5a74fbbee
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm26
1 files changed, 25 insertions, 1 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index c910e5888b..0936897ea8 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2017 Roel Janssen <[email protected]>
;;; Copyright © 2018–2022 Marius Bakke <[email protected]>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
-;;; Copyright © 2018, 2021-2024 Efraim Flashner <[email protected]>
+;;; Copyright © 2018, 2021-2025 Efraim Flashner <[email protected]>
;;; Copyright © 2018 Tim Gesthuizen <[email protected]>
;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
;;; Copyright © 2019 Rutger Helling <[email protected]>
@@ -1518,6 +1518,30 @@ Library.")
(source (llvm-monorepo version))
(arguments
(substitute-keyword-arguments (package-arguments llvm-15)
+ ((#:modules modules '((guix build cmake-build-system)
+ (guix build utils)))
+ (if (%current-target-system)
+ `((ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ ,@modules)
+ modules))
+ ((#:configure-flags cf #~'())
+ (if (%current-target-system)
+ ;; Use a newer version of llvm-tblgen and add the new
+ ;; configure-flag needed for cross-building.
+ #~(cons* (string-append "-DLLVM_TABLEGEN="
+ #+(file-append this-package
+ "/bin/llvm-tblgen"))
+ (string-append "-DLLVM_NATIVE_TOOL_DIR="
+ #+(file-append this-package "/bin"))
+ (string-append "-DLLVM_HOST_TRIPLE="
+ #$(%current-target-system))
+ (remove
+ (cut string-match
+ "-DLLVM_(DEFAULT_TARGET|TARGET_ARCH|TABLEGEN).*" <>)
+ #$cf))
+ cf))
;; The build daemon goes OOM on i686-linux on this phase.
((#:phases phases #~'%standard-phases)
(if (target-x86-32?)