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.scm74
1 files changed, 60 insertions, 14 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index e5bf9f5cae..720de1f071 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -666,7 +666,7 @@ of programming tools as well as libraries with equivalent functionality.")
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
"-DLLVM_ENABLE_FFI:BOOL=TRUE"
- "-DLLVM_REQUIRES_RTTI=1" ;for some third-party utilities
+ "-DLLVM_ENABLE_RTTI:BOOL=TRUE" ;for some third-party utilities
"-DLLVM_INSTALL_UTILS=ON") ;needed for rustc
;; Don't use '-g' during the build, to save space.
#:build-type "Release"
@@ -722,11 +722,7 @@ of programming tools as well as libraries with equivalent functionality.")
#~(modify-phases #$phases
(add-after 'unpack 'change-directory
(lambda _
- (chdir "compiler-rt")))))))
- (native-inputs
- `(;; FIXME: libfuzzer fails to build with GCC 10.
- ("gcc" ,gcc-11)
- ,@(package-native-inputs template))))))
+ (chdir "compiler-rt"))))))))))
(define-public clang-15
(clang-from-llvm
@@ -918,7 +914,7 @@ Library.")
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
"-DLLVM_ENABLE_FFI:BOOL=TRUE"
- "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
+ "-DLLVM_ENABLE_RTTI:BOOL=TRUE" ; For some third-party utilities
"-DLLVM_INSTALL_UTILS=ON")) ; Needed for rustc.
;; Don't use '-g' during the build, to save space.
#:build-type "Release"
@@ -998,23 +994,24 @@ Library.")
(define-public llvm-11
(package
(inherit llvm-12)
- (version "11.0.0")
+ (version "11.1.0")
(source
(origin
(method url-fetch)
(uri (llvm-uri "llvm" version))
+ (patches (search-patches "llvm-8-missing-include.patch"))
(sha256
(base32
- "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"))))))
+ "199yq3a214avcbi4kk2q0ajriifkvsr0l2dkx3a666m033ihi1ff"))))))
(define-public clang-runtime-11
(clang-runtime-from-llvm
llvm-11
- "0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip"))
+ "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"))
(define-public clang-11
(clang-from-llvm llvm-11 clang-runtime-11
- "02ajkij85966vd150iy246mv16dsaph1kfi0y8wnncp8w6nar5hg"
+ "12sm91qx2m79cvj75a9aazf2x8xybjbd593dv6v7rxficpq8i0ha"
#:legacy-build-shared-libs? #t
#:patches '("clang-11.0-libc-search-path.patch")
#:tools-extra
@@ -1024,7 +1021,7 @@ Library.")
(package-version llvm-11)))
(sha256
(base32
- "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy")))))
+ "18n1w1hkv931xzq02b34wglbv6zd6sd0r5kb8piwvag7klj7qw3n")))))
(define-public libomp-11
(package
@@ -1035,7 +1032,7 @@ Library.")
(uri (llvm-uri "openmp" version))
(sha256
(base32
- "0k389d0g9zlfyzh1kpb3i5jdawzpn0hrdxzbjinpvdv7rbw4sw1d"))
+ "0bh5cswgpc79awlq8j5i7hp355adaac7s6zaz0zwp6mkflxli1yi"))
(file-name (string-append "libomp-" version ".tar.xz"))))
(native-inputs
(modify-inputs (package-native-inputs libomp-12)
@@ -1053,6 +1050,7 @@ Library.")
(origin
(method url-fetch)
(uri (llvm-uri "llvm" version))
+ (patches (search-patches "llvm-8-missing-include.patch"))
(sha256
(base32
"1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"))))
@@ -1114,6 +1112,7 @@ Library.")
(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"))))
@@ -1174,7 +1173,8 @@ Library.")
(sha256
(base32
"1rvm5gqp5v8hfn17kqws3zhk94w4kxndal12bqa0y57p09nply24"))
- (patches (search-patches "llvm-8-fix-build-with-gcc-10.patch"))))
+ (patches (search-patches "llvm-8-fix-build-with-gcc-10.patch"
+ "llvm-8-missing-include.patch"))))
(license license:ncsa)))
(define-public clang-runtime-8
@@ -2069,6 +2069,52 @@ using @code{clang-rename}.")))
;;; LLVM variants.
;;;
+(define-public llvm-for-mesa
+ ;; Note: update the 'clang' input of mesa-opencl when bumping this.
+ (let ((base-llvm llvm-15))
+ (package
+ (inherit base-llvm)
+ (name "llvm-for-mesa")
+ (arguments
+ (substitute-keyword-arguments (package-arguments base-llvm)
+ ((#:modules modules '((guix build cmake-build-system)
+ (guix build utils)))
+ `((ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ ,@modules))
+ ((#:configure-flags cf ''())
+ #~(cons*
+ ;; AMDGPU is needed by the vulkan drivers.
+ #$(string-append "-DLLVM_TARGETS_TO_BUILD="
+ (system->llvm-target) ";AMDGPU")
+ ;; Skipping tools and utils decreases the output by ~100 MiB.
+ "-DLLVM_BUILD_TOOLS=NO"
+ (remove (cut string-match
+ "-DLLVM_(TARGETS_TO_BUILD|INSTALL_UTILS).*" <>)
+ #$cf)))
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'delete-static-libraries
+ ;; If these are just relocated then llvm-config can't find them.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (for-each delete-file
+ (find-files (string-append
+ (assoc-ref outputs "out") "/lib")
+ "\\.a$"))))
+ ;; llvm-config is how mesa and others find the various
+ ;; libraries and headers they use.
+ (add-after 'install 'build-and-install-llvm-config
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute*
+ "tools/llvm-config/CMakeFiles/llvm-config.dir/link.txt"
+ (((string-append (getcwd) "/build/lib"))
+ (string-append out "/lib")))
+ (invoke "make" "llvm-config")
+ (install-file "bin/llvm-config"
+ (string-append out "/bin"))))))))))))
+
(define make-ocaml-llvm
;; Make it a memoizing procedure so its callers below don't end up defining
;; two equal-but-not-eq "ocaml-llvm" packages for the default LLVM.