From d9f8d58c0249b28efd96550a9b46de69c43b6e2a Mon Sep 17 00:00:00 2001 From: Liliana Prikler Date: Thu, 9 Sep 2021 15:32:20 +0200 Subject: [PATCH v4 1/2] gnu: lld: Update to 12.0.1. * gnu/packages/llvm.scm (llvm-subprojects-origin, %llvm-project-12-hash): New variables. (lld-11, lld-12): New variables. (lld): Point to lld-11. --- gnu/packages/llvm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index de964b020d..542a553400 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -93,6 +93,22 @@ as \"x86_64-linux\"." (string-append "https://github.com/llvm/llvm-project/releases/download" "/llvmorg-" version "/" component "-" version ".src.tar.xz")) +(define* (llvm-subprojects-origin components version base32-hash + #:optional (patches '())) + (origin + (method url-fetch) + (uri (llvm-uri "llvm-project" version)) + (sha256 base32-hash) + (patches (map search-patch patches)) + (modules '((guix build utils) + (ice-9 ftw))) + (snippet + `(for-each + (lambda (file) + (unless (member file '("." ".." ,@components)) + (delete-file-recursively file))) + (scandir "."))))) + (define* (clang-runtime-from-llvm llvm hash #:optional (patches '())) (package @@ -918,7 +934,7 @@ of programming tools as well as libraries with equivalent functionality.") ,@(package-properties llvm-12))))) -(define-public lld +(define-public lld-11 (package (name "lld") (version "11.0.0") @@ -942,6 +958,32 @@ of programming tools as well as libraries with equivalent functionality.") components which highly leverage existing libraries in the larger LLVM Project.") (license license:asl2.0))) ; With LLVM exception +(define %llvm-project-12-hash + (base32 "03ps7akvbkxxa4xzal49v7lw3bz41zmjsp6fa7cslxrns5fb570j")) + +(define-public lld-12 + (package + (inherit lld-11) + (version "12.0.1") + (source (llvm-subprojects-origin '("lld" "libunwind") version + %llvm-project-12-hash)) + (arguments + `(,@(package-arguments lld-11) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'dissect + (lambda _ + ;; Find libunwind in unpacked sources + (substitute* "lld/MachO/CMakeLists.txt" + (("\\$\\{LLVM_MAIN_SRC_DIR\\}/\\.\\./libunwind") + (string-append (getcwd) "/libunwind"))) + ;; chdir to actual source folder + (chdir "lld")))))) + (inputs + `(("llvm" ,llvm-12))))) + +(define-public lld lld-11) + (define-public lldb (package (name "lldb") -- 2.33.0