From 2e90882951f78c2c9f47d2db2bc6ba4e1ac3e3a7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 21 Apr 2021 11:04:25 +0200 Subject: gnu: Add libcxxabi-6. * gnu/packages/llvm.scm (libcxxabi-6): New variable. --- gnu/packages/llvm.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'gnu/packages/llvm.scm') diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index d35c20e17c..497dd6e6cc 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2016 Dennis Mungai -;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus +;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus ;;; Copyright © 2017 Roel Janssen ;;; Copyright © 2018, 2019, 2020 Marius Bakke ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice @@ -956,6 +956,65 @@ (define-public libcxx-6 `(("clang" ,clang-6) ("llvm" ,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 + `(#:configure-flags + (list (string-append "-DLIBCXXABI_LIBCXX_INCLUDES=" + (assoc-ref %build-inputs "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 + `(("clang" ,clang-6) + ("llvm" ,llvm-6) + ("libcxx" ,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 libclc (package (name "libclc") -- cgit v1.2.3 From 0eefc6ea201e252f6a5aae3b77761982af6b601d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 21 Apr 2021 11:04:39 +0200 Subject: gnu: Add libcxx+libcxxabi-6. * gnu/packages/llvm.scm (libcxx+libcxxabi-6): New variable. --- gnu/packages/llvm.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gnu/packages/llvm.scm') diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 497dd6e6cc..605bd8629a 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1015,6 +1015,38 @@ (define-public libcxxabi-6 standard C++ library.") (license license:expat))) +(define-public libcxx+libcxxabi-6 + (package + (inherit libcxx-6) + (name "libcxx+libcxxabi") + (version (package-version libcxx-6)) + (arguments + `(#:configure-flags + (list "-DLIBCXX_CXX_ABI=libcxxabi" + (string-append "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=" + (assoc-ref %build-inputs "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 + `(("clang" ,clang-6) + ("llvm" ,llvm-6) + ("libcxxabi" ,libcxxabi-6))))) + (define-public libclc (package (name "libclc") -- cgit v1.2.3 From 8fa86141b709195a44f8fbf8fa19c6e877f6c8a2 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 24 Apr 2021 13:04:55 +0200 Subject: 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. --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 47 ++++++++++++++++++++-- .../patches/clang-12-tools-extra-directory.patch | 16 ++++++++ 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/clang-12-tools-extra-directory.patch (limited to 'gnu/packages/llvm.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 6e4a06cc34..91066c9cfc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -902,6 +902,7 @@ dist_patch_DATA = \ %D%/packages/patches/clang-9.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-12-tools-extra-directory.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 605bd8629a..b510f319f9 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -476,21 +476,21 @@ (define (make-clang-toolchain clang) ("libc-debug" ,glibc "debug") ("libc-static" ,glibc "static"))))) -(define-public llvm-11 +(define-public llvm-12 (package (name "llvm") - (version "11.0.0") + (version "12.0.0") (source (origin (method url-fetch) (uri (llvm-uri "llvm" version)) (sha256 (base32 - "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi")))) + "0l4b79gwfvxild974aigcq1yigypjsk2j5p59syhl6ksd744gp29")))) (build-system cmake-build-system) (outputs '("out" "opt-viewer")) (native-inputs - `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2 + `(("python" ,python) ("perl" ,perl))) (inputs `(("libffi" ,libffi))) @@ -538,6 +538,45 @@ (define-public llvm-11 of programming tools as well as libraries with equivalent functionality.") (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 (clang-runtime-from-llvm llvm-11 diff --git a/gnu/packages/patches/clang-12-tools-extra-directory.patch b/gnu/packages/patches/clang-12-tools-extra-directory.patch new file mode 100644 index 0000000000..0a236da26e --- /dev/null +++ b/gnu/packages/patches/clang-12-tools-extra-directory.patch @@ -0,0 +1,16 @@ +Help CMake locate the "tools-extra" directory. + +Taken from . + +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) -- cgit v1.2.3