From 8ff7139d6ef01e1470b8131058aa261cea17e935 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 26 Jan 2025 15:51:40 +0200 Subject: [PATCH] gnu: llvm-16: Fix cross-building. * gnu/packages/llvm.scm (llvm-16)[arguments]: When cross-building use an updated set of configure-flags. Change-Id: I1a09c3cb0a7a1104ab0704234a48487f1f5e82a7 --- gnu/packages/llvm.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 0936897ea8688a20af707b89c03123167945d586..64aaca35dc1bcc1e3fe4a8a3d648551fa19333d9 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1434,6 +1434,28 @@ 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")) + (remove + (cut string-match + "-DLLVM_TABLEGEN.*" <>) + #$cf)) + cf)) ;; The build daemon goes OOM on i686-linux on this phase. ((#:phases phases #~'%standard-phases) (if (target-x86-32?)