summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm784
1 files changed, 150 insertions, 634 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index dd4f0ef791..03c3c47e9e 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -17,7 +17,7 @@
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2020-2022, 2024-2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020-2022, 2024-2025 Maxim Cournoyer <maxim@guixotic.coop>
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
@@ -29,6 +29,7 @@
;;; Copyright © 2023-2025 Zheng Junjie <z572@z572.online>
;;; Copyright © 2024, 2025 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2025 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2025 Liam Hupfer <liam@hpfr.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -68,6 +69,7 @@
#:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
#:use-module (gnu packages check) ;python-lit
#:use-module (gnu packages compression)
+ #:use-module (gnu packages file)
#:use-module (gnu packages libedit)
#:use-module (gnu packages libffi)
#:use-module (gnu packages linux)
@@ -159,7 +161,10 @@ as \"x86_64-linux\"."
(llvm-monorepo (package-version llvm))))
(build-system cmake-build-system)
(native-inputs
- (cond ((version>=? version "19")
+ (cond ((version>=? version "21")
+ (modify-inputs (package-native-inputs llvm)
+ (prepend gcc-15)))
+ ((version>=? version "19")
(package-native-inputs llvm))
((version>=? version "18")
;; clang-18.1.8 doesn't build with gcc-14
@@ -581,7 +586,8 @@ output), and Binutils.")
("17.0.6" . "1a7rq3rgw5vxm8y39fyzr4kv7w97lli4a0c1qrkchwk8p0n07hgh")
("18.1.8" . "1l9wm0g9jrpdf309kxjx7xrzf13h81kz8bbp0md14nrz38qll9la")
("19.1.7" . "18hkfhsm88bh3vnj21q7f118vrcnf7z6q1ylnwbknyb3yvk0343i")
- ("20.1.8" . "0v0lwf58i96vcwsql3hlgy72z3ncfvqwgyghyn26m2ri8vy83k6a")))
+ ("20.1.8" . "0v0lwf58i96vcwsql3hlgy72z3ncfvqwgyghyn26m2ri8vy83k6a")
+ ("21.1.1" . "01xf0yl9xf1f29v2afyzs0rl4sqa7n7wd5bdv4qgih8cnbfmj7r0")))
(define %llvm-patches
'(("14.0.6" . ("clang-14.0-libc-search-path.patch"
@@ -598,6 +604,8 @@ output), and Binutils.")
("19.1.7" . ("clang-18.0-libc-search-path.patch"
"clang-17.0-link-dsymutil-latomic.patch"))
("20.1.8" . ("clang-18.0-libc-search-path.patch"
+ "clang-17.0-link-dsymutil-latomic.patch"))
+ ("21.1.1" . ("clang-18.0-libc-search-path.patch"
"clang-17.0-link-dsymutil-latomic.patch"))))
(define (llvm-monorepo version)
@@ -621,7 +629,8 @@ output), and Binutils.")
(outputs '("out" "opt-viewer"))
(arguments
(list
- #:tests? (not (target-x86-32?))
+ #:tests? (not (or (%current-target-system)
+ (target-x86-32?)))
#:configure-flags
#~(list
;; These options are required for cross-compiling LLVM according
@@ -716,7 +725,8 @@ of programming tools as well as libraries with equivalent functionality.")
#:modules '((guix build cmake-build-system)
((guix build gnu-build-system) #:prefix gnu:)
(guix build utils))
- #:tests? (not (target-x86-32?))
+ #:tests? (not (or (%current-target-system)
+ (target-x86-32?)))
#:configure-flags
#~(list
;; These options are required for cross-compiling LLVM according
@@ -889,6 +899,12 @@ Library.")
(patches (search-patches "llvm-13-gcc-14.patch"))))
(arguments
(substitute-keyword-arguments (package-arguments llvm-14)
+ ((#:tests? _ #t)
+ ;; The tests on riscv64 error on the differences between
+ ;; generic and generic-rv64.
+ (not (or (%current-target-system)
+ (target-x86-32?)
+ (target-riscv64?))))
((#:phases phases '%standard-phases)
#~(modify-phases #$phases
(delete 'change-directory)))))
@@ -1024,478 +1040,6 @@ Library.")
(define-public clang-toolchain-12
(make-clang-toolchain clang-12 libomp-12))
-(define-public llvm-11
- (package
- (inherit llvm-12)
- (version "11.1.0")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (patches (search-patches "llvm-8-missing-include.patch"
- "llvm-10-missing-include.patch"))
- (sha256
- (base32
- "199yq3a214avcbi4kk2q0ajriifkvsr0l2dkx3a666m033ihi1ff"))))))
-
-(define-public clang-runtime-11
- (clang-runtime-from-llvm
- llvm-11
- "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"
- '("clang-runtime-13-glibc-2.36-compat.patch")))
-
-(define-public clang-11
- (clang-from-llvm llvm-11 clang-runtime-11
- "12sm91qx2m79cvj75a9aazf2x8xybjbd593dv6v7rxficpq8i0ha"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-11.0-libc-search-path.patch")
- #:tools-extra
- (origin
- (method url-fetch)
- (uri (llvm-uri "clang-tools-extra"
- (package-version llvm-11)))
- (sha256
- (base32
- "18n1w1hkv931xzq02b34wglbv6zd6sd0r5kb8piwvag7klj7qw3n")))))
-
-(define-public libomp-11
- (package
- (inherit libomp-12)
- (version (package-version llvm-11))
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "openmp" version))
- (sha256
- (base32
- "0bh5cswgpc79awlq8j5i7hp355adaac7s6zaz0zwp6mkflxli1yi"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-12)
- (replace "clang" clang-11)
- (replace "llvm" llvm-11)))))
-
-(define-public clang-toolchain-11
- (make-clang-toolchain clang-11 libomp-11))
-
-(define-public llvm-10
- (package
- (inherit llvm-11)
- (version "10.0.1")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (patches (search-patches "llvm-8-missing-include.patch"
- "llvm-10-missing-include.patch"))
- (sha256
- (base32
- "1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"))))
- (native-inputs
- `(("python" ,python-wrapper)
- ("perl" ,perl)
- ;; In llvm-11 riscv64 support was added manually to config.guess.
- ,@(if (target-riscv64?)
- `(("config" ,config))
- '())))))
-
-(define-public clang-runtime-10
- (clang-runtime-from-llvm
- llvm-10
- "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"
- '("clang-runtime-13-glibc-2.36-compat.patch")))
-
-(define-public clang-10
- (clang-from-llvm llvm-10 clang-runtime-10
- "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-10.0-libc-search-path.patch")
- #:tools-extra
- (origin
- (method url-fetch)
- (uri (llvm-uri "clang-tools-extra"
- (package-version llvm-10)))
- (sha256
- (base32
- "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh")))))
-
-(define-public libomp-10
- (package
- (inherit libomp-11)
- (version (package-version llvm-10))
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "openmp" version))
- (sha256
- (base32
- "0i4bn84lkpm5w3qkpvwm5z6jdj8fynp7d3bcasa1xyq4is6757yi"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-11)
- (replace "clang" clang-10)
- (replace "llvm" llvm-10)))))
-
-(define-public clang-toolchain-10
- (make-clang-toolchain clang-10 libomp-10))
-
-(define-public llvm-9
- (package
- (inherit llvm-10)
- (version "9.0.1")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880"))
- (patches (search-patches
- "llvm-8-missing-include.patch"
- "llvm-9-fix-bitcast-miscompilation.patch"
- "llvm-9-fix-scev-miscompilation.patch"
- "llvm-9-fix-lpad-miscompilation.patch"))))
- (arguments
- (if (target-riscv64?)
- (substitute-keyword-arguments (package-arguments llvm-10)
- ((#:phases phases)
- #~(modify-phases #$phases
- (add-after 'unpack 'patch-dsymutil-link
- (lambda _
- (substitute* "tools/dsymutil/CMakeLists.txt"
- (("endif\\(APPLE\\)")
- (string-append
- "endif(APPLE)\n\n"
- "if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES \"riscv64\")\n"
- " target_link_libraries(dsymutil PRIVATE atomic)\n"
- "endif()"))))))))
- (package-arguments llvm-10)))))
-
-(define-public clang-runtime-9
- (clang-runtime-from-llvm
- llvm-9
- "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"
- '("clang-runtime-9-libsanitizer-mode-field.patch"
- "clang-runtime-9-glibc-2.36-compat.patch")))
-
-(define-public clang-9
- (clang-from-llvm llvm-9 clang-runtime-9
- "0ls2h3iv4finqyflyhry21qhc9cm9ga7g1zq21020p065qmm2y2p"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-9.0-libc-search-path.patch")))
-
-(define-public libomp-9
- (package
- (inherit libomp-10)
- (version (package-version llvm-9))
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "openmp" version))
- (sha256
- (base32
- "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-10)
- (replace "clang" clang-9)
- (replace "llvm" llvm-9)))))
-
-(define-public clang-toolchain-9
- (make-clang-toolchain clang-9 libomp-9))
-
-(define-public llvm-8
- (package
- (inherit llvm-9)
- (version "8.0.1")
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "1rvm5gqp5v8hfn17kqws3zhk94w4kxndal12bqa0y57p09nply24"))
- (patches (search-patches "llvm-8-fix-build-with-gcc-10.patch"
- "llvm-8-missing-include.patch"))))
- (license license:ncsa)))
-
-(define-public clang-runtime-8
- (clang-runtime-from-llvm
- llvm-8
- "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"
- '("clang-runtime-9-libsanitizer-mode-field.patch"
- "clang-runtime-9-glibc-2.36-compat.patch")))
-
-(define-public clang-8
- (clang-from-llvm llvm-8 clang-runtime-8
- "0ihnbdl058gvl2wdy45p5am55bq8ifx8m9mhcsgj9ax8yxlzvvvh"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-8.0-libc-search-path.patch")))
-
-(define-public libomp-8
- (package
- (inherit libomp-9)
- (version (package-version llvm-8))
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "openmp" version))
- (sha256
- (base32
- "0b3jlxhqbpyd1nqkpxjfggm5d9va5qpyf7d4i5y7n4a1mlydv19y"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-9)
- (replace "clang" clang-8)
- (replace "llvm" llvm-8)))
- (license license:ncsa)))
-
-(define-public clang-toolchain-8
- (make-clang-toolchain clang-8 libomp-8))
-
-(define-public llvm-7
- (package
- (inherit llvm-8)
- (version "7.1.0")
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v"))))))
-
-(define-public clang-runtime-7
- (clang-runtime-from-llvm
- llvm-7
- "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"
- '("clang-runtime-9-libsanitizer-mode-field.patch"
- "clang-runtime-9-glibc-2.36-compat.patch")))
-
-(define-public clang-7
- (clang-from-llvm llvm-7 clang-runtime-7
- "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-7.0-libc-search-path.patch")))
-
-(define-public libomp-7
- (package
- (inherit libomp-8)
- (version (package-version llvm-7))
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "openmp" version))
- (sha256
- (base32
- "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-8)
- (replace "clang" clang-7)
- (replace "llvm" llvm-7)))))
-
-(define-public clang-toolchain-7
- (make-clang-toolchain clang-7 libomp-7))
-
-(define-public llvm-6
- (package
- (inherit llvm-7)
- (version "6.0.1")
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))
- (arguments
- (substitute-keyword-arguments (package-arguments llvm-7)
- ((#:phases phases)
- #~(modify-phases #$phases
- (delete 'delete-failing-tests)))))))
-
-(define-public clang-runtime-6
- (clang-runtime-from-llvm
- llvm-6
- "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"
- '("clang-runtime-9-libsanitizer-mode-field.patch"
- "clang-runtime-9-glibc-2.36-compat.patch")))
-
-(define-public clang-6
- (clang-from-llvm llvm-6 clang-runtime-6
- "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-6.0-libc-search-path.patch")))
-
-(define-public libomp-6
- (package
- (inherit libomp-7)
- (version (package-version llvm-6))
- (source (origin
- (method url-fetch)
- (uri (string-append "https://releases.llvm.org/"
- version "/openmp-" version
- ".src.tar.xz"))
- (sha256
- (base32
- "0nhwfba9c351r16zgyjyfwdayr98nairky3c2f0b2lc360mwmbv6"))
- (file-name (string-append "libomp-" version ".tar.xz"))))
- (native-inputs
- (modify-inputs (package-native-inputs libomp-7)
- (replace "clang" clang-6)
- (replace "llvm" llvm-6)))))
-
-(define-public clang-toolchain-6
- (make-clang-toolchain clang-6 libomp-6))
-
-(define-public llvm-3.9.1
- (package (inherit llvm-6)
- (name "llvm")
- (version "3.9.1")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))
- (outputs '("out"))
- (arguments
- (substitute-keyword-arguments (package-arguments llvm-6)
- ((#:phases phases)
- #~(modify-phases #$phases
- (add-before 'build 'shared-lib-workaround
- ;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
- ;; doesn't seem to get the correct rpath to be able to run
- ;; from the build directory. Set LD_LIBRARY_PATH as a
- ;; workaround.
- (lambda _
- (setenv "LD_LIBRARY_PATH"
- (string-append (getcwd) "/lib"))))
- (delete 'install-opt-viewer)))))))
-
-(define-public clang-runtime-3.9.1
- (clang-runtime-from-llvm
- llvm-3.9.1
- "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
- '("clang-runtime-3.9-libsanitizer-mode-field.patch"
- "clang-runtime-asan-build-fixes.patch"
- "clang-runtime-esan-build-fixes.patch"
- "clang-3.5-libsanitizer-ustat-fix.patch")))
-
-(define-public clang-3.9.1
- (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
- "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-3.8-libc-search-path.patch")))
-
-(define-public llvm-3.8
- (package (inherit llvm-3.9.1)
- (name "llvm")
- (version "3.8.1")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))
- (patches (search-patches "llvm-3.x.1-fix-build-with-gcc.patch"))))))
-
-(define-public clang-runtime-3.8
- (clang-runtime-from-llvm
- llvm-3.8
- "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
- '("clang-runtime-asan-build-fixes.patch"
- "clang-runtime-3.8-libsanitizer-mode-field.patch"
- "clang-3.5-libsanitizer-ustat-fix.patch")))
-
-(define-public clang-3.8
- (clang-from-llvm llvm-3.8 clang-runtime-3.8
- "1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-3.8-libc-search-path.patch")))
-
-(define-public llvm-3.7
- (package (inherit llvm-3.8)
- (version "3.7.1")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (sha256
- (base32
- "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))
- (patches (search-patches "llvm-3.x.1-fix-build-with-gcc.patch"))))))
-
-(define-public clang-runtime-3.7
- (clang-runtime-from-llvm
- llvm-3.7
- "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
- '("clang-runtime-asan-build-fixes.patch"
- "clang-runtime-3.8-libsanitizer-mode-field.patch"
- "clang-3.5-libsanitizer-ustat-fix.patch"
- "clang-runtime-3.7-fix-build-with-python3.patch")))
-
-(define-public clang-3.7
- (clang-from-llvm llvm-3.7 clang-runtime-3.7
- "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-3.5-libc-search-path.patch")))
-
-(define-public llvm-3.6
- (package (inherit llvm-3.7)
- (version "3.6.2")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (patches
- (search-patches "llvm-3.6-fix-build-with-gcc-10.patch"))
- (sha256
- (base32
- "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
-
-(define-public llvm-3.5
- (package (inherit llvm-3.6)
- (version "3.5.2")
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "llvm" version))
- (patches
- (search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
- (sha256
- (base32
- "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
-
-(define-public clang-runtime-3.5
- (let ((runtime (clang-runtime-from-llvm
- llvm-3.5
- "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
- '("clang-runtime-asan-build-fixes.patch"
- "clang-runtime-3.5-libsanitizer-mode-field.patch"
- "clang-3.5-libsanitizer-ustat-fix.patch"))))
- (package/inherit runtime
- (arguments
- (substitute-keyword-arguments (package-arguments runtime)
- ((#:phases phases '%standard-phases)
- `(modify-phases ,phases
- ;; glibc no longer includes rpc/xdr.h, so we use the headers from
- ;; libtirpc.
- (add-after 'unpack 'find-rpc-includes
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "CPATH"
- (string-append
- (search-input-directory inputs "/include/tirpc")
- ":" (or (getenv "CPATH") "")))
- (setenv "CPLUS_INCLUDE_PATH"
- (string-append
- (search-input-directory inputs "/include/tirpc")
- ":" (or (getenv "CPLUS_INCLUDE_PATH") "")))))))))
- (inputs
- `(("libtirpc" ,libtirpc)
- ("llvm" ,llvm-3.5))))))
-
-(define-public clang-3.5
- (clang-from-llvm llvm-3.5 clang-runtime-3.5
- "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
- #:legacy-build-shared-libs? #t
- #:patches '("clang-3.5-libc-search-path.patch")))
-
(define-public llvm-16
(make-llvm "16.0.6"))
@@ -1686,6 +1230,37 @@ Library.")
(define-public clang-toolchain-20
(make-clang-toolchain clang-20 libomp-20))
+(define-public llvm-21
+ (make-llvm "21.1.1"))
+
+(define-public clang-runtime-21
+ (clang-runtime-from-llvm llvm-21))
+
+(define-public clang-21
+ (clang-from-llvm
+ llvm-21 clang-runtime-21
+ #:tools-extra
+ (origin
+ (method url-fetch)
+ (uri (llvm-uri "clang-tools-extra"
+ (package-version llvm-21)))
+ (sha256
+ (base32
+ "0sv0snykw4zl45apj9dfm5yrs8grhmmmnss7nmg5ab8v9n52zpl0")))))
+
+(define-public libomp-21
+ (package
+ (inherit libomp-15)
+ (version (package-version llvm-21))
+ (source (llvm-monorepo version))
+ (native-inputs
+ (modify-inputs (package-native-inputs libomp-15)
+ (replace "clang" clang-21)
+ (replace "llvm" llvm-21)))))
+
+(define-public clang-toolchain-21
+ (make-clang-toolchain clang-21 libomp-21))
+
;; Default LLVM and Clang version.
(define-public libomp libomp-13)
(define-public llvm llvm-13)
@@ -1718,7 +1293,14 @@ Library.")
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
"-DLLVM_VERSION_SUFFIX="))))
(properties `((hidden? . #t)
- ,@(package-properties llvm-19)))))
+ ,@(package-properties llvm-19)))
+ (home-page "https://github.com/ROCm/llvm-project")
+ (synopsis
+ (string-append (package-synopsis llvm-19) " (AMD fork)"))
+ (description
+ (string-append (package-description llvm-19) "
+
+This AMD fork includes AMD-specific additions."))))
@@ -1817,19 +1399,6 @@ components which highly leverage existing libraries in the larger LLVM Project."
(inputs (modify-inputs (package-inputs lld)
(replace "llvm" llvm-12)))))
-(define-public lld-11
- (package
- (inherit lld-12)
- (version "11.0.0")
- (source (origin
- (method url-fetch)
- (uri (llvm-uri "lld" version))
- (sha256
- (base32
- "077xyh7sij6mhp4dc4kdcmp9whrpz332fa12rwxnzp3wgd5bxrzg"))))
- (inputs (modify-inputs (package-inputs lld)
- (replace "llvm" llvm-11)))))
-
(define-public lld-16
(package
(inherit lld-15)
@@ -1865,6 +1434,13 @@ components which highly leverage existing libraries in the larger LLVM Project."
(source (llvm-monorepo version))
(inputs (list llvm-20))))
+(define-public lld-21
+ (package
+ (inherit lld-15)
+ (version (package-version llvm-21))
+ (source (llvm-monorepo version))
+ (inputs (list llvm-21))))
+
(define-public lld lld-14)
(define* (make-lld-wrapper lld #:key lld-as-ld?)
@@ -1904,9 +1480,6 @@ misuse of libraries outside of the store.")))
(make-lld-wrapper lld))
;;; A LLD wrapper that can be used as a (near) drop-in replacement to GNU ld.
-(define-public lld-as-ld-wrapper-15
- (make-lld-wrapper lld-15 #:lld-as-ld? #t))
-
(define-public lld-as-ld-wrapper-18
(make-lld-wrapper lld-18 #:lld-as-ld? #t))
@@ -1916,7 +1489,7 @@ misuse of libraries outside of the store.")))
(define-public lldb
(package
(name "lldb")
- (version (package-version llvm-20))
+ (version (package-version llvm-21))
(source (llvm-monorepo version))
(build-system cmake-build-system)
(arguments
@@ -1932,8 +1505,8 @@ misuse of libraries outside of the store.")))
(native-inputs
(list pkg-config swig))
(inputs
- (list clang-20
- llvm-20
+ (list clang-21
+ llvm-21
;; Optional (but recommended) inputs.
ncurses
libedit
@@ -1996,133 +1569,6 @@ 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.
-(define-public libcxx-6
- (package
- (inherit libcxx)
- (version (package-version llvm-6))
- (source
- (origin
- (method url-fetch)
- (uri (llvm-uri "libcxx" version))
- (sha256
- (base32
- "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
- (arguments
- (list
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gcc (assoc-ref inputs "gcc")))
- ;; Hide GCC's C++ headers so that they do not interfere with
- ;; the ones we are attempting to build.
- (setenv "CPLUS_INCLUDE_PATH"
- (string-join (delete (string-append gcc "/include/c++")
- (string-split (getenv "CPLUS_INCLUDE_PATH")
- #\:))
- ":"))
- (format #t
- "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH"))
- #t))))))
- (native-inputs
- (list clang-6 llvm-6))))
-
-(define-public libcxxabi-6
- (package
- (name "libcxxabi")
- (version "6.0.1")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/llvm/llvm-project")
- (commit (string-append "llvmorg-" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0ki6796b5z08kh3a3rbysr5wwb2dkl6wal5dzd03i4li5xfkvx1g"))))
- (build-system cmake-build-system)
- (arguments
- (list
- #:configure-flags
- #~(list (string-append "-DLIBCXXABI_LIBCXX_INCLUDES="
- #$(this-package-native-input "libcxx")
- "/include")
- "-DCMAKE_C_COMPILER=clang"
- "-DCMAKE_CXX_COMPILER=clang++")
- #:phases
- #~(modify-phases (@ (guix build cmake-build-system) %standard-phases)
- (add-after 'unpack 'chdir
- (lambda _ (chdir "libcxxabi")))
- (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gcc (assoc-ref inputs "gcc")))
- ;; Hide GCC's C++ headers so that they do not interfere with
- ;; the ones we are attempting to build.
- (setenv "CPLUS_INCLUDE_PATH"
- (string-join
- (cons (string-append
- (assoc-ref inputs "libcxx") "/include/c++/v1")
- (delete (string-append gcc "/include/c++")
- (string-split
- (getenv "CPLUS_INCLUDE_PATH")
- #\:)))
- ":"))
- (format
- #true
- "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH")))))
- (add-after 'install 'install-headers
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((include-dir (string-append
- (assoc-ref outputs "out") "/include")))
- (install-file "../libcxxabi/include/__cxxabi_config.h"
- include-dir)
- (install-file "../libcxxabi/include/cxxabi.h"
- include-dir)))))))
- (native-inputs
- (list clang-6 llvm-6 libcxx-6))
- (home-page "https://libcxxabi.llvm.org")
- (synopsis "C++ standard library support")
- (description
- "This package provides an implementation of low level support for a
-standard C++ library.")
- (license license:expat)))
-
-(define-public libcxx+libcxxabi-6
- (package
- (inherit libcxx-6)
- (name "libcxx+libcxxabi")
- (version (package-version libcxx-6))
- (arguments
- (list
- #:configure-flags
- #~(list "-DLIBCXX_CXX_ABI=libcxxabi"
- (string-append "-DLIBCXX_CXX_ABI_INCLUDE_PATHS="
- #$(this-package-native-input "libcxxabi")
- "/include"))
- #:phases
- #~(modify-phases (@ (guix build cmake-build-system) %standard-phases)
- (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gcc (assoc-ref inputs "gcc")))
- ;; Hide GCC's C++ headers so that they do not interfere with
- ;; the ones we are attempting to build.
- (setenv "CPLUS_INCLUDE_PATH"
- (string-join
- (delete (string-append gcc "/include/c++")
- (string-split (getenv "CPLUS_INCLUDE_PATH")
- #\:))
- ":"))
- (format
- #true
- "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
- (getenv "CPLUS_INCLUDE_PATH"))))))))
- (native-inputs
- (list clang-6 llvm-6 libcxxabi-6))))
-
;; WARNING: This package is a dependency of mesa.
(define-public libclc
(package
@@ -2161,6 +1607,34 @@ requirements according to version 1.1 of the OpenCL specification.")
;; Apache license 2.0 with LLVM exception
(license license:asl2.0)))
+(define-public mlir-19
+ (package
+ (name "mlir")
+ (version (package-version llvm-19))
+ (source (llvm-monorepo version))
+ (build-system cmake-build-system)
+ (inputs
+ (list llvm-19))
+ (arguments
+ (list #:build-type "Release"
+ #:configure-flags
+ #~(list "-DMLIR_BUILD_MLIR_C_DYLIB=ON"
+ "-DLLVM_BUILD_LLVM_DYLIB=ON"
+ "-DLLVM_LINK_LLVM_DYLIB=ON")
+ #:tests? #f ; Tests require gtest
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'change-directory
+ (lambda _
+ (chdir "mlir"))))))
+ (home-page "https://mlir.llvm.org/")
+ (synopsis "Multi-Level Intermediate Representation")
+ (description "This package is a novel approach to building reusable
+and extensible compiler infrastructure. MLIR aims to address software
+fragmentation, improve compilation for heterogeneous hardware, significantly
+reduce the cost of building domain specific compilers, and aid in connecting
+existing compilers together.")
+ (license license:asl2.0))) ; With LLVM exception
+
(define-public python-llvmlite
(package
(name "python-llvmlite")
@@ -2184,7 +1658,7 @@ requirements according to version 1.1 of the OpenCL specification.")
(setenv "CPPFLAGS" "-fPIC")
(setenv "LDFLAGS" (string-append "-Wl,-rpath="
llvm "/lib"))))))))
- (native-inputs (list python-setuptools python-wheel))
+ (native-inputs (list python-pytest python-setuptools))
(inputs
(list
(let* ((patches-commit
@@ -2255,18 +1729,43 @@ setup(name=\"clang\", version=\"~a\", packages=[\"clang\"])\n"
(inputs (list clang))
(synopsis "Python bindings to libclang")))
-(define-public python-clang-10
- (clang-python-bindings clang-10))
-
-(define-public python-clang-11
- (clang-python-bindings clang-11))
-
(define-public python-clang-12
(clang-python-bindings clang-12))
(define-public python-clang-13
(clang-python-bindings clang-13))
+(define-public include-what-you-use
+ (package
+ (name "include-what-you-use")
+ ;; Ensure LLVM/Clang input versions match the version declared in the release
+ ;; https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#clang-compatibility
+ (version "0.24")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/include-what-you-use/include-what-you-use")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0dkk65y6abf7bzv10q1ch3dyzj4d5y89qhh43jn189l861d6pzs0"))))
+ (build-system cmake-build-system)
+ (inputs (list llvm-20 clang-20 python-3))
+ (synopsis
+ "Tool for use with clang to analyze #includes in C and C++ source files")
+ (home-page "https://github.com/include-what-you-use/include-what-you-use")
+ (description
+ "@code{include-what-you-use} lints C and C++ sources to ensure
+@code{#include}s declaring every symbol used in a given file are present.
+When every file directly includes what it uses rather than relying on
+transitive inclusions, builds tend to be more efficient and refactoring
+dependency relationships is easier, particularly for large projects.")
+ ;; The project has not relicensed from the old LLVM license:
+ ;; https://github.com/include-what-you-use/include-what-you-use/issues/849
+ ;; The iwyu_getopt.* files are BSD-3.
+ (license (list license:ncsa license:bsd-3))))
+
(define-public emacs-clang-format
(package
(inherit clang)
@@ -2388,6 +1887,7 @@ using @code{clang-rename}.")))
"-DLLVM_OCAML_OUT_OF_TREE=TRUE"
(string-append "-DLLVM_OCAML_INSTALL_PATH="
(assoc-ref %outputs "out") "/lib/ocaml/site-lib"))
+ #:tests? #f ;no tests
#:phases
(modify-phases %standard-phases
(replace 'build
@@ -2407,9 +1907,6 @@ using @code{clang-rename}.")))
LLVM."))))
(define-public ocaml-llvm (make-ocaml-llvm llvm))
-(define-public ocaml-llvm-9 (make-ocaml-llvm llvm-9))
-(define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10))
-(define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11))
(define-public wllvm
(package
@@ -2422,6 +1919,25 @@ LLVM."))))
(sha256
(base32 "0cf31hixzq5bzkxv91rvadlhrpxzy934134scv4frj85bxbpl19y"))))
(build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((pystr (lambda (s) (string-append "'" s "'"))))
+ (substitute* "wllvm/compilers.py"
+ (("'objcopy'")
+ (pystr (search-input-file inputs "/bin/objcopy"))))
+ (substitute* "wllvm/extraction.py"
+ (("'objdump'")
+ (pystr (search-input-file inputs "/bin/objdump")))
+ (("'ar'")
+ (pystr (search-input-file inputs "/bin/ar"))))
+ (substitute* "wllvm/filetype.py"
+ (("'file'")
+ (pystr (search-input-file inputs "/bin/file"))))))))))
+ (inputs (list binutils file))
(native-inputs (list python-setuptools python-wheel))
(home-page "https://github.com/SRI-CSL/whole-program-llvm")
(synopsis "Whole Program LLVM")