summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-21 23:39:43 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-21 23:39:43 -0400
commita9429c8f2207841c649438187d6e19046d323a16 (patch)
treea06e4b8a87b6a42742cf6750276746a10b6c2139 /gnu/packages/llvm.scm
parentf0136b36ae8c1e9c174043bd50e0e24413c0f345 (diff)
parent49b350fafc2c3ea1db66461b73d4e304cd13ec92 (diff)
Merge branch 'staging' into core-updates.
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm123
1 files changed, 48 insertions, 75 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 83f57ec28e..eb949bed1b 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -99,8 +100,13 @@ as \"x86_64-linux\"."
("i586" => "X86"))))
(define (llvm-uri component version)
+ ;; LLVM release candidate file names are formatted 'tool-A.B.C-rcN/tool-A.B.CrcN.src.tar.xz'
+ ;; so we specify the version as A.B.C-rcN and delete the hyphen when referencing the file name.
(string-append "https://github.com/llvm/llvm-project/releases/download"
- "/llvmorg-" version "/" component "-" version ".src.tar.xz"))
+ "/llvmorg-" version "/" component "-" (string-delete #\- version) ".src.tar.xz"))
+
+(define %llvm-release-monitoring-url
+ "https://github.com/llvm/llvm-project/releases")
(define* (clang-runtime-from-llvm llvm hash
#:optional (patches '()))
@@ -150,6 +156,8 @@ functions for C and C++ programs. It also provides header files that allow C
and C++ source code to interface with the \"sanitization\" passes of the clang
compiler. In LLVM this library is called \"compiler-rt\".")
(license (package-license llvm))
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
+ (upstream-name . "compiler-rt")))
;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
(supported-systems (delete "mips64el-linux" %supported-systems))))
@@ -157,7 +165,9 @@ compiler. In LLVM this library is called \"compiler-rt\".")
(define* (clang-from-llvm llvm clang-runtime hash
#:key (patches '()) tools-extra
(properties
- (clang-properties (package-version llvm))))
+ (append `((release-monitoring-url
+ . ,%llvm-release-monitoring-url))
+ (clang-properties (package-version llvm)))))
"Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the
given PATCHES. When TOOLS-EXTRA is given, it must point to the
'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace',
@@ -178,7 +188,6 @@ given PATCHES. When TOOLS-EXTRA is given, it must point to the
;; doesn't seem to be any way to do this with clang's autotools-based
;; build system.
(build-system cmake-build-system)
- (outputs (if tools-extra '("out" "extra") '("out")))
(native-inputs (package-native-inputs llvm))
(inputs
`(("libxml2" ,libxml2)
@@ -216,59 +225,12 @@ given PATCHES. When TOOLS-EXTRA is given, it must point to the
(invoke "tar" "xf" extra)
(rename-file ,(string-append
"clang-tools-extra-"
- (package-version llvm)
+ (string-delete #\- (package-version llvm))
".src")
"tools/extra")
- #t)))
- (add-after 'install 'move-extra-tools
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Move the extra tools to the "extra" output.
- ;; These programs alone weigh in at 296 MiB,
- ;; because they statically-link a whole bunch of
- ;; Clang libraries.
- (let* ((out (assoc-ref outputs "out"))
- (extra (assoc-ref outputs "extra"))
- (bin (string-append out "/bin"))
- (bin* (string-append extra "/bin"))
- (lib (string-append out "/lib")))
- (define (move program)
- (rename-file (string-append bin "/" program)
- (string-append bin* "/"
- program)))
-
- (mkdir-p bin*)
- (for-each move
- '("clang-apply-replacements"
- "clang-change-namespace"
- "clangd"
- "clang-doc"
- "clang-include-fixer"
- "clang-move"
- "clang-query"
- "clang-reorder-fields"
- "clang-tidy"
- "find-all-symbols"
- "modularize"
- "pp-trace"))
-
- ;; Remove MiBs of .a files coming from
- ;; 'clang-tools-extra'.
- (for-each (lambda (component)
- (delete-file
- (string-append lib "/libclang"
- component ".a")))
- '("ApplyReplacements"
- "ChangeNamespace"
- "Daemon"
- "DaemonTweaks"
- "Doc"
- "IncludeFixer"
- "IncludeFixerPlugin"
- "Move"))
- (for-each delete-file
- (find-files
- lib
- "^(libfindAllSymbols|libclangTidy)"))
+ ;; Build and link to shared libraries.
+ (substitute* "cmake/modules/AddClang.cmake"
+ (("BUILD_SHARED_LIBS") "True"))
#t))))
'())
(add-after 'unpack 'add-missing-triplets
@@ -560,14 +522,14 @@ output), and Binutils.")
(define-public llvm-13
(package
(name "llvm")
- (version "13.0.0")
+ (version "13.0.1")
(source
(origin
(method url-fetch)
(uri (llvm-uri "llvm" version))
(sha256
(base32
- "081h2vw757j5xjg2441539j2vhfzzihrgxwza5pq5sj3hrq133a0"))))
+ "0d681xiixmx9inwvz14vi3xsznrcryk06a8rvk9cljiq5kc80szc"))))
(build-system cmake-build-system)
(outputs '("out" "opt-viewer"))
(native-inputs
@@ -621,16 +583,17 @@ languages. It currently supports compilation of C and C++ programs, using
front-ends derived from GCC 4.0.1. A new front-end for the C family of
languages is in development. The compiler infrastructure includes mirror sets
of programming tools as well as libraries with equivalent functionality.")
- (license license:asl2.0)))
+ (license license:asl2.0)
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))))
(define-public clang-runtime-13
(clang-runtime-from-llvm
llvm-13
- "0gyvfhnypfmlf7hdgkiz2wh2lgk4nz26aqf361msjs3qdkbh4djc"))
+ "1z2xr9nn4mgc3hn9ark2k5y4wznpk47xppkp63bcbagr6589acvv"))
(define-public clang-13
(clang-from-llvm llvm-13 clang-runtime-13
- "0zp1p6syii5iajm8v2c207s80arv00yz5ckfwimn5dng0sxiqqax"
+ "1j8pr5kk8iqyb4jds3yl7c6x672617h4ngkpl4575j7mk4nrwykq"
#:patches '("clang-13.0-libc-search-path.patch")
#:tools-extra
(origin
@@ -639,7 +602,7 @@ of programming tools as well as libraries with equivalent functionality.")
(package-version llvm-13)))
(sha256
(base32
- "1mgalgdgxlxi08yxw7k6yh4iia1bpjmjgn7mrpqas8lbl9h612s2")))))
+ "1l4jjdqfl9hrh0fwzv27hc263zc6x61h09vs4ni3yla8i1cwhayc")))))
(define-public clang-toolchain-13
(make-clang-toolchain clang-13))
@@ -1038,10 +1001,10 @@ of programming tools as well as libraries with equivalent functionality.")
#:patches '("clang-3.5-libc-search-path.patch")))
;; Default LLVM and Clang version.
-(define-public llvm llvm-9)
-(define-public clang-runtime clang-runtime-9)
-(define-public clang clang-9)
-(define-public clang-toolchain clang-toolchain-9)
+(define-public llvm llvm-13)
+(define-public clang-runtime clang-runtime-13)
+(define-public clang clang-13)
+(define-public clang-toolchain clang-toolchain-13)
(define-public llvm-for-rocm
(package
@@ -1106,18 +1069,19 @@ of programming tools as well as libraries with equivalent functionality.")
(synopsis "LLVM libunwind header files")
(description
"This package contains header files for the LLVM C++ unwinding library.")
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
(license license:asl2.0))) ;with LLVM exceptions
(define-public lld
(package
(name "lld")
- (version "13.0.0")
+ (version "13.0.1")
(source (origin
(method url-fetch)
(uri (llvm-uri "lld" version))
(sha256
(base32
- "11lkwv4jy35z2f3zcpv7hbbk9v9gpavfvxlif8265zv4rl5r1l90"))))
+ "1yscckcszfr234k4svhybdbsnz6w65x8pldl6c2nhyxzx12zfsk6"))))
(build-system cmake-build-system)
(native-inputs
;; Note: check <https://bugs.llvm.org/show_bug.cgi?id=49228> to see
@@ -1134,6 +1098,7 @@ of programming tools as well as libraries with equivalent functionality.")
(synopsis "Linker from the LLVM project")
(description "LLD is a high-performance linker, built as a set of reusable
components which highly leverage existing libraries in the larger LLVM Project.")
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
(license license:asl2.0))) ; With LLVM exception
(define-public lld-12
@@ -1192,21 +1157,21 @@ misuse of libraries outside of the store.")
(define-public lldb
(package
(name "lldb")
- (version "12.0.1")
+ (version "13.0.1")
(source (origin
(method url-fetch)
(uri (llvm-uri "lldb" version))
(sha256
(base32
- "0g3pj1m3chafavpr35r9fynm85y2hdyla6klj0h28khxs2613i78"))))
+ "05nvcbgb4rx860r3jzsbpvcbzpd0i7nsm5qrpkyfhg5vrh5mj32a"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags '("-DCMAKE_CXX_COMPILER=clang++")))
(native-inputs
(list pkg-config swig))
(inputs
- (list clang-12
- llvm-12
+ (list clang-13
+ llvm-13
;; Optional (but recommended) inputs.
ncurses
libedit
@@ -1219,6 +1184,7 @@ misuse of libraries outside of the store.")
(description
"LLDB is a high performance debugger built as a set of reusable components
which highly leverage existing libraries in the larger LLVM project.")
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
(license license:asl2.0))) ;with LLVM exceptions
(define-public libcxx
@@ -1257,6 +1223,7 @@ which highly leverage existing libraries in the larger LLVM project.")
(description
"This package provides an implementation of the C++ standard library for
use with Clang, targeting C++11, C++14 and above.")
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
(license license:expat)))
;; Libcxx files specifically used by PySide2.
@@ -1389,7 +1356,7 @@ standard C++ library.")
(add-after 'unpack 'chdir
(lambda _ (chdir "libclc") #t)))))
(native-inputs
- (list clang llvm python))
+ (list clang-9 llvm-9 python))
(home-page "https://libclc.llvm.org")
(synopsis "Libraries for the OpenCL programming language")
(description
@@ -1401,13 +1368,13 @@ requirements according to version 1.1 of the OpenCL specification.")
(define-public libomp
(package
(name "libomp")
- (version "9.0.1")
+ (version "13.0.1")
(source (origin
(method url-fetch)
(uri (llvm-uri "openmp" version))
(sha256
(base32
- "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"))
+ "0kvbr4j6ldpssiv7chgqra5y77n7jwbyxlwcl7z32v31f49jcybb"))
(file-name (string-append "libomp-" version ".tar.xz"))))
(build-system cmake-build-system)
;; XXX: Note this gets built with GCC because building with Clang itself
@@ -1415,10 +1382,14 @@ requirements according to version 1.1 of the OpenCL specification.")
(arguments
'(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
"-DOPENMP_TEST_C_COMPILER=clang"
- "-DOPENMP_TEST_CXX_COMPILER=clang++")
+ "-DOPENMP_TEST_CXX_COMPILER=clang++"
+
+ ;; Work around faulty target detection, fixed in 14:
+ ;; https://github.com/llvm/llvm-project/issues/52910
+ "-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF")
#:test-target "check-libomp"))
(native-inputs
- (list clang llvm perl pkg-config))
+ (list clang llvm perl pkg-config python))
(inputs
(list `(,hwloc "lib")))
(home-page "https://openmp.llvm.org")
@@ -1428,6 +1399,8 @@ requirements according to version 1.1 of the OpenCL specification.")
project for the OpenMP multi-theaded programming extension. This package
notably provides @file{libgomp.so}, which is has a binary interface compatible
with that of libgomp, the GNU Offloading and Multi Processing Library.")
+ (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
+ (upstream-name . "openmp")))
(license license:expat)))
(define-public python-llvmlite