2014-12-07 21:19:35 +00:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2018-10-06 03:58:43 +00:00
|
|
|
;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org>
|
2015-03-02 13:36:31 +00:00
|
|
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
2020-04-24 10:20:25 +00:00
|
|
|
;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
2016-07-07 05:06:42 +00:00
|
|
|
;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
|
2020-02-25 21:47:17 +00:00
|
|
|
;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
|
2017-05-10 13:34:59 +00:00
|
|
|
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
2020-02-03 08:44:14 +00:00
|
|
|
;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
|
2021-01-16 20:22:28 +00:00
|
|
|
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
2018-10-15 18:45:08 +00:00
|
|
|
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
2018-11-12 21:27:41 +00:00
|
|
|
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
|
|
|
|
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
|
2019-05-06 11:03:32 +00:00
|
|
|
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
|
2019-11-19 15:20:40 +00:00
|
|
|
;;; Copyright © 2019 Arm Ltd <David.Truby@arm.com>
|
2019-11-14 12:25:00 +00:00
|
|
|
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
2019-12-23 23:29:13 +00:00
|
|
|
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
|
2020-04-20 21:56:13 +00:00
|
|
|
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
|
2020-06-07 21:25:40 +00:00
|
|
|
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
|
2020-11-14 03:05:26 +00:00
|
|
|
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
2021-03-02 20:52:03 +00:00
|
|
|
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
|
2014-12-07 21:19:35 +00:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (gnu packages llvm)
|
|
|
|
#:use-module (guix packages)
|
2016-07-07 05:06:41 +00:00
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
2014-12-07 21:19:35 +00:00
|
|
|
#:use-module (guix download)
|
2019-06-24 12:03:57 +00:00
|
|
|
#:use-module (guix git-download)
|
2021-03-02 20:52:03 +00:00
|
|
|
#:use-module (guix memoization)
|
2014-12-07 21:19:35 +00:00
|
|
|
#:use-module (guix utils)
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (guix build-system cmake)
|
2018-11-12 21:27:41 +00:00
|
|
|
#:use-module (guix build-system emacs)
|
2018-08-29 15:04:13 +00:00
|
|
|
#:use-module (guix build-system python)
|
2019-11-14 12:25:00 +00:00
|
|
|
#:use-module (guix build-system trivial)
|
2014-12-07 21:19:35 +00:00
|
|
|
#:use-module (gnu packages)
|
2019-11-14 12:25:00 +00:00
|
|
|
#:use-module (gnu packages base)
|
2015-06-19 15:18:03 +00:00
|
|
|
#:use-module (gnu packages gcc)
|
|
|
|
#:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
|
2016-07-07 05:06:42 +00:00
|
|
|
#:use-module (gnu packages compression)
|
2020-10-21 19:31:36 +00:00
|
|
|
#:use-module (gnu packages libedit)
|
2016-07-07 05:06:42 +00:00
|
|
|
#:use-module (gnu packages libffi)
|
2020-10-21 19:31:36 +00:00
|
|
|
#:use-module (gnu packages lua)
|
2019-04-16 15:07:15 +00:00
|
|
|
#:use-module (gnu packages mpi)
|
2020-10-21 19:31:36 +00:00
|
|
|
#:use-module (gnu packages ncurses)
|
2021-03-02 20:52:03 +00:00
|
|
|
#:use-module (gnu packages ocaml)
|
2020-02-25 21:47:17 +00:00
|
|
|
#:use-module (gnu packages onc-rpc)
|
2014-12-07 21:19:35 +00:00
|
|
|
#:use-module (gnu packages perl)
|
2019-04-16 15:07:15 +00:00
|
|
|
#:use-module (gnu packages pkg-config)
|
2014-12-07 21:19:35 +00:00
|
|
|
#:use-module (gnu packages python)
|
2020-10-21 19:31:36 +00:00
|
|
|
#:use-module (gnu packages swig)
|
2019-07-23 14:57:25 +00:00
|
|
|
#:use-module (gnu packages xml)
|
|
|
|
#:export (system->llvm-target))
|
|
|
|
|
|
|
|
(define* (system->llvm-target #:optional
|
|
|
|
(system (or (and=> (%current-target-system)
|
|
|
|
gnu-triplet->nix-system)
|
|
|
|
(%current-system))))
|
|
|
|
"Return the LLVM target name that corresponds to SYSTEM, a system type such
|
|
|
|
as \"x86_64-linux\"."
|
|
|
|
;; See the 'lib/Target' directory of LLVM for a list of supported targets.
|
|
|
|
(letrec-syntax ((matches (syntax-rules (=>)
|
|
|
|
((_ (system-prefix => target) rest ...)
|
|
|
|
(if (string-prefix? system-prefix system)
|
|
|
|
target
|
|
|
|
(matches rest ...)))
|
|
|
|
((_)
|
|
|
|
(error "LLVM target for system is unknown" system)))))
|
|
|
|
(matches ("aarch64" => "AArch64")
|
|
|
|
("armhf" => "ARM")
|
|
|
|
("mips64el" => "Mips")
|
|
|
|
("powerpc" => "PowerPC")
|
|
|
|
("riscv" => "RISCV")
|
|
|
|
("x86_64" => "X86")
|
2020-03-22 18:10:08 +00:00
|
|
|
("i686" => "X86")
|
|
|
|
("i586" => "X86"))))
|
2014-12-07 21:19:35 +00:00
|
|
|
|
2020-10-07 13:37:43 +00:00
|
|
|
(define (llvm-uri component version)
|
2020-12-17 14:59:25 +00:00
|
|
|
(string-append "https://github.com/llvm/llvm-project/releases/download"
|
|
|
|
"/llvmorg-" version "/" component "-" version ".src.tar.xz"))
|
gnu: llvm: Add helper procedure for constructing download URLs.
...in preparation for LLVM 9.0.1 which is no longer hosted on llvm.org.
* gnu/packages/llvm.scm (llvm-download-uri): New procedure.
(llvm-8, clang-runtime-from-llvm, clang-from-llvm, libcxx, libomp, llvm-9,
llvm-7, llvm-6, libcxx-6, llvm-3.9.1, llvm-3.8, llvm-3.7, llvm-3.6,
llvm-3.5)[source](uri): Use it.
2020-02-21 16:38:28 +00:00
|
|
|
|
2018-01-17 23:09:11 +00:00
|
|
|
(define* (clang-runtime-from-llvm llvm hash
|
|
|
|
#:optional (patches '()))
|
2015-08-17 07:21:09 +00:00
|
|
|
(package
|
|
|
|
(name "clang-runtime")
|
|
|
|
(version (package-version llvm))
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "compiler-rt" version))
|
2018-01-17 23:09:11 +00:00
|
|
|
(sha256 (base32 hash))
|
|
|
|
(patches (map search-patch patches))))
|
2015-08-17 07:21:09 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(native-inputs (package-native-inputs llvm))
|
|
|
|
(inputs
|
|
|
|
`(("llvm" ,llvm)))
|
|
|
|
(arguments
|
|
|
|
`(;; Don't use '-g' during the build to save space.
|
2016-07-07 05:06:44 +00:00
|
|
|
#:build-type "Release"
|
2020-03-05 16:22:17 +00:00
|
|
|
#:tests? #f ; Tests require gtest
|
|
|
|
#:modules ((srfi srfi-1)
|
|
|
|
(ice-9 match)
|
|
|
|
,@%cmake-build-system-modules)
|
|
|
|
#:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases)
|
|
|
|
(add-after 'set-paths 'hide-glibc
|
|
|
|
;; Work around https://issues.guix.info/issue/36882. We need to
|
|
|
|
;; remove glibc from CPLUS_INCLUDE_PATH so that the one hardcoded
|
|
|
|
;; in GCC, at the bottom of GCC include search-path is used.
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let* ((filters '("libc"))
|
|
|
|
(input-directories
|
|
|
|
(filter-map (lambda (input)
|
|
|
|
(match input
|
|
|
|
((name . dir)
|
|
|
|
(and (not (member name filters))
|
|
|
|
dir))))
|
|
|
|
inputs)))
|
|
|
|
(set-path-environment-variable "CPLUS_INCLUDE_PATH"
|
|
|
|
'("include")
|
|
|
|
input-directories)
|
|
|
|
#t))))))
|
2017-12-25 00:39:14 +00:00
|
|
|
(home-page "https://compiler-rt.llvm.org")
|
2015-08-17 07:21:09 +00:00
|
|
|
(synopsis "Runtime library for Clang/LLVM")
|
|
|
|
(description
|
|
|
|
"The \"clang-runtime\" library provides the implementations of run-time
|
|
|
|
functions for C and C++ programs. It also provides header files that allow C
|
|
|
|
and C++ source code to interface with the \"sanitization\" passes of the clang
|
|
|
|
compiler. In LLVM this library is called \"compiler-rt\".")
|
2020-02-23 23:54:06 +00:00
|
|
|
(license (package-license llvm))
|
2015-11-04 08:28:46 +00:00
|
|
|
|
2017-12-25 00:39:14 +00:00
|
|
|
;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
|
2015-11-04 08:28:46 +00:00
|
|
|
(supported-systems (delete "mips64el-linux" %supported-systems))))
|
2015-08-17 07:21:09 +00:00
|
|
|
|
2016-07-07 05:06:44 +00:00
|
|
|
(define* (clang-from-llvm llvm clang-runtime hash
|
2020-05-28 09:46:59 +00:00
|
|
|
#:key (patches '()) tools-extra)
|
|
|
|
"Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the
|
|
|
|
given PATCHES. When TOOLS-EXTRA is given, it must point to the
|
|
|
|
'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace',
|
|
|
|
'modularize', and other tools."
|
2014-12-07 21:19:35 +00:00
|
|
|
(package
|
|
|
|
(name "clang")
|
|
|
|
(version (package-version llvm))
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri (if (version>=? version "9.0.1")
|
gnu: llvm: Add helper procedure for constructing download URLs.
...in preparation for LLVM 9.0.1 which is no longer hosted on llvm.org.
* gnu/packages/llvm.scm (llvm-download-uri): New procedure.
(llvm-8, clang-runtime-from-llvm, clang-from-llvm, libcxx, libomp, llvm-9,
llvm-7, llvm-6, libcxx-6, llvm-3.9.1, llvm-3.8, llvm-3.7, llvm-3.6,
llvm-3.5)[source](uri): Use it.
2020-02-21 16:38:28 +00:00
|
|
|
"clang"
|
|
|
|
"cfe")
|
|
|
|
version))
|
2015-06-19 15:18:03 +00:00
|
|
|
(sha256 (base32 hash))
|
2016-07-07 05:06:44 +00:00
|
|
|
(patches (map search-patch patches))))
|
2014-12-07 21:19:35 +00:00
|
|
|
;; Using cmake allows us to treat llvm as an external library. There
|
|
|
|
;; doesn't seem to be any way to do this with clang's autotools-based
|
|
|
|
;; build system.
|
|
|
|
(build-system cmake-build-system)
|
2020-05-28 09:46:59 +00:00
|
|
|
(outputs (if tools-extra '("out" "extra") '("out")))
|
2014-12-07 21:19:35 +00:00
|
|
|
(native-inputs (package-native-inputs llvm))
|
|
|
|
(inputs
|
|
|
|
`(("libxml2" ,libxml2)
|
2015-06-26 15:06:30 +00:00
|
|
|
("gcc-lib" ,gcc "lib")
|
2020-05-28 09:46:59 +00:00
|
|
|
,@(package-inputs llvm)
|
|
|
|
,@(if tools-extra
|
|
|
|
`(("clang-tools-extra" ,tools-extra))
|
|
|
|
'())))
|
2014-12-07 21:19:35 +00:00
|
|
|
(propagated-inputs
|
2015-08-17 07:21:09 +00:00
|
|
|
`(("llvm" ,llvm)
|
|
|
|
("clang-runtime" ,clang-runtime)))
|
2015-06-19 15:18:03 +00:00
|
|
|
(arguments
|
|
|
|
`(#:configure-flags
|
|
|
|
(list "-DCLANG_INCLUDE_TESTS=True"
|
|
|
|
|
|
|
|
;; Find libgcc_s, crtbegin.o, and crtend.o.
|
|
|
|
(string-append "-DGCC_INSTALL_PREFIX="
|
|
|
|
(assoc-ref %build-inputs "gcc-lib"))
|
|
|
|
|
|
|
|
;; Use a sane default include directory.
|
|
|
|
(string-append "-DC_INCLUDE_DIRS="
|
|
|
|
(assoc-ref %build-inputs "libc")
|
|
|
|
"/include"))
|
|
|
|
|
2015-06-19 15:21:53 +00:00
|
|
|
;; Don't use '-g' during the build to save space.
|
|
|
|
#:build-type "Release"
|
|
|
|
|
2015-06-19 15:18:03 +00:00
|
|
|
#:phases (modify-phases %standard-phases
|
2020-05-28 09:46:59 +00:00
|
|
|
,@(if tools-extra
|
|
|
|
`((add-after 'unpack 'add-tools-extra
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
;; Unpack the 'clang-tools-extra' tarball under
|
|
|
|
;; tools/.
|
|
|
|
(let ((extra (assoc-ref inputs
|
|
|
|
"clang-tools-extra")))
|
|
|
|
(invoke "tar" "xf" extra)
|
|
|
|
(rename-file ,(string-append
|
|
|
|
"clang-tools-extra-"
|
|
|
|
(package-version llvm)
|
|
|
|
".src")
|
|
|
|
"tools/extra")
|
|
|
|
#t)))
|
|
|
|
(add-after 'install 'move-extra-tools
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
;; Move the extra tools to the "extra" output.
|
|
|
|
;; These programs alone weigh in at 296 MiB,
|
|
|
|
;; because they statically-link a whole bunch of
|
|
|
|
;; Clang libraries.
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(extra (assoc-ref outputs "extra"))
|
|
|
|
(bin (string-append out "/bin"))
|
|
|
|
(bin* (string-append extra "/bin"))
|
|
|
|
(lib (string-append out "/lib")))
|
|
|
|
(define (move program)
|
|
|
|
(rename-file (string-append bin "/" program)
|
|
|
|
(string-append bin* "/"
|
|
|
|
program)))
|
|
|
|
|
|
|
|
(mkdir-p bin*)
|
|
|
|
(for-each move
|
|
|
|
'("clang-apply-replacements"
|
|
|
|
"clang-change-namespace"
|
|
|
|
"clangd"
|
|
|
|
"clang-doc"
|
|
|
|
"clang-include-fixer"
|
|
|
|
"clang-move"
|
|
|
|
"clang-query"
|
|
|
|
"clang-reorder-fields"
|
|
|
|
"clang-tidy"
|
|
|
|
"find-all-symbols"
|
|
|
|
"modularize"
|
|
|
|
"pp-trace"))
|
|
|
|
|
|
|
|
;; Remove MiBs of .a files coming from
|
|
|
|
;; 'clang-tools-extra'.
|
|
|
|
(for-each (lambda (component)
|
|
|
|
(delete-file
|
|
|
|
(string-append lib "/libclang"
|
|
|
|
component ".a")))
|
|
|
|
'("ApplyReplacements"
|
|
|
|
"ChangeNamespace"
|
|
|
|
"Daemon"
|
|
|
|
"DaemonTweaks"
|
|
|
|
"Doc"
|
|
|
|
"IncludeFixer"
|
|
|
|
"IncludeFixerPlugin"
|
|
|
|
"Move"))
|
|
|
|
(for-each delete-file
|
|
|
|
(find-files
|
|
|
|
lib
|
|
|
|
"^(libfindAllSymbols|libclangTidy)"))
|
|
|
|
#t))))
|
|
|
|
'())
|
2020-02-26 19:59:09 +00:00
|
|
|
(add-after 'unpack 'add-missing-triplets
|
|
|
|
(lambda _
|
|
|
|
;; Clang iterates through known triplets to search for
|
|
|
|
;; GCC's headers, but does not recognize some of the
|
|
|
|
;; triplets that are used in Guix.
|
|
|
|
(substitute* ,@(if (version>=? version "6.0")
|
|
|
|
'("lib/Driver/ToolChains/Gnu.cpp")
|
|
|
|
'("lib/Driver/ToolChains.cpp"))
|
|
|
|
(("\"aarch64-linux-gnu\"," all)
|
|
|
|
(string-append "\"aarch64-unknown-linux-gnu\", "
|
|
|
|
all))
|
|
|
|
(("\"arm-linux-gnueabihf\"," all)
|
|
|
|
(string-append all
|
|
|
|
" \"arm-unknown-linux-gnueabihf\","))
|
|
|
|
(("\"i686-pc-linux-gnu\"," all)
|
|
|
|
(string-append "\"i686-unknown-linux-gnu\", "
|
|
|
|
all)))
|
|
|
|
#t))
|
2020-02-26 20:06:01 +00:00
|
|
|
(add-after 'unpack 'set-glibc-file-names
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let ((libc (assoc-ref inputs "libc"))
|
|
|
|
(compiler-rt (assoc-ref inputs "clang-runtime"))
|
|
|
|
(gcc (assoc-ref inputs "gcc")))
|
|
|
|
,@(cond
|
|
|
|
((version>=? version "6.0")
|
|
|
|
`(;; Link to libclang_rt files from clang-runtime.
|
2018-03-31 20:04:44 +00:00
|
|
|
(substitute* "lib/Driver/ToolChain.cpp"
|
|
|
|
(("getDriver\\(\\)\\.ResourceDir")
|
2020-02-26 20:06:01 +00:00
|
|
|
(string-append "\"" compiler-rt "\"")))
|
2018-03-31 20:04:44 +00:00
|
|
|
|
2020-02-26 20:06:01 +00:00
|
|
|
;; Make "LibDir" refer to <glibc>/lib so that it
|
|
|
|
;; uses the right dynamic linker file name.
|
|
|
|
(substitute* "lib/Driver/ToolChains/Linux.cpp"
|
|
|
|
(("(^[[:blank:]]+LibDir = ).*" _ declaration)
|
|
|
|
(string-append declaration "\"" libc "/lib\";\n"))
|
2018-03-31 20:04:44 +00:00
|
|
|
|
2020-02-26 20:06:01 +00:00
|
|
|
;; Make clang look for libstdc++ in the right
|
|
|
|
;; location.
|
|
|
|
(("LibStdCXXIncludePathCandidates\\[\\] = \\{")
|
|
|
|
(string-append
|
|
|
|
"LibStdCXXIncludePathCandidates[] = { \"" gcc
|
|
|
|
"/include/c++\","))
|
2019-11-13 16:56:04 +00:00
|
|
|
|
2020-02-26 20:06:01 +00:00
|
|
|
;; Make sure libc's libdir is on the search path, to
|
|
|
|
;; allow crt1.o & co. to be found.
|
|
|
|
(("@GLIBC_LIBDIR@")
|
|
|
|
(string-append libc "/lib")))))
|
|
|
|
(else
|
|
|
|
`((substitute* "lib/Driver/Tools.cpp"
|
|
|
|
;; Patch the 'getLinuxDynamicLinker' function so that
|
|
|
|
;; it uses the right dynamic linker file name.
|
|
|
|
(("/lib64/ld-linux-x86-64.so.2")
|
|
|
|
(string-append libc
|
|
|
|
,(glibc-dynamic-linker))))
|
2018-03-31 20:04:44 +00:00
|
|
|
|
2020-02-26 20:06:01 +00:00
|
|
|
;; Link to libclang_rt files from clang-runtime.
|
|
|
|
;; This substitution needed slight adjustment in 3.8.
|
|
|
|
,@(if (version>=? version "3.8")
|
|
|
|
'((substitute* "lib/Driver/Tools.cpp"
|
|
|
|
(("TC\\.getDriver\\(\\)\\.ResourceDir")
|
|
|
|
(string-append "\"" compiler-rt "\""))))
|
|
|
|
'((substitute* "lib/Driver/ToolChain.cpp"
|
|
|
|
(("getDriver\\(\\)\\.ResourceDir")
|
|
|
|
(string-append "\"" compiler-rt "\"")))))
|
2018-03-31 20:04:44 +00:00
|
|
|
|
2020-02-26 20:06:01 +00:00
|
|
|
;; Make sure libc's libdir is on the search path, to
|
|
|
|
;; allow crt1.o & co. to be found.
|
|
|
|
(substitute* "lib/Driver/ToolChains.cpp"
|
|
|
|
(("@GLIBC_LIBDIR@")
|
|
|
|
(string-append libc "/lib"))))))
|
|
|
|
#t)))
|
2020-10-21 19:23:24 +00:00
|
|
|
,@(if (version>=? version "10")
|
|
|
|
`((add-after 'install 'adjust-cmake-file
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
;; Clang generates a CMake file with "targets"
|
|
|
|
;; for each installed library file. Downstream
|
|
|
|
;; consumers of the CMake interface can use this
|
|
|
|
;; to get absolute library locations. Including
|
|
|
|
;; this file will needlessly assert that _all_
|
|
|
|
;; libraries are available, which causes problems
|
|
|
|
;; in Guix because some are removed (see the
|
|
|
|
;; move-extra-tools phase). Thus, remove the
|
|
|
|
;; asserts so that the main functionality works.
|
|
|
|
(substitute*
|
|
|
|
(string-append
|
|
|
|
out
|
|
|
|
"/lib/cmake/clang/ClangTargets-release.cmake")
|
|
|
|
(("list\\(APPEND _IMPORT_CHECK_TARGETS.*" all)
|
|
|
|
(string-append "# Disabled by Guix.\n#" all)))
|
|
|
|
#t))))
|
|
|
|
'())
|
2020-07-29 21:41:15 +00:00
|
|
|
,@(if (version>? version "3.8")
|
|
|
|
`((add-after 'install 'symlink-cfi_blacklist
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(lib-share (string-append out "/lib/clang/"
|
|
|
|
,version "/share"))
|
|
|
|
(compiler-rt (assoc-ref inputs "clang-runtime"))
|
|
|
|
;; The location varies between Clang versions.
|
|
|
|
(cfi-blacklist
|
|
|
|
(cond
|
|
|
|
((file-exists?
|
|
|
|
(string-append compiler-rt "/cfi_blacklist.txt"))
|
|
|
|
(string-append compiler-rt "/cfi_blacklist.txt"))
|
|
|
|
(else (string-append compiler-rt
|
|
|
|
"/share/cfi_blacklist.txt")))))
|
|
|
|
(mkdir-p lib-share)
|
|
|
|
;; Symlink cfi_blacklist.txt to where Clang expects
|
|
|
|
;; to find it.
|
|
|
|
(symlink cfi-blacklist
|
|
|
|
(string-append lib-share "/cfi_blacklist.txt"))
|
|
|
|
#t))))
|
|
|
|
'())
|
2018-11-26 13:51:40 +00:00
|
|
|
(add-after 'install 'install-clean-up-/share/clang
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(compl-dir (string-append
|
|
|
|
out "/etc/bash_completion.d")))
|
|
|
|
(with-directory-excursion (string-append out
|
|
|
|
"/share/clang")
|
2018-11-28 12:41:50 +00:00
|
|
|
(for-each
|
|
|
|
(lambda (file)
|
|
|
|
(when (file-exists? file)
|
|
|
|
(delete-file file)))
|
|
|
|
;; Delete extensions for proprietary text editors.
|
|
|
|
'("clang-format-bbedit.applescript"
|
|
|
|
"clang-format-sublime.py"
|
|
|
|
;; Delete Emacs extensions: see their respective Emacs
|
|
|
|
;; Guix package instead.
|
|
|
|
"clang-rename.el" "clang-format.el"))
|
2018-11-26 13:51:40 +00:00
|
|
|
;; Install bash completion.
|
2018-11-28 12:41:50 +00:00
|
|
|
(when (file-exists? "bash-autocomplete.sh")
|
|
|
|
(mkdir-p compl-dir)
|
|
|
|
(rename-file "bash-autocomplete.sh"
|
|
|
|
(string-append compl-dir "/clang")))))
|
2018-11-26 13:51:40 +00:00
|
|
|
#t)))))
|
2015-06-19 09:34:53 +00:00
|
|
|
|
|
|
|
;; Clang supports the same environment variables as GCC.
|
|
|
|
(native-search-paths
|
|
|
|
(list (search-path-specification
|
2020-03-15 15:04:53 +00:00
|
|
|
(variable "C_INCLUDE_PATH")
|
2015-06-19 09:34:53 +00:00
|
|
|
(files '("include")))
|
2020-03-15 15:04:53 +00:00
|
|
|
(search-path-specification
|
|
|
|
(variable "CPLUS_INCLUDE_PATH")
|
|
|
|
(files '("include/c++" "include")))
|
2015-06-19 09:34:53 +00:00
|
|
|
(search-path-specification
|
|
|
|
(variable "LIBRARY_PATH")
|
|
|
|
(files '("lib" "lib64")))))
|
|
|
|
|
2017-12-25 00:39:14 +00:00
|
|
|
(home-page "https://clang.llvm.org")
|
2014-12-07 21:19:35 +00:00
|
|
|
(synopsis "C language family frontend for LLVM")
|
|
|
|
(description
|
|
|
|
"Clang is a compiler front end for the C, C++, Objective-C and
|
|
|
|
Objective-C++ programming languages. It uses LLVM as its back end. The Clang
|
|
|
|
project includes the Clang front end, the Clang static analyzer, and several
|
|
|
|
code analysis tools.")
|
2020-02-23 23:54:06 +00:00
|
|
|
(license (if (version>=? version "9.0")
|
|
|
|
license:asl2.0 ;with LLVM exceptions
|
|
|
|
license:ncsa))))
|
2015-03-02 13:36:31 +00:00
|
|
|
|
2019-11-14 12:25:00 +00:00
|
|
|
(define (make-clang-toolchain clang)
|
|
|
|
(package
|
|
|
|
(name (string-append (package-name clang) "-toolchain"))
|
|
|
|
(version (package-version clang))
|
|
|
|
(source #f)
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
(arguments
|
|
|
|
'(#:modules ((guix build union))
|
|
|
|
#:builder (begin
|
|
|
|
(use-modules (ice-9 match)
|
|
|
|
(srfi srfi-26)
|
|
|
|
(guix build union))
|
|
|
|
|
|
|
|
(let ((out (assoc-ref %outputs "out")))
|
|
|
|
|
|
|
|
(match %build-inputs
|
|
|
|
(((names . directories) ...)
|
|
|
|
(union-build out directories)))
|
|
|
|
|
2020-09-28 19:09:50 +00:00
|
|
|
;; Create 'cc' and 'c++' so that one can use it as a
|
|
|
|
;; drop-in replacement for the default tool chain and
|
|
|
|
;; have configure scripts find the compiler.
|
|
|
|
(symlink "clang" (string-append out "/bin/cc"))
|
|
|
|
(symlink "clang++" (string-append out "/bin/c++"))
|
|
|
|
|
2019-11-14 12:25:00 +00:00
|
|
|
(union-build (assoc-ref %outputs "debug")
|
|
|
|
(list (assoc-ref %build-inputs
|
|
|
|
"libc-debug")))
|
|
|
|
(union-build (assoc-ref %outputs "static")
|
|
|
|
(list (assoc-ref %build-inputs
|
|
|
|
"libc-static")))
|
|
|
|
#t))))
|
|
|
|
|
2020-09-28 19:19:32 +00:00
|
|
|
(native-search-paths
|
|
|
|
(append (package-native-search-paths clang)
|
|
|
|
(list (search-path-specification ;copied from glibc
|
|
|
|
(variable "GUIX_LOCPATH")
|
|
|
|
(files '("lib/locale"))))))
|
2019-11-14 12:25:00 +00:00
|
|
|
(search-paths (package-search-paths clang))
|
|
|
|
|
|
|
|
(license (package-license clang))
|
|
|
|
(home-page "https://clang.llvm.org")
|
|
|
|
(synopsis "Complete Clang toolchain for C/C++ development")
|
|
|
|
(description "This package provides a complete Clang toolchain for C/C++
|
|
|
|
development to be installed in user profiles. This includes Clang, as well as
|
|
|
|
libc (headers and binaries, plus debugging symbols in the @code{debug}
|
|
|
|
output), and Binutils.")
|
|
|
|
(outputs '("out" "debug" "static"))
|
|
|
|
(inputs `(("clang" ,clang)
|
|
|
|
("ld-wrapper" ,(car (assoc-ref (%final-inputs) "ld-wrapper")))
|
|
|
|
("binutils" ,binutils)
|
|
|
|
("libc" ,glibc)
|
|
|
|
("libc-debug" ,glibc "debug")
|
|
|
|
("libc-static" ,glibc "static")))))
|
|
|
|
|
2020-10-18 15:34:54 +00:00
|
|
|
(define-public llvm-11
|
2020-10-18 15:33:27 +00:00
|
|
|
(package
|
|
|
|
(name "llvm")
|
2021-01-16 20:22:28 +00:00
|
|
|
(version "11.0.0")
|
2020-10-18 15:33:27 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (llvm-uri "llvm" version))
|
|
|
|
(sha256
|
2021-01-16 20:22:28 +00:00
|
|
|
(base32
|
|
|
|
"0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"))))
|
2020-10-18 15:33:27 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(outputs '("out" "opt-viewer"))
|
|
|
|
(native-inputs
|
|
|
|
`(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
|
|
|
|
("perl" ,perl)))
|
|
|
|
(inputs
|
|
|
|
`(("libffi" ,libffi)))
|
|
|
|
(propagated-inputs
|
|
|
|
`(("zlib" ,zlib))) ;to use output from llvm-config
|
|
|
|
(arguments
|
|
|
|
`(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
|
|
|
|
"-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_INSTALL_UTILS=ON") ; Needed for rustc.
|
|
|
|
|
|
|
|
;; Don't use '-g' during the build, to save space.
|
|
|
|
#:build-type "Release"
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-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"))
|
|
|
|
#t))
|
|
|
|
(add-after 'install 'install-opt-viewer
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(opt-viewer-out (assoc-ref outputs "opt-viewer"))
|
|
|
|
(opt-viewer-share-dir (string-append opt-viewer-out "/share"))
|
|
|
|
(opt-viewer-dir (string-append opt-viewer-share-dir "/opt-viewer")))
|
|
|
|
(mkdir-p opt-viewer-share-dir)
|
|
|
|
(rename-file (string-append out "/share/opt-viewer")
|
|
|
|
opt-viewer-dir))
|
|
|
|
#t)))))
|
|
|
|
(home-page "https://www.llvm.org")
|
|
|
|
(synopsis "Optimizing compiler infrastructure")
|
|
|
|
(description
|
|
|
|
"LLVM is a compiler infrastructure designed for compile-time, link-time,
|
|
|
|
runtime, and idle-time optimization of programs from arbitrary programming
|
|
|
|
languages. It currently supports compilation of C and C++ programs, using
|
|
|
|
front-ends derived from GCC 4.0.1. A new front-end for the C family of
|
|
|
|
languages is in development. The compiler infrastructure includes mirror sets
|
|
|
|
of programming tools as well as libraries with equivalent functionality.")
|
|
|
|
(license license:asl2.0))) ;with LLVM exceptions, see LICENSE.txt
|
|
|
|
|
2020-10-18 15:34:54 +00:00
|
|
|
(define-public clang-runtime-11
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-11
|
2021-01-16 20:22:28 +00:00
|
|
|
"0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip"))
|
2020-10-18 15:34:54 +00:00
|
|
|
|
|
|
|
(define-public clang-11
|
|
|
|
(clang-from-llvm llvm-11 clang-runtime-11
|
2021-01-16 20:22:28 +00:00
|
|
|
"02ajkij85966vd150iy246mv16dsaph1kfi0y8wnncp8w6nar5hg"
|
2020-10-18 15:34:54 +00:00
|
|
|
#: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
|
2021-01-16 20:22:28 +00:00
|
|
|
"02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy")))))
|
2020-10-18 15:34:54 +00:00
|
|
|
|
|
|
|
(define-public clang-toolchain-11
|
|
|
|
(make-clang-toolchain clang-11))
|
|
|
|
|
|
|
|
(define-public llvm-10
|
|
|
|
(package
|
|
|
|
(inherit llvm-11)
|
|
|
|
(version "10.0.0")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (llvm-uri "llvm" version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"1pwgm6cr0xr5a0hrbqs1zvsvvjvy0yq1y47c96804wcs795s90yz"))))))
|
|
|
|
|
2020-04-24 10:20:25 +00:00
|
|
|
(define-public clang-runtime-10
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-10
|
|
|
|
"0x9c531k6ww21s2mkdwqx1vbdjmx6d4wmfb8gdbj0wqa796sczba"))
|
|
|
|
|
|
|
|
(define-public clang-10
|
|
|
|
(clang-from-llvm llvm-10 clang-runtime-10
|
|
|
|
"08fbxa2a0kr3ni35ckppj0kyvlcyaywrhpqwcdrdy0z900mhcnw8"
|
2020-05-28 09:46:59 +00:00
|
|
|
#:patches '("clang-10.0-libc-search-path.patch")
|
|
|
|
#:tools-extra
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "clang-tools-extra"
|
2020-05-28 09:46:59 +00:00
|
|
|
(package-version llvm-10)))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"074ija5s2jsdn0k035r2dzmryjmqxdnyg4xwvaqych2bazv8rpxc")))))
|
2020-04-24 10:20:25 +00:00
|
|
|
|
|
|
|
(define-public clang-toolchain-10
|
|
|
|
(make-clang-toolchain clang-10))
|
|
|
|
|
|
|
|
(define-public llvm-9
|
|
|
|
(package
|
|
|
|
(inherit llvm-10)
|
|
|
|
(version "9.0.1")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2020-04-24 10:20:25 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2020-06-07 21:25:40 +00:00
|
|
|
"16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880"))
|
|
|
|
(patches (search-patches
|
2020-11-14 06:10:29 +00:00
|
|
|
"llvm-9-fix-bitcast-miscompilation.patch"
|
|
|
|
"llvm-9-fix-scev-miscompilation.patch"
|
|
|
|
"llvm-9-fix-lpad-miscompilation.patch"))))))
|
2020-04-24 10:20:25 +00:00
|
|
|
|
|
|
|
(define-public clang-runtime-9
|
2015-08-17 07:21:09 +00:00
|
|
|
(clang-runtime-from-llvm
|
2020-04-24 10:20:25 +00:00
|
|
|
llvm-9
|
2020-03-05 16:27:20 +00:00
|
|
|
"0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2015-08-17 07:21:09 +00:00
|
|
|
|
2020-04-24 10:20:25 +00:00
|
|
|
(define-public clang-9
|
|
|
|
(clang-from-llvm llvm-9 clang-runtime-9
|
2020-02-23 23:54:06 +00:00
|
|
|
"0ls2h3iv4finqyflyhry21qhc9cm9ga7g1zq21020p065qmm2y2p"
|
|
|
|
#:patches '("clang-9.0-libc-search-path.patch")))
|
2019-02-15 10:28:14 +00:00
|
|
|
|
2020-04-24 10:20:25 +00:00
|
|
|
(define-public clang-toolchain-9
|
|
|
|
(make-clang-toolchain clang-9))
|
2019-11-14 12:25:00 +00:00
|
|
|
|
2020-02-23 23:54:06 +00:00
|
|
|
(define-public llvm-8
|
2019-11-19 17:15:42 +00:00
|
|
|
(package
|
2020-10-18 15:33:27 +00:00
|
|
|
(inherit llvm-9)
|
2020-02-23 23:54:06 +00:00
|
|
|
(version "8.0.0")
|
2019-11-19 17:15:42 +00:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-11-19 17:15:42 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2020-02-23 23:54:06 +00:00
|
|
|
"0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
|
|
|
|
(license license:ncsa)))
|
2019-11-19 17:15:42 +00:00
|
|
|
|
2020-02-23 23:54:06 +00:00
|
|
|
(define-public clang-runtime-8
|
2019-11-19 17:15:42 +00:00
|
|
|
(clang-runtime-from-llvm
|
2020-02-23 23:54:06 +00:00
|
|
|
llvm-8
|
2020-03-05 16:27:20 +00:00
|
|
|
"1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-11-19 17:15:42 +00:00
|
|
|
|
2020-02-23 23:54:06 +00:00
|
|
|
(define-public clang-8
|
|
|
|
(clang-from-llvm llvm-8 clang-runtime-8
|
|
|
|
"0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
|
|
|
|
#:patches '("clang-7.0-libc-search-path.patch")))
|
2019-11-19 17:15:42 +00:00
|
|
|
|
2020-02-23 23:54:06 +00:00
|
|
|
(define-public clang-toolchain-8
|
|
|
|
(make-clang-toolchain clang-8))
|
2019-11-19 17:15:42 +00:00
|
|
|
|
2019-06-28 18:53:20 +00:00
|
|
|
(define-public llvm-7
|
|
|
|
(package
|
2020-02-23 23:54:06 +00:00
|
|
|
(inherit llvm-8)
|
2019-06-28 18:53:20 +00:00
|
|
|
(version "7.0.1")
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-06-28 18:53:20 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3"))))))
|
|
|
|
|
|
|
|
(define-public clang-runtime-7
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-7
|
2020-03-05 16:27:20 +00:00
|
|
|
"065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq"
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-06-28 18:53:20 +00:00
|
|
|
|
|
|
|
(define-public clang-7
|
2020-02-23 23:36:55 +00:00
|
|
|
(clang-from-llvm llvm-7 clang-runtime-7
|
2019-06-28 18:53:20 +00:00
|
|
|
"067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"
|
|
|
|
#:patches '("clang-7.0-libc-search-path.patch")))
|
|
|
|
|
2019-11-14 12:25:00 +00:00
|
|
|
(define-public clang-toolchain-7
|
|
|
|
(make-clang-toolchain clang-7))
|
|
|
|
|
2019-02-15 10:28:14 +00:00
|
|
|
(define-public llvm-6
|
|
|
|
(package
|
2020-02-23 23:54:06 +00:00
|
|
|
(inherit llvm-7)
|
2019-02-15 10:28:14 +00:00
|
|
|
(version "6.0.1")
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-02-15 10:28:14 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
|
|
|
|
|
|
|
|
(define-public clang-runtime-6
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-6
|
2020-03-05 16:27:20 +00:00
|
|
|
"1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-02-15 10:28:14 +00:00
|
|
|
|
|
|
|
(define-public clang-6
|
2020-02-23 23:36:55 +00:00
|
|
|
(clang-from-llvm llvm-6 clang-runtime-6
|
2018-07-28 19:23:11 +00:00
|
|
|
"0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
|
2018-03-31 20:04:44 +00:00
|
|
|
#:patches '("clang-6.0-libc-search-path.patch")))
|
2016-07-07 05:06:44 +00:00
|
|
|
|
2019-11-14 12:25:00 +00:00
|
|
|
(define-public clang-toolchain-6
|
|
|
|
(make-clang-toolchain clang-6))
|
|
|
|
|
2017-05-10 13:34:59 +00:00
|
|
|
(define-public llvm-3.9.1
|
2020-02-23 23:54:06 +00:00
|
|
|
(package (inherit llvm-6)
|
2017-05-10 13:34:59 +00:00
|
|
|
(name "llvm")
|
|
|
|
(version "3.9.1")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2017-05-10 13:34:59 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2020-02-03 08:44:14 +00:00
|
|
|
"1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))
|
|
|
|
(outputs '("out"))
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments llvm)
|
|
|
|
((#:phases phases)
|
|
|
|
`(modify-phases ,phases
|
|
|
|
(delete 'install-opt-viewer)))))))
|
2017-05-10 13:34:59 +00:00
|
|
|
|
|
|
|
(define-public clang-runtime-3.9.1
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-3.9.1
|
2018-01-17 23:09:11 +00:00
|
|
|
"16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
|
2020-03-05 16:27:20 +00:00
|
|
|
'("clang-runtime-3.9-libsanitizer-mode-field.patch"
|
|
|
|
"clang-runtime-asan-build-fixes.patch"
|
2018-10-15 18:45:08 +00:00
|
|
|
"clang-runtime-esan-build-fixes.patch"
|
2018-10-15 18:51:23 +00:00
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2017-05-10 13:34:59 +00:00
|
|
|
|
|
|
|
(define-public clang-3.9.1
|
|
|
|
(clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
|
|
|
|
"0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
|
2018-03-31 20:04:44 +00:00
|
|
|
#:patches '("clang-3.8-libc-search-path.patch")))
|
|
|
|
|
|
|
|
(define-public llvm-3.8
|
2020-02-03 08:44:14 +00:00
|
|
|
(package (inherit llvm-3.9.1)
|
2018-03-31 20:04:44 +00:00
|
|
|
(name "llvm")
|
|
|
|
(version "3.8.1")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2018-03-31 20:04:44 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.8
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-3.8
|
|
|
|
"0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
|
2018-10-15 18:45:08 +00:00
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-03-05 16:27:20 +00:00
|
|
|
"clang-runtime-3.8-libsanitizer-mode-field.patch"
|
2018-10-15 18:51:23 +00:00
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2018-03-31 20:04:44 +00:00
|
|
|
|
|
|
|
(define-public clang-3.8
|
|
|
|
(clang-from-llvm llvm-3.8 clang-runtime-3.8
|
|
|
|
"1prc72xmkgx8wrzmrr337776676nhsp1qd3mw2bvb22bzdnq7lsc"
|
|
|
|
#:patches '("clang-3.8-libc-search-path.patch")))
|
2017-05-10 13:34:59 +00:00
|
|
|
|
2016-07-07 05:06:44 +00:00
|
|
|
(define-public llvm-3.7
|
2020-02-23 23:54:06 +00:00
|
|
|
(package (inherit llvm-3.8)
|
2016-07-07 05:06:44 +00:00
|
|
|
(version "3.7.1")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2016-07-07 05:06:44 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.7
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-3.7
|
2018-01-17 23:09:11 +00:00
|
|
|
"10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
|
2018-10-15 18:45:08 +00:00
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-03-05 16:27:20 +00:00
|
|
|
"clang-runtime-3.8-libsanitizer-mode-field.patch"
|
2018-10-15 18:51:23 +00:00
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2016-07-07 05:06:44 +00:00
|
|
|
|
|
|
|
(define-public clang-3.7
|
|
|
|
(clang-from-llvm llvm-3.7 clang-runtime-3.7
|
2018-03-31 20:04:44 +00:00
|
|
|
"0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
|
|
|
|
#:patches '("clang-3.5-libc-search-path.patch")))
|
2016-07-07 05:06:43 +00:00
|
|
|
|
|
|
|
(define-public llvm-3.6
|
2020-02-23 23:54:06 +00:00
|
|
|
(package (inherit llvm-3.7)
|
2016-07-07 05:06:43 +00:00
|
|
|
(version "3.6.2")
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2016-07-07 05:06:43 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.6
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
llvm-3.6
|
2018-01-17 23:09:11 +00:00
|
|
|
"11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg"
|
2020-03-05 16:27:20 +00:00
|
|
|
'("clang-runtime-asan-build-fixes.patch")))
|
2016-07-07 05:06:43 +00:00
|
|
|
|
|
|
|
(define-public clang-3.6
|
|
|
|
(clang-from-llvm llvm-3.6 clang-runtime-3.6
|
2018-03-31 20:04:44 +00:00
|
|
|
"1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"
|
|
|
|
#:patches '("clang-3.5-libc-search-path.patch")))
|
2015-03-02 13:36:31 +00:00
|
|
|
|
|
|
|
(define-public llvm-3.5
|
2020-02-23 23:54:06 +00:00
|
|
|
(package (inherit llvm-3.6)
|
2016-07-07 05:06:40 +00:00
|
|
|
(version "3.5.2")
|
2015-03-02 13:36:31 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "llvm" version))
|
2017-05-04 12:18:38 +00:00
|
|
|
(patches
|
|
|
|
(search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
|
2015-03-02 13:36:31 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2016-07-07 05:06:40 +00:00
|
|
|
"0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
|
2015-03-02 13:36:31 +00:00
|
|
|
|
2015-08-17 07:21:09 +00:00
|
|
|
(define-public clang-runtime-3.5
|
2020-02-25 21:47:17 +00:00
|
|
|
(let ((runtime (clang-runtime-from-llvm
|
|
|
|
llvm-3.5
|
|
|
|
"1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
|
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-08-11 15:47:50 +00:00
|
|
|
"clang-runtime-3.5-libsanitizer-mode-field.patch"
|
2020-02-25 21:47:17 +00:00
|
|
|
"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 (assoc-ref inputs "libtirpc")
|
|
|
|
"/include/tirpc/:"
|
|
|
|
(or (getenv "CPATH") "")))
|
|
|
|
(setenv "CPLUS_INCLUDE_PATH"
|
|
|
|
(string-append (assoc-ref inputs "libtirpc")
|
|
|
|
"/include/tirpc/:"
|
|
|
|
(or (getenv "CPLUS_INCLUDE_PATH") "")))
|
|
|
|
#t))))))
|
|
|
|
(inputs
|
|
|
|
`(("libtirpc" ,libtirpc)
|
|
|
|
("llvm" ,llvm-3.5))))))
|
2015-08-17 07:21:09 +00:00
|
|
|
|
2015-03-02 13:36:31 +00:00
|
|
|
(define-public clang-3.5
|
2015-08-17 07:21:09 +00:00
|
|
|
(clang-from-llvm llvm-3.5 clang-runtime-3.5
|
2018-03-31 20:04:44 +00:00
|
|
|
"0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
|
|
|
|
#:patches '("clang-3.5-libc-search-path.patch")))
|
2016-09-14 09:25:29 +00:00
|
|
|
|
2020-10-18 15:33:27 +00:00
|
|
|
;; Default LLVM and Clang version.
|
|
|
|
(define-public llvm llvm-9)
|
|
|
|
(define-public clang-runtime clang-runtime-9)
|
|
|
|
(define-public clang clang-9)
|
|
|
|
(define-public clang-toolchain clang-toolchain-9)
|
|
|
|
|
|
|
|
(define-public lld
|
|
|
|
(package
|
|
|
|
(name "lld")
|
2020-10-18 15:36:25 +00:00
|
|
|
(version "11.0.0")
|
2020-10-18 15:33:27 +00:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (llvm-uri "lld" version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2020-10-18 15:36:25 +00:00
|
|
|
"077xyh7sij6mhp4dc4kdcmp9whrpz332fa12rwxnzp3wgd5bxrzg"))))
|
2020-10-18 15:33:27 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(inputs
|
2020-10-18 15:36:25 +00:00
|
|
|
`(("llvm" ,llvm-11)))
|
2020-10-18 15:33:27 +00:00
|
|
|
(arguments
|
|
|
|
`(#:build-type "Release"
|
|
|
|
;; TODO: Tests require the lit tool, which isn't installed by the LLVM
|
|
|
|
;; package.
|
|
|
|
#:tests? #f))
|
|
|
|
(home-page "https://lld.llvm.org/")
|
|
|
|
(synopsis "Linker from the LLVM project")
|
|
|
|
(description "LLD is a high-performance linker, built as a set of reusable
|
|
|
|
components which highly leverage existing libraries in the larger LLVM Project.")
|
|
|
|
(license license:asl2.0))) ; With LLVM exception
|
|
|
|
|
2020-10-21 19:31:36 +00:00
|
|
|
(define-public lldb
|
|
|
|
(package
|
|
|
|
(name "lldb")
|
|
|
|
(version "11.0.0")
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (llvm-uri "lldb" version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"0wic9lyb2la9bkzdc13szkm4f793w1mddp50xvh237iraygw0w45"))))
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:configure-flags '("-DCMAKE_CXX_COMPILER=clang++")))
|
|
|
|
(native-inputs
|
|
|
|
`(("pkg-config" ,pkg-config)
|
|
|
|
("swig" ,swig)))
|
|
|
|
(inputs
|
|
|
|
`(("clang" ,clang-11)
|
|
|
|
("llvm" ,llvm-11)
|
|
|
|
|
|
|
|
;; Optional (but recommended) inputs.
|
|
|
|
("curses" ,ncurses)
|
|
|
|
("editline" ,libedit)
|
|
|
|
("liblzma" ,xz)
|
|
|
|
("libxml2" ,libxml2)
|
|
|
|
("lua" ,lua)
|
|
|
|
("python" ,python)))
|
|
|
|
(home-page "https://lldb.llvm.org/")
|
|
|
|
(synopsis "Low level debugger")
|
|
|
|
(description
|
|
|
|
"LLDB is a high performance debugger built as a set of reusable components
|
|
|
|
which highly leverage existing libraries in the larger LLVM project.")
|
|
|
|
(license license:asl2.0))) ;with LLVM exceptions
|
|
|
|
|
2020-02-23 22:45:32 +00:00
|
|
|
(define-public libcxx
|
|
|
|
(package
|
|
|
|
(name "libcxx")
|
2020-02-23 23:54:06 +00:00
|
|
|
(version "9.0.1")
|
2020-02-23 22:45:32 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "libcxx" version))
|
2020-02-23 22:45:32 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2020-02-23 23:54:06 +00:00
|
|
|
"0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
|
2020-02-23 22:45:32 +00:00
|
|
|
(build-system cmake-build-system)
|
2020-03-15 15:08:06 +00:00
|
|
|
(arguments
|
|
|
|
`(#: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 #t
|
|
|
|
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
|
|
|
|
(getenv "CPLUS_INCLUDE_PATH"))
|
|
|
|
#t))))))
|
2020-02-23 22:45:32 +00:00
|
|
|
(native-inputs
|
|
|
|
`(("clang" ,clang)
|
|
|
|
("llvm" ,llvm)))
|
|
|
|
(home-page "https://libcxx.llvm.org")
|
|
|
|
(synopsis "C++ standard library")
|
|
|
|
(description
|
|
|
|
"This package provides an implementation of the C++ standard library for
|
|
|
|
use with Clang, targeting C++11, C++14 and above.")
|
|
|
|
(license license:expat)))
|
|
|
|
|
|
|
|
;; Libcxx files specifically used by PySide2.
|
|
|
|
(define-public libcxx-6
|
|
|
|
(package
|
|
|
|
(inherit libcxx)
|
|
|
|
(version (package-version llvm-6))
|
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(inherit (package-source libcxx))
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "libcxx" version))
|
2020-02-23 22:45:32 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
|
|
|
|
(native-inputs
|
|
|
|
`(("clang" ,clang-6)
|
|
|
|
("llvm" ,llvm-6)))))
|
|
|
|
|
|
|
|
(define-public libclc
|
|
|
|
(package
|
|
|
|
(name "libclc")
|
2020-02-23 23:54:06 +00:00
|
|
|
(version "9.0.1")
|
2020-02-23 22:45:32 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
gnu: Remove ".git" from "https://github/…/….git".
Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix
swh) would sometimes return #f for these because the ".git" URLs are
redirects to the non-".git" URLs. Consequently, 'guix lint -c archival'
would keep saying "scheduled Software Heritage archival"; likewise, the
fallback download code would fail.
* gnu/packages/ada.scm,
gnu/packages/admin.scm,
gnu/packages/aidc.scm,
gnu/packages/algebra.scm,
gnu/packages/android.scm,
gnu/packages/animation.scm,
gnu/packages/arcan.scm,
gnu/packages/assembly.scm,
gnu/packages/audio.scm,
gnu/packages/authentication.scm,
gnu/packages/avr.scm,
gnu/packages/axoloti.scm,
gnu/packages/backup.scm,
gnu/packages/bash.scm,
gnu/packages/benchmark.scm,
gnu/packages/bioconductor.scm,
gnu/packages/bioinformatics.scm,
gnu/packages/bittorrent.scm,
gnu/packages/boost.scm,
gnu/packages/build-tools.scm,
gnu/packages/c.scm,
gnu/packages/calendar.scm,
gnu/packages/cdrom.scm,
gnu/packages/check.scm,
gnu/packages/chemistry.scm,
gnu/packages/chez.scm,
gnu/packages/clojure.scm,
gnu/packages/code.scm,
gnu/packages/compression.scm,
gnu/packages/compton.scm,
gnu/packages/coq.scm,
gnu/packages/cpp.scm,
gnu/packages/cran.scm,
gnu/packages/crypto.scm,
gnu/packages/curl.scm,
gnu/packages/databases.scm,
gnu/packages/datastructures.scm,
gnu/packages/debug.scm,
gnu/packages/disk.scm,
gnu/packages/distributed.scm,
gnu/packages/django.scm,
gnu/packages/dlang.scm,
gnu/packages/dns.scm,
gnu/packages/docker.scm,
gnu/packages/education.scm,
gnu/packages/efi.scm,
gnu/packages/elixir.scm,
gnu/packages/emacs-xyz.scm,
gnu/packages/embedded.scm,
gnu/packages/emulators.scm,
gnu/packages/engineering.scm,
gnu/packages/erlang.scm,
gnu/packages/fabric-management.scm,
gnu/packages/file-systems.scm,
gnu/packages/finance.scm,
gnu/packages/firmware.scm,
gnu/packages/flashing-tools.scm,
gnu/packages/fonts.scm,
gnu/packages/fontutils.scm,
gnu/packages/fpga.scm,
gnu/packages/game-development.scm,
gnu/packages/games.scm,
gnu/packages/genealogy.scm,
gnu/packages/genimage.scm,
gnu/packages/geo.scm,
gnu/packages/gimp.scm,
gnu/packages/gl.scm,
gnu/packages/gnome-xyz.scm,
gnu/packages/gnome.scm,
gnu/packages/gnuzilla.scm,
gnu/packages/golang.scm,
gnu/packages/gpodder.scm,
gnu/packages/graph.scm,
gnu/packages/graphics.scm,
gnu/packages/graphviz.scm,
gnu/packages/groff.scm,
gnu/packages/groovy.scm,
gnu/packages/gtk.scm,
gnu/packages/guile-xyz.scm,
gnu/packages/guile.scm,
gnu/packages/hardware.scm,
gnu/packages/haskell-apps.scm,
gnu/packages/haskell-xyz.scm,
gnu/packages/hexedit.scm,
gnu/packages/i2p.scm,
gnu/packages/ibus.scm,
gnu/packages/image-processing.scm,
gnu/packages/image-viewers.scm,
gnu/packages/image.scm,
gnu/packages/ipfs.scm,
gnu/packages/java-graphics.scm,
gnu/packages/java-maths.scm,
gnu/packages/java.scm,
gnu/packages/javascript.scm,
gnu/packages/jrnl.scm,
gnu/packages/julia.scm,
gnu/packages/jupyter.scm,
gnu/packages/kodi.scm,
gnu/packages/language.scm,
gnu/packages/lego.scm,
gnu/packages/less.scm,
gnu/packages/libusb.scm,
gnu/packages/linux.scm,
gnu/packages/lirc.scm,
gnu/packages/lisp-xyz.scm,
gnu/packages/llvm.scm,
gnu/packages/logging.scm,
gnu/packages/lolcode.scm,
gnu/packages/lua.scm,
gnu/packages/lxde.scm,
gnu/packages/lxqt.scm,
gnu/packages/machine-learning.scm,
gnu/packages/mail.scm,
gnu/packages/markup.scm,
gnu/packages/maths.scm,
gnu/packages/maven.scm,
gnu/packages/mes.scm,
gnu/packages/messaging.scm,
gnu/packages/monitoring.scm,
gnu/packages/mpd.scm,
gnu/packages/music.scm,
gnu/packages/networking.scm,
gnu/packages/node-xyz.scm,
gnu/packages/ocaml.scm,
gnu/packages/ocr.scm,
gnu/packages/onc-rpc.scm,
gnu/packages/opencl.scm,
gnu/packages/opencog.scm,
gnu/packages/pantheon.scm,
gnu/packages/password-utils.scm,
gnu/packages/patchutils.scm,
gnu/packages/pdf.scm,
gnu/packages/perl6.scm,
gnu/packages/phabricator.scm,
gnu/packages/popt.scm,
gnu/packages/printers.scm,
gnu/packages/prolog.scm,
gnu/packages/protobuf.scm,
gnu/packages/pulseaudio.scm,
gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm,
gnu/packages/python-xyz.scm,
gnu/packages/qt.scm,
gnu/packages/radio.scm,
gnu/packages/rails.scm,
gnu/packages/rdf.scm,
gnu/packages/rednotebook.scm,
gnu/packages/rpc.scm,
gnu/packages/rsync.scm,
gnu/packages/ruby.scm,
gnu/packages/rust.scm,
gnu/packages/scheme.scm,
gnu/packages/screen.scm,
gnu/packages/security-token.scm,
gnu/packages/selinux.scm,
gnu/packages/serialization.scm,
gnu/packages/shells.scm,
gnu/packages/shellutils.scm,
gnu/packages/simh.scm,
gnu/packages/sml.scm,
gnu/packages/ssh.scm,
gnu/packages/statistics.scm,
gnu/packages/stenography.scm,
gnu/packages/sync.scm,
gnu/packages/syncthing.scm,
gnu/packages/synergy.scm,
gnu/packages/telephony.scm,
gnu/packages/terminals.scm,
gnu/packages/tex.scm,
gnu/packages/texinfo.scm,
gnu/packages/text-editors.scm,
gnu/packages/textutils.scm,
gnu/packages/time.scm,
gnu/packages/tmux.scm,
gnu/packages/tor.scm,
gnu/packages/toys.scm,
gnu/packages/version-control.scm,
gnu/packages/video.scm,
gnu/packages/vim.scm,
gnu/packages/virtualization.scm,
gnu/packages/vlang.scm,
gnu/packages/vnc.scm,
gnu/packages/vpn.scm,
gnu/packages/web-browsers.scm,
gnu/packages/web.scm,
gnu/packages/wireservice.scm,
gnu/packages/wm.scm,
gnu/packages/wxwidgets.scm,
gnu/packages/xdisorg.scm,
gnu/packages/xml.scm,
gnu/packages/xorg.scm,
tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
2020-07-12 20:53:28 +00:00
|
|
|
(url "https://github.com/llvm/llvm-project")
|
2020-02-23 22:45:32 +00:00
|
|
|
(commit (string-append "llvmorg-" version))))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2020-02-23 23:54:06 +00:00
|
|
|
"1d1qayvrvvc1di7s7jfxnjvxq2az4lwq1sw1b2gq2ic0nksvajz0"))))
|
2020-02-23 22:45:32 +00:00
|
|
|
(build-system cmake-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:configure-flags
|
|
|
|
(list (string-append "-DLLVM_CLANG="
|
|
|
|
(assoc-ref %build-inputs "clang")
|
|
|
|
"/bin/clang")
|
|
|
|
(string-append "-DPYTHON="
|
|
|
|
(assoc-ref %build-inputs "python")
|
|
|
|
"/bin/python3"))
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'chdir
|
|
|
|
(lambda _ (chdir "libclc") #t)))))
|
|
|
|
(native-inputs
|
|
|
|
`(("clang" ,clang)
|
|
|
|
("llvm" ,llvm)
|
|
|
|
("python" ,python)))
|
|
|
|
(home-page "https://libclc.llvm.org")
|
|
|
|
(synopsis "Libraries for the OpenCL programming language")
|
|
|
|
(description
|
|
|
|
"This package provides an implementation of the OpenCL library
|
|
|
|
requirements according to version 1.1 of the OpenCL specification.")
|
|
|
|
;; Apache license 2.0 with LLVM exception
|
|
|
|
(license license:asl2.0)))
|
|
|
|
|
|
|
|
(define-public libomp
|
|
|
|
(package
|
|
|
|
(name "libomp")
|
2020-02-23 23:54:06 +00:00
|
|
|
(version "9.0.1")
|
2020-02-23 22:45:32 +00:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
2020-10-07 13:37:43 +00:00
|
|
|
(uri (llvm-uri "openmp" version))
|
2020-02-23 22:45:32 +00:00
|
|
|
(sha256
|
|
|
|
(base32
|
2020-02-23 23:54:06 +00:00
|
|
|
"1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"))
|
2020-02-23 22:45:32 +00:00
|
|
|
(file-name (string-append "libomp-" version ".tar.xz"))))
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
;; XXX: Note this gets built with GCC because building with Clang itself
|
|
|
|
;; fails (missing <atomic>, even when libcxx is added as an input.)
|
|
|
|
(arguments
|
|
|
|
'(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
|
|
|
|
"-DOPENMP_TEST_C_COMPILER=clang"
|
|
|
|
"-DOPENMP_TEST_CXX_COMPILER=clang++")
|
|
|
|
#:test-target "check-libomp"))
|
|
|
|
(native-inputs
|
|
|
|
`(("clang" ,clang)
|
|
|
|
("llvm" ,llvm)
|
|
|
|
("perl" ,perl)
|
|
|
|
("pkg-config" ,pkg-config)))
|
|
|
|
(inputs
|
|
|
|
`(("hwloc" ,hwloc "lib")))
|
|
|
|
(home-page "https://openmp.llvm.org")
|
|
|
|
(synopsis "OpenMP run-time support library")
|
|
|
|
(description
|
|
|
|
"This package provides the run-time support library developed by the LLVM
|
|
|
|
project for the OpenMP multi-theaded programming extension. This package
|
|
|
|
notably provides @file{libgomp.so}, which is has a binary interface compatible
|
|
|
|
with that of libgomp, the GNU Offloading and Multi Processing Library.")
|
|
|
|
(license license:expat)))
|
|
|
|
|
2018-08-29 15:04:13 +00:00
|
|
|
(define-public python-llvmlite
|
|
|
|
(package
|
|
|
|
(name "python-llvmlite")
|
2020-11-14 03:05:26 +00:00
|
|
|
(version "0.34.0")
|
2018-08-29 15:04:13 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (pypi-uri "llvmlite" version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2020-11-14 03:05:26 +00:00
|
|
|
"0qqzs6h34002ig2jn31vk08q9hh5kn84lhmv4bljz3yakg8y0gph"))))
|
2018-08-29 15:04:13 +00:00
|
|
|
(build-system python-build-system)
|
2019-12-23 23:29:13 +00:00
|
|
|
(arguments
|
2020-11-14 03:05:26 +00:00
|
|
|
`(#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'patch-reference-to-llvmlite.so
|
|
|
|
;; ctypes.CDLL uses dlopen to load libllvmlite.so, which
|
|
|
|
;; fails, so locate it by its absolute path. Change it in
|
|
|
|
;; ffi.py, not utils.py, because setup.py relies on the
|
|
|
|
;; output of get_library_name for proper installation.
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(libllvmlite.so (string-append out "/lib/python"
|
|
|
|
,(version-major+minor
|
|
|
|
(package-version python))
|
|
|
|
"/site-packages/llvmlite/"
|
|
|
|
"binding/libllvmlite.so")))
|
|
|
|
(substitute* "llvmlite/binding/ffi.py"
|
|
|
|
(("_lib_name = get_library_name\\(\\)")
|
|
|
|
(format #f "_lib_name = ~s" libllvmlite.so)))
|
|
|
|
#t)))
|
|
|
|
(add-after 'unpack 'skip-failing-tests
|
|
|
|
(lambda _
|
|
|
|
(substitute* "llvmlite/tests/test_binding.py"
|
|
|
|
((" def test_libm\\(self\\).*" all)
|
|
|
|
(string-append " @unittest.skip('Fails on Guix')\n" all)))
|
|
|
|
#t))
|
|
|
|
(add-before 'build 'set-compiler/linker-flags
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let ((llvm (assoc-ref inputs "llvm")))
|
|
|
|
;; Refer to ffi/Makefile.linux.
|
|
|
|
(setenv "CPPFLAGS" "-fPIC")
|
|
|
|
(setenv "LDFLAGS" (string-append "-Wl,-rpath="
|
|
|
|
llvm "/lib"))
|
|
|
|
#t))))))
|
2018-08-29 15:04:13 +00:00
|
|
|
(inputs
|
|
|
|
`(("llvm"
|
2020-11-14 03:05:26 +00:00
|
|
|
,(let* ((patches-commit "061ab39e1d4591f3aa842458252a19ad01858167")
|
|
|
|
(patch-uri (lambda (name)
|
|
|
|
(string-append
|
|
|
|
"https://raw.githubusercontent.com/numba/"
|
|
|
|
"llvmlite/" patches-commit "/conda-recipes/"
|
|
|
|
name)))
|
|
|
|
(patch-origin (lambda (name hash)
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (patch-uri name))
|
|
|
|
(sha256 (base32 hash)))))
|
|
|
|
(arch-independent-patches
|
2020-07-05 15:39:40 +00:00
|
|
|
(list
|
2020-11-14 03:05:26 +00:00
|
|
|
(patch-origin
|
|
|
|
"partial-testing.patch"
|
|
|
|
"1cwy4jsmijd838q0bylxl77vrwrb7ksijfly5062ay32303jmj86")
|
|
|
|
(patch-origin
|
|
|
|
"0001-Revert-Limit-size-of-non-GlobalValue-name.patch"
|
|
|
|
"0n4k7za0smx6qwdipsh6x5lm7bfvzzb3p9r8q1zq1dqi4na21295"))))
|
|
|
|
(if (string=? "aarch64-linux" (%current-system))
|
|
|
|
(package
|
|
|
|
(inherit llvm-9)
|
|
|
|
(source
|
2020-07-05 15:39:40 +00:00
|
|
|
(origin
|
2020-11-14 03:05:26 +00:00
|
|
|
(inherit (package-source llvm-9))
|
|
|
|
(patches
|
|
|
|
`(,(patch-origin
|
|
|
|
"intel-D47188-svml-VF_LLVM9.patch"
|
|
|
|
"1f9ld7wc8bn4gbvdsmk07w1rq371h42vy05rxsq9a22f57rljqbd")
|
|
|
|
,@arch-independent-patches
|
|
|
|
,@(origin-patches (package-source llvm-9)))))))
|
|
|
|
(package
|
|
|
|
(inherit llvm-10)
|
|
|
|
(source
|
2020-07-05 15:39:40 +00:00
|
|
|
(origin
|
2020-11-14 03:05:26 +00:00
|
|
|
(inherit (package-source llvm-10))
|
|
|
|
(patches
|
|
|
|
`(,(patch-origin
|
|
|
|
"intel-D47188-svml-VF.patch"
|
|
|
|
"0n46qjwfl7i12bl7wp0cyxl277axfvaaz5lxx5kdlgwjcpa582dg")
|
|
|
|
,(patch-origin
|
|
|
|
"expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch"
|
|
|
|
"0jxhjkkwwi1cy898l2n57l73ckpw0v73lqnrifp7r1mwpsh624nv")
|
|
|
|
,@arch-independent-patches
|
|
|
|
,@(origin-patches (package-source llvm-10))))))))))))
|
|
|
|
(home-page "https://llvmlite.pydata.org")
|
2018-08-29 15:04:13 +00:00
|
|
|
(synopsis "Wrapper around basic LLVM functionality")
|
|
|
|
(description
|
|
|
|
"This package provides a Python binding to LLVM for use in Numba.")
|
|
|
|
(license license:bsd-3)))
|
2018-11-12 21:27:41 +00:00
|
|
|
|
|
|
|
(define-public emacs-clang-format
|
|
|
|
(package
|
|
|
|
(inherit clang)
|
|
|
|
(name "emacs-clang-format")
|
|
|
|
(build-system emacs-build-system)
|
|
|
|
(inputs
|
|
|
|
`(("clang" ,clang)))
|
|
|
|
(arguments
|
|
|
|
`(#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'configure
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let ((clang (assoc-ref inputs "clang")))
|
|
|
|
(copy-file "tools/clang-format/clang-format.el" "clang-format.el")
|
|
|
|
(emacs-substitute-variables "clang-format.el"
|
|
|
|
("clang-format-executable"
|
|
|
|
(string-append clang "/bin/clang-format"))))
|
|
|
|
#t)))))
|
|
|
|
(synopsis "Format code using clang-format")
|
2020-04-12 20:29:47 +00:00
|
|
|
(description "This package filters code through @code{clang-format}
|
2018-11-12 21:27:41 +00:00
|
|
|
to fix its formatting. @code{clang-format} is a tool that formats
|
|
|
|
C/C++/Obj-C code according to a set of style options, see
|
2019-02-15 10:16:31 +00:00
|
|
|
@url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
|
2018-11-26 11:42:39 +00:00
|
|
|
|
|
|
|
(define-public emacs-clang-rename
|
|
|
|
(package
|
|
|
|
(inherit clang)
|
|
|
|
(name "emacs-clang-rename")
|
|
|
|
(build-system emacs-build-system)
|
|
|
|
(inputs
|
|
|
|
`(("clang" ,clang)))
|
|
|
|
(arguments
|
|
|
|
`(#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'configure
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(let ((clang (assoc-ref inputs "clang")))
|
|
|
|
(copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
|
|
|
|
(emacs-substitute-variables "clang-rename.el"
|
|
|
|
("clang-rename-binary"
|
|
|
|
(string-append clang "/bin/clang-rename"))))
|
|
|
|
#t)))))
|
|
|
|
(synopsis "Rename every occurrence of a symbol using clang-rename")
|
|
|
|
(description "This package renames every occurrence of a symbol at point
|
|
|
|
using @code{clang-rename}.")))
|
2021-03-02 20:52:03 +00:00
|
|
|
|
|
|
|
(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.
|
|
|
|
(mlambdaq (llvm)
|
|
|
|
(package
|
|
|
|
(inherit llvm)
|
|
|
|
(name "ocaml-llvm")
|
|
|
|
(outputs '("out"))
|
|
|
|
(arguments
|
|
|
|
`(#:configure-flags
|
|
|
|
(list
|
|
|
|
(string-append "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="
|
|
|
|
(assoc-ref %build-inputs "llvm") "/lib")
|
|
|
|
"-DBUILD_SHARED_LIBS=TRUE"
|
|
|
|
"-DLLVM_OCAML_OUT_OF_TREE=TRUE"
|
|
|
|
(string-append "-DLLVM_OCAML_INSTALL_PATH="
|
|
|
|
(assoc-ref %outputs "out") "/lib/ocaml/site-lib"))
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(replace 'build
|
|
|
|
(lambda _
|
|
|
|
(invoke "make" "ocaml_all")))
|
|
|
|
(replace 'install
|
|
|
|
(lambda _
|
|
|
|
(invoke "cmake" "-P" "bindings/ocaml/cmake_install.cmake"))))))
|
|
|
|
(inputs
|
|
|
|
`(("llvm" ,llvm)))
|
|
|
|
(native-inputs
|
|
|
|
`(("ocaml" ,ocaml)
|
|
|
|
("ocaml-findlib" ,ocaml-findlib)
|
|
|
|
("ocaml-ounit" ,ocaml-ounit)
|
|
|
|
("python" ,python)))
|
|
|
|
(propagated-inputs
|
|
|
|
`(("ocaml-integers" ,ocaml-integers)
|
|
|
|
("ocaml-ctypes" ,ocaml-ctypes)))
|
|
|
|
(synopsis "OCaml bindings to LLVM")
|
|
|
|
(description "This package contains the OCaml bindings distributed with
|
|
|
|
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))
|