guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/08: gnu: llvm-19: Fix cross-building.


From: guix-commits
Subject: 04/08: gnu: llvm-19: Fix cross-building.
Date: Sun, 26 Jan 2025 10:17:17 -0500 (EST)

efraim pushed a commit to branch master
in repository guix.

commit b821b3bedcfe69d3483d86408a3159b8338b7c61
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Jan 26 15:52:35 2025 +0200

    gnu: llvm-19: Fix cross-building.
    
    * gnu/packages/llvm.scm (llvm-19)[arguments]: When cross-building use an
    updated set of configure-flags.
    
    Change-Id: If29af878c3941aa994850e55c00cd818aab61f49
---
 gnu/packages/llvm.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 4307d4e909..5e7d927739 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1630,6 +1630,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?)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]