diff options
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r-- | gnu/packages/llvm.scm | 153 |
1 files changed, 110 insertions, 43 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 9f851a478e..727441e553 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -22,7 +22,7 @@ ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net> ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2022, 2024 Greg Hogan <code@greghogan.com> -;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com> +;;; Copyright © 2022, 2024 John Kehayias <john.kehayias@protonmail.com> ;;; Copyright © 2022 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space> @@ -77,6 +77,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages swig) #:use-module (gnu packages vulkan) #:use-module (gnu packages xml) @@ -154,7 +155,12 @@ as \"x86_64-linux\"." (llvm-monorepo (package-version llvm)))) (build-system cmake-build-system) (native-inputs - (cond ((version>=? version "18") + (cond ((version>=? version "19") + ;; TODO: Remove this when GCC 14 is the default. + ;; libfuzzer fails to build with GCC 13 + (modify-inputs (package-native-inputs llvm) + (prepend gcc-14))) + ((version>=? version "18") ;; TODO: Remove this when GCC 13 is the default. ;; libfuzzer fails to build with GCC 12 (modify-inputs (package-native-inputs llvm) @@ -170,6 +176,9 @@ as \"x86_64-linux\"." (list llvm) (if (version>=? version "15") (list libffi) + '()) + (if (member (version-major version) (list "10" "11")) + (list libxcrypt) '()))) (arguments `(;; Don't use '-g' during the build to save space. @@ -261,6 +270,11 @@ until LLVM/Clang 14." `(#:configure-flags (list "-DCLANG_INCLUDE_TESTS=True" + ;; TODO: Use --gcc-install-dir when GCC_INSTALL_PREFIX is + ;; removed. See: https://github.com/llvm/llvm-project/pull/77537 + ,@(if (version>=? version "19") + '("-DUSE_DEPRECATED_GCC_INSTALL_PREFIX=ON") + '()) ;; Find libgcc_s, crtbegin.o, and crtend.o. (string-append "-DGCC_INSTALL_PREFIX=" (assoc-ref %build-inputs "gcc-lib")) @@ -552,7 +566,8 @@ output), and Binutils.") ("15.0.7" . "12sggw15sxq1krh1mfk3c1f07h895jlxbcifpwk3pznh4m1rjfy2") ("16.0.6" . "0jxmapg7shwkl88m4mqgfjv4ziqdmnppxhjz6vz51ycp2x4nmjky") ("17.0.6" . "1a7rq3rgw5vxm8y39fyzr4kv7w97lli4a0c1qrkchwk8p0n07hgh") - ("18.1.8" . "1l9wm0g9jrpdf309kxjx7xrzf13h81kz8bbp0md14nrz38qll9la"))) + ("18.1.8" . "1l9wm0g9jrpdf309kxjx7xrzf13h81kz8bbp0md14nrz38qll9la") + ("19.1.4" . "0y5kavrx13ylpzhci520hm7fgnzyj46mbz7dw3z9h5xi0py5lbda"))) (define %llvm-patches '(("14.0.6" . ("clang-14.0-libc-search-path.patch" @@ -565,6 +580,8 @@ output), and Binutils.") ("17.0.6" . ("clang-17.0-libc-search-path.patch" "clang-17.0-link-dsymutil-latomic.patch")) ("18.1.8" . ("clang-18.0-libc-search-path.patch" + "clang-17.0-link-dsymutil-latomic.patch")) + ("19.1.4" . ("clang-18.0-libc-search-path.patch" "clang-17.0-link-dsymutil-latomic.patch")))) (define (llvm-monorepo version) @@ -1536,6 +1553,48 @@ Library.") (define-public clang-toolchain-18 (make-clang-toolchain clang-18 libomp-18)) +(define-public llvm-19 + (package + (inherit llvm-15) + (version "19.1.4") + (source (llvm-monorepo version)) + (arguments + (substitute-keyword-arguments (package-arguments llvm-15) + ;; The build daemon goes OOM on i686-linux on this phase. + ((#:phases phases #~'%standard-phases) + (if (target-x86-32?) + #~(modify-phases #$phases + (delete 'make-dynamic-linker-cache)) + phases)))))) + +(define-public clang-runtime-19 + (clang-runtime-from-llvm llvm-19)) + +(define-public clang-19 + (clang-from-llvm + llvm-19 clang-runtime-19 + #:tools-extra + (origin + (method url-fetch) + (uri (llvm-uri "clang-tools-extra" + (package-version llvm-19))) + (sha256 + (base32 + "19jgfdiwjx36d42219s6kdanwiapjdj49nnv8pn3vp74pgn0p7g0"))))) + +(define-public libomp-19 + (package + (inherit libomp-15) + (version (package-version llvm-19)) + (source (llvm-monorepo version)) + (native-inputs + (modify-inputs (package-native-inputs libomp-15) + (replace "clang" clang-19) + (replace "llvm" llvm-19))))) + +(define-public clang-toolchain-19 + (make-clang-toolchain clang-19 libomp-19)) + ;; Default LLVM and Clang version. (define-public libomp libomp-13) (define-public llvm llvm-13) @@ -1701,6 +1760,13 @@ components which highly leverage existing libraries in the larger LLVM Project." (source (llvm-monorepo version)) (inputs (list llvm-18)))) +(define-public lld-19 + (package + (inherit lld-15) + (version (package-version llvm-19)) + (source (llvm-monorepo version)) + (inputs (list llvm-19)))) + (define-public lld lld-14) (define* (make-lld-wrapper lld #:key lld-as-ld?) @@ -1996,15 +2062,15 @@ requirements according to version 1.1 of the OpenCL specification.") (define-public python-llvmlite (package (name "python-llvmlite") - (version "0.39.1") + (version "0.42.0") (source (origin (method url-fetch) (uri (pypi-uri "llvmlite" version)) (sha256 (base32 - "0wnm0l0301sj8xp6skg3ci1gii56x5dk6l2x88f2c1g8h9ybsfml")))) - (build-system python-build-system) + "0jl50faakmv131x6qx5kyp89a4lfpmkkz64bv9bz9hqc7hj0jazr")))) + (build-system pyproject-build-system) (arguments `(#:phases (modify-phases %standard-phases @@ -2015,10 +2081,11 @@ 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)) (inputs (list (let* ((patches-commit - "a4a19e8af2c5ef9b9901f20193e4be070726da97") + "530bed8f4b872d22a7089167d16198f373442d86") (patch-uri (lambda (name) (string-append "https://raw.githubusercontent.com/numba/" @@ -2029,33 +2096,36 @@ requirements according to version 1.1 of the OpenCL specification.") (patch-origin (lambda (name hash) (origin (method url-fetch) (uri (patch-uri name)) - (sha256 (base32 hash))))) + (sha256 (base32 hash)) + (modules '((ice-9 ftw) + (guix build utils))) + (snippet + '(let ((file (car + (scandir "." + (lambda (name) + (not + (member name + (quote + ("." ".."))))))))) + (substitute* file + (("llvm-14.0.6.src/") "llvm/"))))))) (arch-independent-patches (list (patch-origin - "partial-testing.patch" - "0g3nkci87knvmn7piqhmh4bcc65ff8r921cvfcibyiv65klv3syg") + "llvm14-clear-gotoffsetmap.patch" + "1gzs959hmh4wankalhg7idbhqjpk9q678bphhwfy308appf9c339") (patch-origin - "0001-Revert-Limit-size-of-non-GlobalValue-name.patch" - "0n4k7za0smx6qwdipsh6x5lm7bfvzzb3p9r8q1zq1dqi4na21295")))) + "llvm14-remove-use-of-clonefile.patch" + "1wd156yjdshzh67dfk7c860hpx3nf5mn59sgmgb7lv1c55i6w97x") + (patch-origin + "llvm14-svml.patch" + "1dx1mgd36m0d1x6acd9ky9allvqhshjcbhfb5vj9sizk9bm1ipsr")))) (package - (inherit llvm-11) + (inherit llvm-14) (source (origin - (inherit (package-source llvm-11)) - (patches (if (string=? "aarch64-linux" (%current-system)) - `(,(patch-origin - "intel-D47188-svml-VF_LLVM9.patch" - "0gnnlfxr8p1a7ls93hzcpfqpa8r0icypfwj8l9cmkslq5sz8p64r") - ,@arch-independent-patches - ,@(origin-patches (package-source llvm-11))) - `(,(patch-origin - "intel-D47188-svml-VF.patch" - "0gnnlfxr8p1a7ls93hzcpfqpa8r0icypfwj8l9cmkslq5sz8p64r") - ,(patch-origin - "expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch" - "0jxhjkkwwi1cy898l2n57l73ckpw0v73lqnrifp7r1mwpsh624nv") - ,@arch-independent-patches - ,@(origin-patches (package-source llvm-11))))))))))) + (inherit (package-source llvm-14)) + (patches (append arch-independent-patches + (origin-patches (package-source llvm-14)))))))))) (home-page "https://llvmlite.pydata.org") (synopsis "Wrapper around basic LLVM functionality") (description @@ -2158,7 +2228,7 @@ using @code{clang-rename}."))) (define-public llvm-for-mesa ;; Note: update the 'clang' input of mesa-opencl when bumping this. - (let ((base-llvm llvm-15)) + (let ((base-llvm llvm-18)) (package (inherit base-llvm) (name "llvm-for-mesa") @@ -2172,21 +2242,18 @@ using @code{clang-rename}."))) ,@modules)) ((#:configure-flags cf ''()) #~(cons* - ;; AMDGPU is needed by the vulkan drivers. - #$(string-append "-DLLVM_TARGETS_TO_BUILD=" - (system->llvm-target) ";AMDGPU") - #$@(if (%current-target-system) - '("-DBUILD_SHARED_LIBS:BOOL=TRUE" - "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") + #$@(if (%current-target-system) + '("-DBUILD_SHARED_LIBS:BOOL=TRUE" + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") '()) - ;; Skipping tools and utils decreases the output by ~100 MiB. - "-DLLVM_BUILD_TOOLS=NO" - (remove - (cut string-match - #$(if (%current-target-system) - "-DLLVM_(LINK_LLVM_DYLIB|TARGETS_TO_BUILD|INSTALL_UTILS).*" - "-DLLVM_(TARGETS_TO_BUILD|INSTALL_UTILS).*") <>) - #$cf))) + ;; Skipping tools and utils decreases the output by ~100 MiB. + "-DLLVM_BUILD_TOOLS=NO" + (remove + (cut string-match + #$(if (%current-target-system) + "-DLLVM_(LINK_LLVM_DYLIB|INSTALL_UTILS).*" + "-DLLVM_INSTALL_UTILS.*") <>) + #$cf))) ((#:phases phases '%standard-phases) #~(modify-phases #$phases #$@(if (%current-target-system) |