Archived
1
0
Fork 0

gnu: LLVM, Clang: Add 12.0.0.

* gnu/packages/patches/clang-12-tools-extra-directory.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/llvm.scm (llvm-12, clang-runtime-12, clang-12,
clang-toolchain-12): New variables.
(llvm-11): Inherit from LLVM-12.
This commit is contained in:
Marius Bakke 2021-04-24 13:04:55 +02:00
parent 01e33a031e
commit 8fa86141b7
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
3 changed files with 60 additions and 4 deletions

View file

@ -902,6 +902,7 @@ dist_patch_DATA = \
%D%/packages/patches/clang-9.0-libc-search-path.patch \ %D%/packages/patches/clang-9.0-libc-search-path.patch \
%D%/packages/patches/clang-10.0-libc-search-path.patch \ %D%/packages/patches/clang-10.0-libc-search-path.patch \
%D%/packages/patches/clang-11.0-libc-search-path.patch \ %D%/packages/patches/clang-11.0-libc-search-path.patch \
%D%/packages/patches/clang-12-tools-extra-directory.patch \
%D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \
%D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \
%D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch \ %D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch \

View file

@ -476,21 +476,21 @@ output), and Binutils.")
("libc-debug" ,glibc "debug") ("libc-debug" ,glibc "debug")
("libc-static" ,glibc "static"))))) ("libc-static" ,glibc "static")))))
(define-public llvm-11 (define-public llvm-12
(package (package
(name "llvm") (name "llvm")
(version "11.0.0") (version "12.0.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (llvm-uri "llvm" version)) (uri (llvm-uri "llvm" version))
(sha256 (sha256
(base32 (base32
"0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi")))) "0l4b79gwfvxild974aigcq1yigypjsk2j5p59syhl6ksd744gp29"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(outputs '("out" "opt-viewer")) (outputs '("out" "opt-viewer"))
(native-inputs (native-inputs
`(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2 `(("python" ,python)
("perl" ,perl))) ("perl" ,perl)))
(inputs (inputs
`(("libffi" ,libffi))) `(("libffi" ,libffi)))
@ -538,6 +538,45 @@ languages is in development. The compiler infrastructure includes mirror sets
of programming tools as well as libraries with equivalent functionality.") of programming tools as well as libraries with equivalent functionality.")
(license license:asl2.0))) ;with LLVM exceptions, see LICENSE.txt (license license:asl2.0))) ;with LLVM exceptions, see LICENSE.txt
(define-public clang-runtime-12
(clang-runtime-from-llvm
llvm-12
"0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"))
(define-public clang-12
(clang-from-llvm llvm-12 clang-runtime-12
"1vd9rhhrd8ghdg111lac7w8by71y9l14yh5zxfijsm6lj4p4avp2"
#:patches '("clang-11.0-libc-search-path.patch")
#:tools-extra
(origin
(method url-fetch)
(uri (llvm-uri "clang-tools-extra"
(package-version llvm-12)))
(patches
(search-patches "clang-12-tools-extra-directory.patch"))
(sha256
(base32
"0p3dzr0qa7mar83y66xa5m5apynf6ia0lsdsq6axwnm64ysy0hdd")))))
(define-public clang-toolchain-12
(make-clang-toolchain clang-12))
(define-public llvm-11
(package
(inherit llvm-12)
(version "11.0.0")
(source
(origin
(method url-fetch)
(uri (llvm-uri "llvm" version))
(sha256
(base32
"0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"))))
(native-inputs
`(;; TODO: Switch to Python 3 in the next rebuild cycle.
("python" ,python-2)
("perl" ,perl)))))
(define-public clang-runtime-11 (define-public clang-runtime-11
(clang-runtime-from-llvm (clang-runtime-from-llvm
llvm-11 llvm-11

View file

@ -0,0 +1,16 @@
Help CMake locate the "tools-extra" directory.
Taken from <https://bugs.llvm.org/show_bug.cgi?id=49990#c3>.
diff --git a/clang-tools-extra/clangd/quality/CompletionModel.cmake b/clang-tools-extra/clangd/quality/CompletionModel.cmake
--- a/clangd/quality/CompletionModel.cmake
+++ b/clangd/quality/CompletionModel.cmake
@@ -5,7 +5,7 @@
# will define a C++ class called ${cpp_class} - which may be a
# namespace-qualified class name.
function(gen_decision_forest model filename cpp_class)
- set(model_compiler ${CMAKE_SOURCE_DIR}/../clang-tools-extra/clangd/quality/CompletionModelCodegen.py)
+ set(model_compiler ${CMAKE_CURRENT_LIST_DIR}/quality/CompletionModelCodegen.py)
set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
set(header_file ${output_dir}/${filename}.h)