2014-12-07 16:19:35 -05:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2018-10-05 23:58:43 -04:00
|
|
|
|
;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org>
|
2015-03-02 08:36:31 -05:00
|
|
|
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
2021-07-16 11:20:09 -04:00
|
|
|
|
;;; Copyright © 2015, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
2016-07-07 01:06:42 -04:00
|
|
|
|
;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
|
2021-04-21 05:04:25 -04:00
|
|
|
|
;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
|
2017-05-10 09:34:59 -04:00
|
|
|
|
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
2022-01-07 12:11:16 -05:00
|
|
|
|
;;; Copyright © 2018–2022 Marius Bakke <mbakke@fastmail.com>
|
2019-07-08 09:28:41 -04:00
|
|
|
|
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
2021-06-01 15:50:01 -04:00
|
|
|
|
;;; Copyright © 2018, 2021 Efraim Flashner <efraim@flashner.co.il>
|
2018-11-12 16:27:41 -05:00
|
|
|
|
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
|
|
|
|
|
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
|
2019-05-06 07:03:32 -04:00
|
|
|
|
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
|
2019-11-19 10:20:40 -05:00
|
|
|
|
;;; Copyright © 2019 Arm Ltd <David.Truby@arm.com>
|
2019-11-14 07:25:00 -05:00
|
|
|
|
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
2019-12-23 18:29:13 -05:00
|
|
|
|
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
|
2020-04-20 17:56:13 -04:00
|
|
|
|
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
|
2020-06-07 17:25:40 -04:00
|
|
|
|
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
|
2022-04-10 12:38:58 -04:00
|
|
|
|
;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
|
2021-10-17 22:41:01 -04:00
|
|
|
|
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
2021-03-02 15:52:03 -05:00
|
|
|
|
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
|
2021-09-09 05:58:47 -04:00
|
|
|
|
;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
|
2022-04-10 12:38:58 -04:00
|
|
|
|
;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
|
2021-11-18 10:26:50 -05:00
|
|
|
|
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
2022-02-04 15:52:37 -05:00
|
|
|
|
;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
|
2014-12-07 16:19:35 -05: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 01:06:41 -04:00
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
2014-12-07 16:19:35 -05:00
|
|
|
|
#:use-module (guix download)
|
2021-09-23 17:08:25 -04:00
|
|
|
|
#:use-module (guix gexp)
|
2019-06-24 08:03:57 -04:00
|
|
|
|
#:use-module (guix git-download)
|
2021-03-02 15:52:03 -05:00
|
|
|
|
#:use-module (guix memoization)
|
2014-12-07 16:19:35 -05:00
|
|
|
|
#:use-module (guix utils)
|
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
|
#:use-module (guix build-system cmake)
|
2018-11-12 16:27:41 -05:00
|
|
|
|
#:use-module (guix build-system emacs)
|
2018-08-29 11:04:13 -04:00
|
|
|
|
#:use-module (guix build-system python)
|
2019-11-14 07:25:00 -05:00
|
|
|
|
#:use-module (guix build-system trivial)
|
2014-12-07 16:19:35 -05:00
|
|
|
|
#:use-module (gnu packages)
|
2019-11-14 07:25:00 -05:00
|
|
|
|
#:use-module (gnu packages base)
|
2015-06-19 11:18:03 -04:00
|
|
|
|
#:use-module (gnu packages gcc)
|
|
|
|
|
#:use-module (gnu packages bootstrap) ;glibc-dynamic-linker
|
2021-11-18 10:26:50 -05:00
|
|
|
|
#:use-module (gnu packages check) ;python-lit
|
2016-07-07 01:06:42 -04:00
|
|
|
|
#:use-module (gnu packages compression)
|
2021-11-18 10:20:16 -05:00
|
|
|
|
#:use-module (gnu packages julia) ;julia-patch
|
2020-10-21 15:31:36 -04:00
|
|
|
|
#:use-module (gnu packages libedit)
|
2016-07-07 01:06:42 -04:00
|
|
|
|
#:use-module (gnu packages libffi)
|
2020-10-21 15:31:36 -04:00
|
|
|
|
#:use-module (gnu packages lua)
|
2019-04-16 11:07:15 -04:00
|
|
|
|
#:use-module (gnu packages mpi)
|
2020-10-21 15:31:36 -04:00
|
|
|
|
#:use-module (gnu packages ncurses)
|
2021-03-02 15:52:03 -05:00
|
|
|
|
#:use-module (gnu packages ocaml)
|
2020-02-25 16:47:17 -05:00
|
|
|
|
#:use-module (gnu packages onc-rpc)
|
2014-12-07 16:19:35 -05:00
|
|
|
|
#:use-module (gnu packages perl)
|
2019-04-16 11:07:15 -04:00
|
|
|
|
#:use-module (gnu packages pkg-config)
|
2014-12-07 16:19:35 -05:00
|
|
|
|
#:use-module (gnu packages python)
|
2020-10-21 15:31:36 -04:00
|
|
|
|
#:use-module (gnu packages swig)
|
2019-07-23 10:57:25 -04:00
|
|
|
|
#:use-module (gnu packages xml)
|
2021-11-18 10:26:50 -05:00
|
|
|
|
#:use-module (srfi srfi-1)
|
2021-11-18 10:20:16 -05:00
|
|
|
|
#:use-module (ice-9 match)
|
2021-10-17 22:41:01 -04:00
|
|
|
|
#:export (make-lld-wrapper
|
|
|
|
|
system->llvm-target))
|
2019-07-23 10:57:25 -04:00
|
|
|
|
|
|
|
|
|
(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 14:10:08 -04:00
|
|
|
|
("i686" => "X86")
|
|
|
|
|
("i586" => "X86"))))
|
2014-12-07 16:19:35 -05:00
|
|
|
|
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(define (llvm-uri component version)
|
2022-02-03 15:47:35 -05:00
|
|
|
|
;; LLVM release candidate file names are formatted 'tool-A.B.C-rcN/tool-A.B.CrcN.src.tar.xz'
|
|
|
|
|
;; so we specify the version as A.B.C-rcN and delete the hyphen when referencing the file name.
|
2020-12-17 09:59:25 -05:00
|
|
|
|
(string-append "https://github.com/llvm/llvm-project/releases/download"
|
2022-02-03 15:47:35 -05:00
|
|
|
|
"/llvmorg-" version "/" component "-" (string-delete #\- 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 11:38:28 -05:00
|
|
|
|
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(define %llvm-release-monitoring-url
|
|
|
|
|
"https://github.com/llvm/llvm-project/releases")
|
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define* (clang-runtime-from-llvm llvm
|
|
|
|
|
#:optional
|
|
|
|
|
hash
|
|
|
|
|
(patches '()))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(package
|
|
|
|
|
(name "clang-runtime")
|
|
|
|
|
(version (package-version llvm))
|
|
|
|
|
(source
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(if hash
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "compiler-rt" version))
|
|
|
|
|
(sha256 (base32 hash))
|
|
|
|
|
(patches (map search-patch patches)))
|
|
|
|
|
(llvm-monorepo (package-version llvm))))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(native-inputs (package-native-inputs llvm))
|
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list llvm))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(arguments
|
|
|
|
|
`(;; Don't use '-g' during the build to save space.
|
2016-07-07 01:06:44 -04:00
|
|
|
|
#:build-type "Release"
|
2020-03-05 11:22:17 -05: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-24 19:39:14 -05:00
|
|
|
|
(home-page "https://compiler-rt.llvm.org")
|
2015-08-17 03:21:09 -04: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 18:54:06 -05:00
|
|
|
|
(license (package-license llvm))
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
|
|
|
|
|
(upstream-name . "compiler-rt")))
|
2015-11-04 03:28:46 -05:00
|
|
|
|
|
2017-12-24 19:39:14 -05:00
|
|
|
|
;; <https://compiler-rt.llvm.org/> doesn't list MIPS as supported.
|
2015-11-04 03:28:46 -05:00
|
|
|
|
(supported-systems (delete "mips64el-linux" %supported-systems))))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define* (clang-from-llvm llvm clang-runtime
|
|
|
|
|
#:optional hash
|
2021-12-16 10:50:36 -05:00
|
|
|
|
#:key (patches '()) tools-extra
|
|
|
|
|
(properties
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(append `((release-monitoring-url
|
|
|
|
|
. ,%llvm-release-monitoring-url))
|
|
|
|
|
(clang-properties (package-version llvm)))))
|
2020-05-28 05:46:59 -04:00
|
|
|
|
"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 16:19:35 -05:00
|
|
|
|
(package
|
|
|
|
|
(name "clang")
|
|
|
|
|
(version (package-version llvm))
|
|
|
|
|
(source
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(if hash
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri (if (version>=? version "9.0.1")
|
|
|
|
|
"clang"
|
|
|
|
|
"cfe")
|
|
|
|
|
version))
|
|
|
|
|
(sha256 (base32 hash))
|
|
|
|
|
(patches (map search-patch patches)))
|
|
|
|
|
(llvm-monorepo (package-version llvm))))
|
2014-12-07 16:19:35 -05: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)
|
|
|
|
|
(native-inputs (package-native-inputs llvm))
|
|
|
|
|
(inputs
|
|
|
|
|
`(("libxml2" ,libxml2)
|
2015-06-26 11:06:30 -04:00
|
|
|
|
("gcc-lib" ,gcc "lib")
|
2020-05-28 05:46:59 -04:00
|
|
|
|
,@(package-inputs llvm)
|
|
|
|
|
,@(if tools-extra
|
|
|
|
|
`(("clang-tools-extra" ,tools-extra))
|
|
|
|
|
'())))
|
2014-12-07 16:19:35 -05:00
|
|
|
|
(propagated-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list llvm clang-runtime))
|
2015-06-19 11:18:03 -04: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 11:21:53 -04:00
|
|
|
|
;; Don't use '-g' during the build to save space.
|
|
|
|
|
#:build-type "Release"
|
|
|
|
|
|
2015-06-19 11:18:03 -04:00
|
|
|
|
#:phases (modify-phases %standard-phases
|
2020-05-28 05:46:59 -04: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-"
|
2022-02-03 15:47:35 -05:00
|
|
|
|
(string-delete #\- (package-version llvm))
|
2020-05-28 05:46:59 -04:00
|
|
|
|
".src")
|
|
|
|
|
"tools/extra")
|
2022-02-08 13:32:29 -05:00
|
|
|
|
;; Build and link to shared libraries.
|
|
|
|
|
(substitute* "cmake/modules/AddClang.cmake"
|
|
|
|
|
(("BUILD_SHARED_LIBS") "True"))
|
2020-05-28 05:46:59 -04:00
|
|
|
|
#t))))
|
|
|
|
|
'())
|
2020-02-26 14:59:09 -05: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 15:06:01 -05: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 16:04:44 -04:00
|
|
|
|
(substitute* "lib/Driver/ToolChain.cpp"
|
|
|
|
|
(("getDriver\\(\\)\\.ResourceDir")
|
2020-02-26 15:06:01 -05:00
|
|
|
|
(string-append "\"" compiler-rt "\"")))
|
2018-03-31 16:04:44 -04:00
|
|
|
|
|
2020-02-26 15:06:01 -05: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 16:04:44 -04:00
|
|
|
|
|
2020-02-26 15:06:01 -05:00
|
|
|
|
;; Make clang look for libstdc++ in the right
|
|
|
|
|
;; location.
|
|
|
|
|
(("LibStdCXXIncludePathCandidates\\[\\] = \\{")
|
|
|
|
|
(string-append
|
|
|
|
|
"LibStdCXXIncludePathCandidates[] = { \"" gcc
|
|
|
|
|
"/include/c++\","))
|
2019-11-13 11:56:04 -05:00
|
|
|
|
|
2020-02-26 15:06:01 -05: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 16:04:44 -04:00
|
|
|
|
|
2020-02-26 15:06:01 -05: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 16:04:44 -04:00
|
|
|
|
|
2020-02-26 15:06:01 -05: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 15:23:24 -04: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 17:41:15 -04:00
|
|
|
|
,@(if (version>? version "3.8")
|
2022-01-07 12:53:42 -05:00
|
|
|
|
`((add-after 'install 'symlink-cfi_ignorelist
|
2020-07-29 17:41:15 -04:00
|
|
|
|
(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"))
|
2022-01-07 12:53:42 -05:00
|
|
|
|
(file-name ,(if (version>=? version "13")
|
|
|
|
|
"cfi_ignorelist.txt"
|
|
|
|
|
"cfi_blacklist.txt"))
|
2020-07-29 17:41:15 -04:00
|
|
|
|
;; The location varies between Clang versions.
|
2022-01-07 12:53:42 -05:00
|
|
|
|
(cfi-ignorelist
|
2020-07-29 17:41:15 -04:00
|
|
|
|
(cond
|
|
|
|
|
((file-exists?
|
2022-01-07 12:53:42 -05:00
|
|
|
|
(string-append compiler-rt "/" file-name))
|
|
|
|
|
(string-append compiler-rt "/" file-name))
|
2020-07-29 17:41:15 -04:00
|
|
|
|
(else (string-append compiler-rt
|
2022-01-07 12:53:42 -05:00
|
|
|
|
"/share/" file-name)))))
|
2020-07-29 17:41:15 -04:00
|
|
|
|
(mkdir-p lib-share)
|
2022-01-07 12:53:42 -05:00
|
|
|
|
;; Symlink the ignorelist to where Clang expects
|
2020-07-29 17:41:15 -04:00
|
|
|
|
;; to find it.
|
2022-01-07 12:53:42 -05:00
|
|
|
|
(symlink cfi-ignorelist
|
|
|
|
|
(string-append lib-share "/" file-name))))))
|
2020-07-29 17:41:15 -04:00
|
|
|
|
'())
|
2018-11-26 08:51:40 -05: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 07:41:50 -05: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 08:51:40 -05:00
|
|
|
|
;; Install bash completion.
|
2018-11-28 07:41:50 -05:00
|
|
|
|
(when (file-exists? "bash-autocomplete.sh")
|
|
|
|
|
(mkdir-p compl-dir)
|
|
|
|
|
(rename-file "bash-autocomplete.sh"
|
|
|
|
|
(string-append compl-dir "/clang")))))
|
2018-11-26 08:51:40 -05:00
|
|
|
|
#t)))))
|
2015-06-19 05:34:53 -04:00
|
|
|
|
|
|
|
|
|
;; Clang supports the same environment variables as GCC.
|
|
|
|
|
(native-search-paths
|
|
|
|
|
(list (search-path-specification
|
2020-03-15 11:04:53 -04:00
|
|
|
|
(variable "C_INCLUDE_PATH")
|
2015-06-19 05:34:53 -04:00
|
|
|
|
(files '("include")))
|
2020-03-15 11:04:53 -04:00
|
|
|
|
(search-path-specification
|
|
|
|
|
(variable "CPLUS_INCLUDE_PATH")
|
|
|
|
|
(files '("include/c++" "include")))
|
2015-06-19 05:34:53 -04:00
|
|
|
|
(search-path-specification
|
|
|
|
|
(variable "LIBRARY_PATH")
|
|
|
|
|
(files '("lib" "lib64")))))
|
|
|
|
|
|
2017-12-24 19:39:14 -05:00
|
|
|
|
(home-page "https://clang.llvm.org")
|
2014-12-07 16:19:35 -05: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.")
|
2021-12-16 10:50:36 -05:00
|
|
|
|
(properties properties)
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(license (if (version>=? version "9.0")
|
|
|
|
|
license:asl2.0 ;with LLVM exceptions
|
|
|
|
|
license:ncsa))))
|
2015-03-02 08:36:31 -05:00
|
|
|
|
|
2021-12-16 10:50:36 -05:00
|
|
|
|
(define (clang-properties version)
|
|
|
|
|
"Return package properties for Clang VERSION."
|
|
|
|
|
`((compiler-cpu-architectures
|
|
|
|
|
("x86_64"
|
|
|
|
|
;; This list was obtained by running:
|
|
|
|
|
;;
|
|
|
|
|
;; guix shell clang -- llc -march=x86-64 -mattr=help
|
|
|
|
|
;;
|
|
|
|
|
;; filtered from uninteresting entries such as "i686" and "pentium".
|
|
|
|
|
,@(if (version>=? version "10.0") ;TODO: refine
|
|
|
|
|
'("atom"
|
|
|
|
|
"barcelona"
|
|
|
|
|
"bdver1"
|
|
|
|
|
"bdver2"
|
|
|
|
|
"bdver3"
|
|
|
|
|
"bdver4"
|
|
|
|
|
"bonnell"
|
|
|
|
|
"broadwell"
|
|
|
|
|
"btver1"
|
|
|
|
|
"btver2"
|
|
|
|
|
"c3"
|
|
|
|
|
"c3-2"
|
|
|
|
|
"cannonlake"
|
|
|
|
|
"cascadelake"
|
|
|
|
|
"cooperlake"
|
|
|
|
|
"core-avx-i"
|
|
|
|
|
"core-avx2"
|
|
|
|
|
"core2"
|
|
|
|
|
"corei7"
|
|
|
|
|
"corei7-avx"
|
|
|
|
|
"generic"
|
|
|
|
|
"geode"
|
|
|
|
|
"goldmont"
|
|
|
|
|
"goldmont-plus"
|
|
|
|
|
"haswell"
|
|
|
|
|
"icelake-client"
|
|
|
|
|
"icelake-server"
|
|
|
|
|
"ivybridge"
|
|
|
|
|
"k8"
|
|
|
|
|
"k8-sse3"
|
|
|
|
|
"knl"
|
|
|
|
|
"knm"
|
|
|
|
|
"lakemont"
|
|
|
|
|
"nehalem"
|
|
|
|
|
"nocona"
|
|
|
|
|
"opteron"
|
|
|
|
|
"opteron-sse3"
|
|
|
|
|
"sandybridge"
|
|
|
|
|
"silvermont"
|
|
|
|
|
"skx"
|
|
|
|
|
"skylake"
|
|
|
|
|
"skylake-avx512"
|
|
|
|
|
"slm"
|
|
|
|
|
"tigerlake"
|
|
|
|
|
"tremont"
|
|
|
|
|
"westmere"
|
|
|
|
|
"x86-64"
|
|
|
|
|
"x86-64-v2"
|
|
|
|
|
"x86-64-v3"
|
|
|
|
|
"x86-64-v4"
|
|
|
|
|
"znver1"
|
|
|
|
|
"znver2"
|
|
|
|
|
"znver3")
|
|
|
|
|
'())))))
|
|
|
|
|
|
2019-11-14 07:25:00 -05: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 15:09:50 -04: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 07:25:00 -05: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 15:19:32 -04: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 07:25:00 -05:00
|
|
|
|
(search-paths (package-search-paths clang))
|
|
|
|
|
|
|
|
|
|
(license (package-license clang))
|
2021-12-16 10:50:36 -05:00
|
|
|
|
(properties (package-properties clang)) ;for 'compiler-cpu-architectures'
|
2019-11-14 07:25:00 -05:00
|
|
|
|
(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)
|
2021-11-15 05:28:26 -05:00
|
|
|
|
("libomp" ,libomp) ;used when linking with '-fopenmp'
|
2019-11-14 07:25:00 -05:00
|
|
|
|
("libc" ,glibc)
|
|
|
|
|
("libc-debug" ,glibc "debug")
|
|
|
|
|
("libc-static" ,glibc "static")))))
|
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define %llvm-monorepo-hashes
|
|
|
|
|
'(("14.0.0" . "1ixqzjzq4ad3mv1w44gwcg1shy34c2b3i9ja71vx1wa7l2ms2376")))
|
|
|
|
|
|
|
|
|
|
(define %llvm-patches
|
|
|
|
|
'(("14.0.0" . ("clang-14.0-libc-search-path.patch"))))
|
|
|
|
|
|
|
|
|
|
(define (llvm-monorepo version)
|
|
|
|
|
(origin
|
|
|
|
|
(method git-fetch)
|
|
|
|
|
(uri (git-reference
|
|
|
|
|
(url "https://github.com/llvm/llvm-project")
|
|
|
|
|
(commit (string-append "llvmorg-" version))))
|
|
|
|
|
(file-name (git-file-name "llvm-project" version))
|
|
|
|
|
(sha256 (base32 (assoc-ref %llvm-monorepo-hashes version)))
|
|
|
|
|
(patches (map search-patch (assoc-ref %llvm-patches version)))))
|
|
|
|
|
|
|
|
|
|
(define-public llvm-14
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(package
|
|
|
|
|
(name "llvm")
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(version "14.0.0")
|
|
|
|
|
(source (llvm-monorepo version))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(outputs '("out" "opt-viewer"))
|
|
|
|
|
(native-inputs
|
2020-12-19 08:38:22 -05:00
|
|
|
|
`(("python" ,python-wrapper)
|
2020-10-18 11:33:27 -04:00
|
|
|
|
("perl" ,perl)))
|
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list libffi))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(propagated-inputs
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(list zlib)) ;to use output from llvm-config
|
2021-12-27 07:13:36 -05:00
|
|
|
|
(arguments
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(list
|
|
|
|
|
#:configure-flags
|
|
|
|
|
#~(list
|
|
|
|
|
;; These options are required for cross-compiling LLVM according
|
|
|
|
|
;; to <https://llvm.org/docs/HowToCrossCompileLLVM.html>.
|
|
|
|
|
#$@(if (%current-target-system)
|
|
|
|
|
#~(,(string-append "-DLLVM_TABLEGEN="
|
|
|
|
|
#+(file-append this-package
|
|
|
|
|
"/bin/llvm-tblgen"))
|
|
|
|
|
#$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE="
|
|
|
|
|
(%current-target-system))
|
|
|
|
|
#$(string-append "-DLLVM_TARGET_ARCH="
|
|
|
|
|
(system->llvm-target))
|
|
|
|
|
#$(string-append "-DLLVM_TARGETS_TO_BUILD="
|
|
|
|
|
(system->llvm-target)))
|
|
|
|
|
'())
|
|
|
|
|
"-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-after 'unpack 'change-directory
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "llvm")))
|
|
|
|
|
(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)))))))
|
2021-12-27 07:13:36 -05:00
|
|
|
|
(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.")
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(license license:asl2.0)
|
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))))
|
2021-12-27 07:13:36 -05:00
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define-public clang-runtime-14
|
|
|
|
|
(let ((template (clang-runtime-from-llvm llvm-14)))
|
|
|
|
|
(package
|
|
|
|
|
(inherit template)
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments template)
|
|
|
|
|
((#:phases phases '(@ (guix build cmake-build-system) %standard-phases))
|
|
|
|
|
#~(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))))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-14
|
|
|
|
|
(let ((template (clang-from-llvm llvm-14 clang-runtime-14)))
|
|
|
|
|
(package
|
|
|
|
|
(inherit template)
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments template)
|
|
|
|
|
((#:phases phases '(@ (guix build cmake-build-system) %standard-phases))
|
|
|
|
|
#~(modify-phases #$phases
|
|
|
|
|
(add-after 'unpack 'change-directory
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "clang"))))))))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-toolchain-14
|
|
|
|
|
(make-clang-toolchain clang-14))
|
|
|
|
|
|
|
|
|
|
(define-public llvm-13
|
|
|
|
|
(package
|
|
|
|
|
(inherit llvm-14)
|
|
|
|
|
(version "13.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "llvm" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0d681xiixmx9inwvz14vi3xsznrcryk06a8rvk9cljiq5kc80szc"))))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments llvm-14)
|
|
|
|
|
((#:phases phases '%standard-phases)
|
|
|
|
|
#~(modify-phases #$phases
|
|
|
|
|
(delete 'change-directory)))))
|
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))))
|
|
|
|
|
|
2021-12-27 07:13:36 -05:00
|
|
|
|
(define-public clang-runtime-13
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-13
|
2022-02-03 12:08:26 -05:00
|
|
|
|
"1z2xr9nn4mgc3hn9ark2k5y4wznpk47xppkp63bcbagr6589acvv"))
|
2021-12-27 07:13:36 -05:00
|
|
|
|
|
|
|
|
|
(define-public clang-13
|
2022-01-07 12:53:42 -05:00
|
|
|
|
(clang-from-llvm llvm-13 clang-runtime-13
|
2022-02-03 12:08:26 -05:00
|
|
|
|
"1j8pr5kk8iqyb4jds3yl7c6x672617h4ngkpl4575j7mk4nrwykq"
|
2022-01-07 12:53:42 -05:00
|
|
|
|
#:patches '("clang-13.0-libc-search-path.patch")
|
|
|
|
|
#:tools-extra
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "clang-tools-extra"
|
|
|
|
|
(package-version llvm-13)))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2022-02-03 12:08:26 -05:00
|
|
|
|
"1l4jjdqfl9hrh0fwzv27hc263zc6x61h09vs4ni3yla8i1cwhayc")))))
|
2021-12-27 07:13:36 -05:00
|
|
|
|
|
|
|
|
|
(define-public clang-toolchain-13
|
|
|
|
|
(make-clang-toolchain clang-13))
|
|
|
|
|
|
|
|
|
|
(define-public llvm-12
|
|
|
|
|
(package
|
|
|
|
|
(inherit llvm-13)
|
|
|
|
|
(version "12.0.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "llvm" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"1pzx9zrmd7r3481sbhwvkms68fwhffpp4mmz45dgrkjpyl2q96kx"))))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(arguments
|
2021-09-23 17:08:25 -04:00
|
|
|
|
;; TODO(core-updates): Unconditionally use quasiquote
|
|
|
|
|
`(#:configure-flags
|
|
|
|
|
,#~(#$(if (%current-target-system)
|
|
|
|
|
#~quasiquote
|
|
|
|
|
#~quote)
|
|
|
|
|
;; These options are required for cross-compiling LLVM according to
|
|
|
|
|
;; https://llvm.org/docs/HowToCrossCompileLLVM.html.
|
|
|
|
|
(#$@(if (%current-target-system)
|
|
|
|
|
#~(,(string-append "-DLLVM_TABLEGEN="
|
|
|
|
|
#+(file-append this-package
|
|
|
|
|
"/bin/llvm-tblgen"))
|
|
|
|
|
#$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE="
|
|
|
|
|
(%current-target-system))
|
|
|
|
|
#$(string-append "-DLLVM_TARGET_ARCH="
|
|
|
|
|
(system->llvm-target))
|
|
|
|
|
#$(string-append "-DLLVM_TARGETS_TO_BUILD="
|
|
|
|
|
(system->llvm-target)))
|
|
|
|
|
#~())
|
|
|
|
|
"-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.
|
2020-10-18 11:33:27 -04:00
|
|
|
|
;; 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))
|
2021-12-27 07:13:36 -05:00
|
|
|
|
#t)))))))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
|
2021-04-24 07:04:55 -04:00
|
|
|
|
(define-public clang-runtime-12
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-12
|
2021-09-22 16:22:43 -04:00
|
|
|
|
"1950rg294izdwkaasi7yjrmadc9mzdd5paf0q63jjcq2m3rdbj5l"))
|
2021-04-24 07:04:55 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-12
|
|
|
|
|
(clang-from-llvm llvm-12 clang-runtime-12
|
2021-09-22 16:22:43 -04:00
|
|
|
|
"0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf"
|
2021-10-08 18:39:04 -04:00
|
|
|
|
#:patches '("clang-12.0-libc-search-path.patch")
|
2021-04-24 07:04:55 -04:00
|
|
|
|
#:tools-extra
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "clang-tools-extra"
|
|
|
|
|
(package-version llvm-12)))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-09-22 16:22:43 -04:00
|
|
|
|
"1r9a4fdz9ci58b5z2inwvm4z4cdp6scrivnaw05dggkxz7yrwrb5")))))
|
2021-04-24 07:04:55 -04:00
|
|
|
|
|
|
|
|
|
(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
|
2021-05-09 15:29:46 -04:00
|
|
|
|
"0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"))))))
|
2021-04-24 07:04:55 -04:00
|
|
|
|
|
2020-10-18 11:34:54 -04:00
|
|
|
|
(define-public clang-runtime-11
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-11
|
|
|
|
|
"0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip"))
|
|
|
|
|
|
|
|
|
|
(define-public clang-11
|
|
|
|
|
(clang-from-llvm llvm-11 clang-runtime-11
|
|
|
|
|
"02ajkij85966vd150iy246mv16dsaph1kfi0y8wnncp8w6nar5hg"
|
|
|
|
|
#: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
|
|
|
|
|
"02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy")))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-toolchain-11
|
|
|
|
|
(make-clang-toolchain clang-11))
|
|
|
|
|
|
|
|
|
|
(define-public llvm-10
|
|
|
|
|
(package
|
|
|
|
|
(inherit llvm-11)
|
2020-12-19 15:51:55 -05:00
|
|
|
|
(version "10.0.1")
|
2020-10-18 11:34:54 -04:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "llvm" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-12-19 15:51:55 -05:00
|
|
|
|
"1wydhbp9kyjp5y0rc627imxgkgqiv3dfirbqil9dgpnbaw5y7n65"))))))
|
2020-10-18 11:34:54 -04:00
|
|
|
|
|
2020-04-24 06:20:25 -04:00
|
|
|
|
(define-public clang-runtime-10
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-10
|
2020-09-15 19:39:38 -04:00
|
|
|
|
"1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"))
|
2020-04-24 06:20:25 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-10
|
|
|
|
|
(clang-from-llvm llvm-10 clang-runtime-10
|
2020-09-15 19:39:38 -04:00
|
|
|
|
"091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr"
|
2020-05-28 05:46:59 -04:00
|
|
|
|
#:patches '("clang-10.0-libc-search-path.patch")
|
|
|
|
|
#:tools-extra
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "clang-tools-extra"
|
2020-05-28 05:46:59 -04:00
|
|
|
|
(package-version llvm-10)))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-09-15 19:39:38 -04:00
|
|
|
|
"06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh")))))
|
2020-04-24 06:20:25 -04: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 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2020-04-24 06:20:25 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-06-07 17:25:40 -04:00
|
|
|
|
"16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880"))
|
|
|
|
|
(patches (search-patches
|
2020-11-14 01:10:29 -05:00
|
|
|
|
"llvm-9-fix-bitcast-miscompilation.patch"
|
|
|
|
|
"llvm-9-fix-scev-miscompilation.patch"
|
|
|
|
|
"llvm-9-fix-lpad-miscompilation.patch"))))))
|
2020-04-24 06:20:25 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-9
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(clang-runtime-from-llvm
|
2020-04-24 06:20:25 -04:00
|
|
|
|
llvm-9
|
2020-03-05 11:27:20 -05:00
|
|
|
|
"0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"
|
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
|
2020-04-24 06:20:25 -04:00
|
|
|
|
(define-public clang-9
|
|
|
|
|
(clang-from-llvm llvm-9 clang-runtime-9
|
2020-02-23 18:54:06 -05:00
|
|
|
|
"0ls2h3iv4finqyflyhry21qhc9cm9ga7g1zq21020p065qmm2y2p"
|
|
|
|
|
#:patches '("clang-9.0-libc-search-path.patch")))
|
2019-02-15 05:28:14 -05:00
|
|
|
|
|
2020-04-24 06:20:25 -04:00
|
|
|
|
(define-public clang-toolchain-9
|
|
|
|
|
(make-clang-toolchain clang-9))
|
2019-11-14 07:25:00 -05:00
|
|
|
|
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(define-public llvm-8
|
2019-11-19 12:15:42 -05:00
|
|
|
|
(package
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(inherit llvm-9)
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(version "8.0.0")
|
2019-11-19 12:15:42 -05:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-11-19 12:15:42 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-02-23 18:54:06 -05:00
|
|
|
|
"0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
|
|
|
|
|
(license license:ncsa)))
|
2019-11-19 12:15:42 -05:00
|
|
|
|
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(define-public clang-runtime-8
|
2019-11-19 12:15:42 -05:00
|
|
|
|
(clang-runtime-from-llvm
|
2020-02-23 18:54:06 -05:00
|
|
|
|
llvm-8
|
2020-03-05 11:27:20 -05:00
|
|
|
|
"1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"
|
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-11-19 12:15:42 -05:00
|
|
|
|
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(define-public clang-8
|
|
|
|
|
(clang-from-llvm llvm-8 clang-runtime-8
|
|
|
|
|
"0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
|
2021-10-08 16:41:30 -04:00
|
|
|
|
#:patches '("clang-8.0-libc-search-path.patch")))
|
2019-11-19 12:15:42 -05:00
|
|
|
|
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(define-public clang-toolchain-8
|
|
|
|
|
(make-clang-toolchain clang-8))
|
2019-11-19 12:15:42 -05:00
|
|
|
|
|
2019-06-28 14:53:20 -04:00
|
|
|
|
(define-public llvm-7
|
|
|
|
|
(package
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(inherit llvm-8)
|
2021-06-01 15:50:01 -04:00
|
|
|
|
(version "7.1.0")
|
2019-06-28 14:53:20 -04:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-06-28 14:53:20 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-06-01 15:50:01 -04:00
|
|
|
|
"0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v"))))))
|
2019-06-28 14:53:20 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-7
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-7
|
2021-06-01 15:50:01 -04:00
|
|
|
|
"1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"
|
2020-03-05 11:27:20 -05:00
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-06-28 14:53:20 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-7
|
2020-02-23 18:36:55 -05:00
|
|
|
|
(clang-from-llvm llvm-7 clang-runtime-7
|
2021-06-01 15:50:01 -04:00
|
|
|
|
"0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9"
|
2019-06-28 14:53:20 -04:00
|
|
|
|
#:patches '("clang-7.0-libc-search-path.patch")))
|
|
|
|
|
|
2019-11-14 07:25:00 -05:00
|
|
|
|
(define-public clang-toolchain-7
|
|
|
|
|
(make-clang-toolchain clang-7))
|
|
|
|
|
|
2019-02-15 05:28:14 -05:00
|
|
|
|
(define-public llvm-6
|
|
|
|
|
(package
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(inherit llvm-7)
|
2019-02-15 05:28:14 -05:00
|
|
|
|
(version "6.0.1")
|
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2019-02-15 05:28:14 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"))))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-6
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-6
|
2020-03-05 11:27:20 -05:00
|
|
|
|
"1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"
|
|
|
|
|
'("clang-runtime-9-libsanitizer-mode-field.patch")))
|
2019-02-15 05:28:14 -05:00
|
|
|
|
|
|
|
|
|
(define-public clang-6
|
2020-02-23 18:36:55 -05:00
|
|
|
|
(clang-from-llvm llvm-6 clang-runtime-6
|
2018-07-28 15:23:11 -04:00
|
|
|
|
"0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"
|
2018-03-31 16:04:44 -04:00
|
|
|
|
#:patches '("clang-6.0-libc-search-path.patch")))
|
2016-07-07 01:06:44 -04:00
|
|
|
|
|
2019-11-14 07:25:00 -05:00
|
|
|
|
(define-public clang-toolchain-6
|
|
|
|
|
(make-clang-toolchain clang-6))
|
|
|
|
|
|
2017-05-10 09:34:59 -04:00
|
|
|
|
(define-public llvm-3.9.1
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(package (inherit llvm-6)
|
2017-05-10 09:34:59 -04:00
|
|
|
|
(name "llvm")
|
|
|
|
|
(version "3.9.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2017-05-10 09:34:59 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-02-03 03:44:14 -05:00
|
|
|
|
"1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"))))
|
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments llvm)
|
|
|
|
|
((#:phases phases)
|
2022-04-10 12:38:58 -04:00
|
|
|
|
#~(modify-phases #$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"))))
|
|
|
|
|
(delete 'install-opt-viewer)))))))
|
2017-05-10 09:34:59 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.9.1
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-3.9.1
|
2018-01-17 18:09:11 -05:00
|
|
|
|
"16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk"
|
2020-03-05 11:27:20 -05:00
|
|
|
|
'("clang-runtime-3.9-libsanitizer-mode-field.patch"
|
|
|
|
|
"clang-runtime-asan-build-fixes.patch"
|
2018-10-15 14:45:08 -04:00
|
|
|
|
"clang-runtime-esan-build-fixes.patch"
|
2018-10-15 14:51:23 -04:00
|
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2017-05-10 09:34:59 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-3.9.1
|
|
|
|
|
(clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1
|
|
|
|
|
"0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76"
|
2018-03-31 16:04:44 -04:00
|
|
|
|
#:patches '("clang-3.8-libc-search-path.patch")))
|
|
|
|
|
|
|
|
|
|
(define-public llvm-3.8
|
2020-02-03 03:44:14 -05:00
|
|
|
|
(package (inherit llvm-3.9.1)
|
2018-03-31 16:04:44 -04:00
|
|
|
|
(name "llvm")
|
|
|
|
|
(version "3.8.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2018-03-31 16:04:44 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.8
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-3.8
|
|
|
|
|
"0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d"
|
2018-10-15 14:45:08 -04:00
|
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-03-05 11:27:20 -05:00
|
|
|
|
"clang-runtime-3.8-libsanitizer-mode-field.patch"
|
2018-10-15 14:51:23 -04:00
|
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2018-03-31 16:04:44 -04: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 09:34:59 -04:00
|
|
|
|
|
2016-07-07 01:06:44 -04:00
|
|
|
|
(define-public llvm-3.7
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(package (inherit llvm-3.8)
|
2016-07-07 01:06:44 -04:00
|
|
|
|
(version "3.7.1")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2016-07-07 01:06:44 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
|
|
|
|
|
|
|
|
|
|
(define-public clang-runtime-3.7
|
|
|
|
|
(clang-runtime-from-llvm
|
|
|
|
|
llvm-3.7
|
2018-01-17 18:09:11 -05:00
|
|
|
|
"10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
|
2018-10-15 14:45:08 -04:00
|
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-03-05 11:27:20 -05:00
|
|
|
|
"clang-runtime-3.8-libsanitizer-mode-field.patch"
|
2018-10-15 14:51:23 -04:00
|
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch")))
|
2016-07-07 01:06:44 -04:00
|
|
|
|
|
|
|
|
|
(define-public clang-3.7
|
|
|
|
|
(clang-from-llvm llvm-3.7 clang-runtime-3.7
|
2018-03-31 16:04:44 -04:00
|
|
|
|
"0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"
|
|
|
|
|
#:patches '("clang-3.5-libc-search-path.patch")))
|
2016-07-07 01:06:43 -04:00
|
|
|
|
|
|
|
|
|
(define-public llvm-3.6
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(package (inherit llvm-3.7)
|
2016-07-07 01:06:43 -04:00
|
|
|
|
(version "3.6.2")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2021-10-07 08:21:25 -04:00
|
|
|
|
(patches
|
|
|
|
|
(search-patches "llvm-3.6-fix-build-with-gcc-10.patch"))
|
2016-07-07 01:06:43 -04:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
|
|
|
|
|
|
2015-03-02 08:36:31 -05:00
|
|
|
|
(define-public llvm-3.5
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(package (inherit llvm-3.6)
|
2016-07-07 01:06:40 -04:00
|
|
|
|
(version "3.5.2")
|
2015-03-02 08:36:31 -05:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "llvm" version))
|
2017-05-04 08:18:38 -04:00
|
|
|
|
(patches
|
|
|
|
|
(search-patches "llvm-3.5-fix-clang-build-with-gcc5.patch"))
|
2015-03-02 08:36:31 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2016-07-07 01:06:40 -04:00
|
|
|
|
"0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4"))))))
|
2015-03-02 08:36:31 -05:00
|
|
|
|
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(define-public clang-runtime-3.5
|
2020-02-25 16:47:17 -05:00
|
|
|
|
(let ((runtime (clang-runtime-from-llvm
|
|
|
|
|
llvm-3.5
|
|
|
|
|
"1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal"
|
|
|
|
|
'("clang-runtime-asan-build-fixes.patch"
|
2020-08-11 11:47:50 -04:00
|
|
|
|
"clang-runtime-3.5-libsanitizer-mode-field.patch"
|
2020-02-25 16:47:17 -05:00
|
|
|
|
"clang-3.5-libsanitizer-ustat-fix.patch"))))
|
gnu: Use PACKAGE/INHERIT in more places.
* gnu/packages/algebra.scm (fftwf, fftw-openmpi),
gnu/packages/audio.scm (ztoolkit-rsvg),
gnu/packages/bioinformatics.scm (python2-dendropy),
gnu/packages/boost.scm (boost-with-python2),
gnu/packages/check.scm (python2-mock, python2-pytest-mock),
gnu/packages/cups.scm (hplip-minimal),
gnu/packages/freedesktop.scm (libinput-minimal),
gnu/packages/gettext.scm (gnu-gettext),
gnu/packages/glib.scm (python2-pygobject),
gnu/packages/gnome.scm (gdl-minimal, libsoup-minimal, python2-pyatspi),
gnu/packages/groff.scm (groff-minimal),
gnu/packages/jami.scm (ffmpeg-jami),
gnu/packages/libcanberra.scm (libcanberra/gtk+-2),
gnu/packages/lirc.scm (python2-lirc),
gnu/packages/llvm.scm (clang-runtime-3.5),
gnu/packages/mpi.scm (java-openmpi, openmpi-thread-multiple),
gnu/packages/node.scm (libnode),
gnu/packages/onc-rpc.scm (libtirpc/hurd),
gnu/packages/python-compression.scm (bitshuffle-for-snappy),
gnu/packages/python-crypto.scm (python2-pycrypto, python2-cryptography)
(python2-cryptography, python2-m2crypto),
gnu/packages/python-web.scm (python2-html2text, python2-tornado)
(python2-terminado, python2-ndg-httpsclient, python2-websocket-client)
(python2-rauth, python2-url, python2-s3transfer),
gnu/packages/python-xyz.scm (python2-psutil, python2-serpent)
(python2-humanfriendly, python2-empy, python2-parse-type, python2-polib)
(python2-jsonschema, python2-pystache, python2-cython, python2-numpydoc)
(python2-ipyparallel, python2-traitlets, python2-dbus)
(python2-beautifulsoup4, python2-pep517, python2-flake8, python2-llfuse)
(python2-tlsh, python-file, python2-notebook, python-jupyter-console-minimal)
(python2-contextlib2, python2-promise, python2-anyjson, python2-amqp)
(python2-kombu, python2-billiard, python2-celery, python2-whoosh)
(python2-jellyfish, python-rope, ptpython-2, python2-binaryornot)
(python2-setproctitle, python2-argcomplete, python2-xopen, python2-isort)
(python2-radon, python2-rfc6555, python2-activepapers, python2-send2trash)
(python2-cloudpickle, python2-reparser),
gnu/packages/python.scm (python2-called-python),
gnu/packages/qt.scm (python2-sip, python-pyqt-without-qtwebkit, python2-pyqt)
(python-qscintilla, python-pyqt+qscintilla),
gnu/packages/scanner.scm (sane-backends),
gnu/packages/sdl.scm (guile3.0-sdl2),
gnu/packages/selinux.scm (checkpolicy, libselinux, libsemanage, secilc)
(python-sepolgen, policycoreutils),
gnu/packages/serialization.scm (lua5.1-libmpack, lua5.2-libmpack),
gnu/packages/simulation.scm (fenics),
gnu/packages/statistics.scm (python2-statsmodels),
gnu/packages/texinfo.scm (info-reader),
gnu/packages/wxwidgets.scm (wxwidgets-gtk2, wxwidgets-gtk2-3.1),
gnu/packages/xml.scm (xmlsec-nss),
gnu/packages/xorg.scm (uim-gtk, uim-qt),
guix/build-system/python.scm (package-with-explicit-python)
(strip-python2-variant): Use PACKAGE/INHERIT.
2021-03-17 03:42:12 -04:00
|
|
|
|
(package/inherit runtime
|
2020-02-25 16:47:17 -05:00
|
|
|
|
(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"
|
2021-07-16 10:01:49 -04:00
|
|
|
|
(string-append
|
|
|
|
|
(search-input-directory inputs "/include/tirpc")
|
|
|
|
|
":" (or (getenv "CPATH") "")))
|
2020-02-25 16:47:17 -05:00
|
|
|
|
(setenv "CPLUS_INCLUDE_PATH"
|
2021-07-16 10:01:49 -04:00
|
|
|
|
(string-append
|
|
|
|
|
(search-input-directory inputs "/include/tirpc")
|
|
|
|
|
":" (or (getenv "CPLUS_INCLUDE_PATH") "")))))))))
|
2020-02-25 16:47:17 -05:00
|
|
|
|
(inputs
|
|
|
|
|
`(("libtirpc" ,libtirpc)
|
|
|
|
|
("llvm" ,llvm-3.5))))))
|
2015-08-17 03:21:09 -04:00
|
|
|
|
|
2015-03-02 08:36:31 -05:00
|
|
|
|
(define-public clang-3.5
|
2015-08-17 03:21:09 -04:00
|
|
|
|
(clang-from-llvm llvm-3.5 clang-runtime-3.5
|
2018-03-31 16:04:44 -04:00
|
|
|
|
"0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg"
|
|
|
|
|
#:patches '("clang-3.5-libc-search-path.patch")))
|
2016-09-14 05:25:29 -04:00
|
|
|
|
|
2020-10-18 11:33:27 -04:00
|
|
|
|
;; Default LLVM and Clang version.
|
2022-01-30 12:29:57 -05:00
|
|
|
|
(define-public llvm llvm-13)
|
|
|
|
|
(define-public clang-runtime clang-runtime-13)
|
|
|
|
|
(define-public clang clang-13)
|
|
|
|
|
(define-public clang-toolchain clang-toolchain-13)
|
2020-10-18 11:33:27 -04:00
|
|
|
|
|
2021-09-09 05:58:47 -04:00
|
|
|
|
(define-public llvm-for-rocm
|
|
|
|
|
(package
|
|
|
|
|
;; Actually based on LLVM 13 as of v4.3, but llvm-12 works just fine.
|
|
|
|
|
(inherit llvm-12)
|
|
|
|
|
(name "llvm-for-rocm")
|
|
|
|
|
(version "4.3.0") ;this must match '%rocm-version'
|
|
|
|
|
(source (origin
|
|
|
|
|
(method git-fetch)
|
|
|
|
|
(uri (git-reference
|
|
|
|
|
(url "https://github.com/RadeonOpenCompute/llvm-project.git")
|
|
|
|
|
(commit (string-append "rocm-" version))))
|
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0p75nr1qpmy6crymdax5hm40wkimman4lnglz4x5cnbiqindya7s"))
|
|
|
|
|
(patches
|
|
|
|
|
(search-patches "llvm-roc-4.2.0-add_Object.patch"
|
|
|
|
|
"llvm-roc-3.0.0-add_libraries.patch"
|
|
|
|
|
"llvm-roc-4.0.0-remove-isystem-usr-include.patch"))))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments llvm-12)
|
|
|
|
|
((#:phases phases '%standard-phases)
|
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
(add-after 'unpack 'chdir
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "llvm")))))
|
|
|
|
|
((#:configure-flags flags)
|
|
|
|
|
''("-DLLVM_ENABLE_PROJECTS=llvm;clang;lld"
|
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86"
|
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=FALSE"
|
|
|
|
|
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
|
|
|
|
|
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
|
|
|
|
|
"-DLLVM_VERSION_SUFFIX="))))
|
|
|
|
|
(properties `((hidden? . #t)
|
|
|
|
|
,@(package-properties llvm-12)))))
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 16:24:25 -04:00
|
|
|
|
|
|
|
|
|
(define-public libunwind-headers
|
|
|
|
|
(package
|
|
|
|
|
(name "libunwind-headers")
|
2022-01-07 12:11:16 -05:00
|
|
|
|
(version "13.0.0")
|
2021-09-22 16:24:25 -04:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "libunwind" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2022-01-07 12:11:16 -05:00
|
|
|
|
"1qb5ickp7qims5q7sxacj3fwq1kklvnl94k3v9hpl5qn284iky1n"))))
|
2021-09-22 16:24:25 -04:00
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
'(#:phases (modify-phases (map (lambda (phase)
|
|
|
|
|
(assq phase %standard-phases))
|
|
|
|
|
'(set-paths unpack))
|
|
|
|
|
(add-after 'unpack 'install
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(mkdir out)
|
|
|
|
|
(copy-recursively "include"
|
|
|
|
|
(string-append out "/include"))))))))
|
|
|
|
|
(home-page "https://clang.llvm.org/docs/Toolchain.html")
|
|
|
|
|
(synopsis "LLVM libunwind header files")
|
|
|
|
|
(description
|
|
|
|
|
"This package contains header files for the LLVM C++ unwinding library.")
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
|
2021-09-22 16:24:25 -04:00
|
|
|
|
(license license:asl2.0))) ;with LLVM exceptions
|
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define-public lld-14
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(package
|
|
|
|
|
(name "lld")
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(version "14.0.0")
|
|
|
|
|
(source (llvm-monorepo version))
|
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(inputs
|
|
|
|
|
(list llvm-14))
|
|
|
|
|
(arguments
|
|
|
|
|
'(#:build-type "Release"
|
|
|
|
|
;; TODO: Tests require the lit tool, which isn't installed by the LLVM
|
|
|
|
|
;; package.
|
|
|
|
|
#:tests? #f
|
|
|
|
|
#:phases (modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'change-directory
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "lld"))))))
|
|
|
|
|
(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
|
|
|
|
|
|
|
|
|
|
(define-public lld-13
|
|
|
|
|
(package
|
|
|
|
|
(inherit lld-14)
|
2022-02-03 12:08:26 -05:00
|
|
|
|
(version "13.0.1")
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "lld" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2022-02-03 12:08:26 -05:00
|
|
|
|
"1yscckcszfr234k4svhybdbsnz6w65x8pldl6c2nhyxzx12zfsk6"))))
|
2021-09-22 16:24:53 -04:00
|
|
|
|
(native-inputs
|
|
|
|
|
;; Note: check <https://bugs.llvm.org/show_bug.cgi?id=49228> to see
|
|
|
|
|
;; whether this is still necessary.
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list libunwind-headers))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(inputs
|
2022-01-07 12:11:40 -05:00
|
|
|
|
(list llvm-13))
|
2020-10-18 11:33:27 -04:00
|
|
|
|
(arguments
|
2022-04-05 07:27:09 -04:00
|
|
|
|
'(#:build-type "Release"
|
2020-10-18 11:33:27 -04:00
|
|
|
|
;; TODO: Tests require the lit tool, which isn't installed by the LLVM
|
|
|
|
|
;; package.
|
|
|
|
|
#:tests? #f))
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))))
|
2018-08-29 11:04:13 -04:00
|
|
|
|
|
2022-01-09 06:26:50 -05:00
|
|
|
|
(define-public lld-12
|
|
|
|
|
(package
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(inherit lld-13)
|
2022-01-09 06:26:50 -05:00
|
|
|
|
(version "12.0.1")
|
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "lld" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0qg3fgc7wj34hdkqn21y03zcmsdd01szhhm1hfki63iifrm3y2v9"))))
|
|
|
|
|
(inputs (modify-inputs (package-inputs lld)
|
|
|
|
|
(replace "llvm" llvm-12)))))
|
|
|
|
|
|
2022-04-05 07:27:09 -04:00
|
|
|
|
(define-public lld lld-14)
|
|
|
|
|
|
2021-10-17 22:41:01 -04:00
|
|
|
|
(define* (make-lld-wrapper lld #:key lld-as-ld?)
|
|
|
|
|
"Return a LLD wrapper. When LLD-AS-LD? is true, create a 'ld' symlink that
|
|
|
|
|
points to 'lld'."
|
|
|
|
|
(package
|
|
|
|
|
(name (if lld-as-ld? "lld-as-ld-wrapper" "lld-wrapper"))
|
|
|
|
|
(version "0")
|
|
|
|
|
(source #f)
|
|
|
|
|
(build-system trivial-build-system)
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(inputs (list (make-ld-wrapper "ld.lld-wrapper" #:binutils lld
|
|
|
|
|
#:linker "ld.lld")
|
|
|
|
|
(make-ld-wrapper "lld-wrapper" #:binutils lld #:linker
|
|
|
|
|
"lld")))
|
2021-10-17 22:41:01 -04:00
|
|
|
|
(arguments
|
|
|
|
|
(list #:builder
|
|
|
|
|
#~(let ((ld.lld (string-append #$(this-package-input
|
|
|
|
|
"ld.lld-wrapper")
|
|
|
|
|
"/bin/ld.lld"))
|
|
|
|
|
(lld (string-append #$(this-package-input "lld-wrapper")
|
|
|
|
|
"/bin/lld")))
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
(mkdir (string-append #$output "/bin"))
|
|
|
|
|
(symlink ld.lld (string-append #$output "/bin/ld.lld"))
|
|
|
|
|
(symlink lld (string-append #$output "/bin/lld"))
|
|
|
|
|
(when #$lld-as-ld?
|
|
|
|
|
(symlink ld.lld (string-append #$output "/bin/ld"))))))
|
|
|
|
|
(synopsis "LLD linker wrapper")
|
|
|
|
|
(description "This is a linker wrapper for LLD; like @code{ld-wrapper}, it
|
|
|
|
|
wraps the linker to add any missing @code{-rpath} flags, and to detect any
|
|
|
|
|
misuse of libraries outside of the store.")
|
|
|
|
|
(home-page "https://www.gnu.org/software/guix/")
|
|
|
|
|
(license license:gpl3+)))
|
|
|
|
|
|
|
|
|
|
;;; A LLD wrapper suitable to use with -fuse-ld and GCC or with Clang.
|
|
|
|
|
(define-public lld-wrapper
|
|
|
|
|
(make-lld-wrapper lld))
|
|
|
|
|
|
|
|
|
|
;;; A LLD wrapper that can be used as a (near) drop-in replacement to GNU ld.
|
|
|
|
|
(define-public lld-as-ld-wrapper
|
|
|
|
|
(make-lld-wrapper lld #:lld-as-ld? #t))
|
|
|
|
|
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(define-public lldb
|
|
|
|
|
(package
|
|
|
|
|
(name "lldb")
|
2022-02-04 15:52:37 -05:00
|
|
|
|
(version "13.0.1")
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (llvm-uri "lldb" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2022-02-04 15:52:37 -05:00
|
|
|
|
"05nvcbgb4rx860r3jzsbpvcbzpd0i7nsm5qrpkyfhg5vrh5mj32a"))))
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:configure-flags '("-DCMAKE_CXX_COMPILER=clang++")))
|
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list pkg-config swig))
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(inputs
|
2022-02-04 15:52:37 -05:00
|
|
|
|
(list clang-13
|
|
|
|
|
llvm-13
|
2022-01-07 12:12:17 -05:00
|
|
|
|
;; Optional (but recommended) inputs.
|
|
|
|
|
ncurses
|
|
|
|
|
libedit
|
|
|
|
|
xz
|
|
|
|
|
libxml2
|
|
|
|
|
lua
|
|
|
|
|
python))
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(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.")
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
|
2020-10-21 15:31:36 -04:00
|
|
|
|
(license license:asl2.0))) ;with LLVM exceptions
|
|
|
|
|
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(define-public libcxx
|
|
|
|
|
(package
|
|
|
|
|
(name "libcxx")
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(version "9.0.1")
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "libcxx" version))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-02-23 18:54:06 -05:00
|
|
|
|
"0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(build-system cmake-build-system)
|
2020-03-15 11:08:06 -04: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 17:45:32 -05:00
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang llvm))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(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.")
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(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 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "libcxx" version))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
|
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang-6 llvm-6))))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
|
2021-04-21 05:04:25 -04:00
|
|
|
|
(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
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang-6 llvm-6 libcxx-6))
|
2021-04-21 05:04:25 -04:00
|
|
|
|
(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)))
|
|
|
|
|
|
2021-04-21 05:04:39 -04:00
|
|
|
|
(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
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang-6 llvm-6 libcxxabi-6))))
|
2021-04-21 05:04:39 -04:00
|
|
|
|
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(define-public libclc
|
|
|
|
|
(package
|
|
|
|
|
(name "libclc")
|
2020-02-23 18:54:06 -05:00
|
|
|
|
(version "9.0.1")
|
2020-02-23 17:45:32 -05: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 16:53:28 -04:00
|
|
|
|
(url "https://github.com/llvm/llvm-project")
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(commit (string-append "llvmorg-" version))))
|
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-02-23 18:54:06 -05:00
|
|
|
|
"1d1qayvrvvc1di7s7jfxnjvxq2az4lwq1sw1b2gq2ic0nksvajz0"))))
|
2020-02-23 17:45:32 -05: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
|
2022-01-30 12:29:57 -05:00
|
|
|
|
(list clang-9 llvm-9 python))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(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")
|
2022-02-03 12:08:26 -05:00
|
|
|
|
(version "13.0.1")
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
2020-10-07 09:37:43 -04:00
|
|
|
|
(uri (llvm-uri "openmp" version))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2022-02-03 12:08:26 -05:00
|
|
|
|
"0kvbr4j6ldpssiv7chgqra5y77n7jwbyxlwcl7z32v31f49jcybb"))
|
2020-02-23 17:45:32 -05: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"
|
2022-02-01 12:43:12 -05:00
|
|
|
|
"-DOPENMP_TEST_CXX_COMPILER=clang++"
|
|
|
|
|
|
|
|
|
|
;; Work around faulty target detection, fixed in 14:
|
|
|
|
|
;; https://github.com/llvm/llvm-project/issues/52910
|
|
|
|
|
"-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF")
|
2020-02-23 17:45:32 -05:00
|
|
|
|
#:test-target "check-libomp"))
|
|
|
|
|
(native-inputs
|
2022-02-01 12:43:12 -05:00
|
|
|
|
(list clang llvm perl pkg-config python))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list `(,hwloc "lib")))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(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.")
|
2022-02-01 12:42:52 -05:00
|
|
|
|
(properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
|
|
|
|
|
(upstream-name . "openmp")))
|
2020-02-23 17:45:32 -05:00
|
|
|
|
(license license:expat)))
|
|
|
|
|
|
2018-08-29 11:04:13 -04:00
|
|
|
|
(define-public python-llvmlite
|
|
|
|
|
(package
|
|
|
|
|
(name "python-llvmlite")
|
2021-11-19 17:06:26 -05:00
|
|
|
|
(version "0.37.0")
|
2018-08-29 11:04:13 -04:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (pypi-uri "llvmlite" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-11-19 17:06:26 -05:00
|
|
|
|
"05avhsvdcqh8wfpblx16qslfq3masqcbkfyn8p3c13h1rmqbi4k3"))))
|
2018-08-29 11:04:13 -04:00
|
|
|
|
(build-system python-build-system)
|
2019-12-23 18:29:13 -05:00
|
|
|
|
(arguments
|
2020-11-13 22:05:26 -05: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\\(\\)")
|
2021-11-19 17:04:12 -05:00
|
|
|
|
(format #f "_lib_name = ~s" libllvmlite.so))))))
|
2020-11-13 22:05:26 -05:00
|
|
|
|
(add-after 'unpack 'skip-failing-tests
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "llvmlite/tests/test_binding.py"
|
|
|
|
|
((" def test_libm\\(self\\).*" all)
|
2021-11-19 17:04:12 -05:00
|
|
|
|
(string-append " @unittest.skip('Fails on Guix')\n" all)))))
|
2020-11-13 22:05:26 -05:00
|
|
|
|
(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="
|
2021-11-19 17:04:12 -05:00
|
|
|
|
llvm "/lib"))))))))
|
2018-08-29 11:04:13 -04:00
|
|
|
|
(inputs
|
2021-12-31 07:44:46 -05:00
|
|
|
|
(list
|
|
|
|
|
(let* ((patches-commit
|
|
|
|
|
"a4a19e8af2c5ef9b9901f20193e4be070726da97")
|
|
|
|
|
(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
|
|
|
|
|
(list (patch-origin
|
|
|
|
|
"partial-testing.patch"
|
|
|
|
|
"0g3nkci87knvmn7piqhmh4bcc65ff8r921cvfcibyiv65klv3syg")
|
|
|
|
|
(patch-origin
|
|
|
|
|
"0001-Revert-Limit-size-of-non-GlobalValue-name.patch"
|
|
|
|
|
"0n4k7za0smx6qwdipsh6x5lm7bfvzzb3p9r8q1zq1dqi4na21295"))))
|
|
|
|
|
(package
|
|
|
|
|
(inherit llvm-11)
|
|
|
|
|
(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
|
2022-01-07 12:20:26 -05:00
|
|
|
|
,@(origin-patches (package-source llvm-11)))))))))))
|
2020-11-13 22:05:26 -05:00
|
|
|
|
(home-page "https://llvmlite.pydata.org")
|
2018-08-29 11:04:13 -04: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 16:27:41 -05:00
|
|
|
|
|
2021-08-04 10:44:56 -04:00
|
|
|
|
(define-public (clang-python-bindings clang)
|
|
|
|
|
"Return a package for the Python bindings of CLANG."
|
|
|
|
|
(package
|
|
|
|
|
(inherit clang)
|
|
|
|
|
(name "python-clang")
|
|
|
|
|
(build-system python-build-system)
|
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(arguments
|
|
|
|
|
'(#:phases (modify-phases %standard-phases
|
|
|
|
|
(add-before 'build 'change-directory
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "bindings/python")))
|
|
|
|
|
(add-before 'build 'create-setup-py
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Generate a basic "setup.py", enough so it can be
|
|
|
|
|
;; built and installed.
|
|
|
|
|
(with-output-to-file "setup.py"
|
|
|
|
|
(lambda ()
|
|
|
|
|
(display "from setuptools import setup
|
|
|
|
|
setup(name=\"clang\", packages=[\"clang\"])\n")))))
|
|
|
|
|
(add-before 'build 'set-libclang-file-name
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
|
;; Record the absolute file name of libclang.so.
|
2022-01-08 05:29:37 -05:00
|
|
|
|
(let ((libclang (search-input-file inputs
|
|
|
|
|
"/lib/libclang.so")))
|
2021-08-04 10:44:56 -04:00
|
|
|
|
(substitute* "clang/cindex.py"
|
2022-01-08 05:29:37 -05:00
|
|
|
|
(("libclang\\.so") libclang))))))))
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(inputs (list clang))
|
2021-08-04 10:44:56 -04:00
|
|
|
|
(synopsis "Python bindings to libclang")))
|
|
|
|
|
|
|
|
|
|
(define-public python-clang-10
|
|
|
|
|
(clang-python-bindings clang-10))
|
|
|
|
|
|
|
|
|
|
(define-public python-clang-11
|
|
|
|
|
(clang-python-bindings clang-11))
|
|
|
|
|
|
|
|
|
|
(define-public python-clang-12
|
|
|
|
|
(clang-python-bindings clang-12))
|
|
|
|
|
|
2022-01-08 05:30:29 -05:00
|
|
|
|
(define-public python-clang-13
|
|
|
|
|
(clang-python-bindings clang-13))
|
|
|
|
|
|
2018-11-12 16:27:41 -05:00
|
|
|
|
(define-public emacs-clang-format
|
|
|
|
|
(package
|
|
|
|
|
(inherit clang)
|
|
|
|
|
(name "emacs-clang-format")
|
|
|
|
|
(build-system emacs-build-system)
|
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang))
|
2018-11-12 16:27:41 -05:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'configure
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
2022-01-08 05:31:58 -05:00
|
|
|
|
(let ((clang-format (search-input-file inputs "/bin/clang-format")))
|
2018-11-12 16:27:41 -05:00
|
|
|
|
(copy-file "tools/clang-format/clang-format.el" "clang-format.el")
|
|
|
|
|
(emacs-substitute-variables "clang-format.el"
|
|
|
|
|
("clang-format-executable"
|
2022-01-08 05:31:58 -05:00
|
|
|
|
clang-format))))))))
|
2018-11-12 16:27:41 -05:00
|
|
|
|
(synopsis "Format code using clang-format")
|
2020-04-12 16:29:47 -04:00
|
|
|
|
(description "This package filters code through @code{clang-format}
|
2018-11-12 16:27:41 -05: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 05:16:31 -05:00
|
|
|
|
@url{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}.")))
|
2018-11-26 06:42:39 -05:00
|
|
|
|
|
|
|
|
|
(define-public emacs-clang-rename
|
|
|
|
|
(package
|
|
|
|
|
(inherit clang)
|
|
|
|
|
(name "emacs-clang-rename")
|
|
|
|
|
(build-system emacs-build-system)
|
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang))
|
2018-11-26 06:42:39 -05:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'configure
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
2022-01-08 05:33:18 -05:00
|
|
|
|
(let ((clang-rename (search-input-file inputs "/bin/clang-rename")))
|
2018-11-26 06:42:39 -05:00
|
|
|
|
(copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el")
|
|
|
|
|
(emacs-substitute-variables "clang-rename.el"
|
|
|
|
|
("clang-rename-binary"
|
2022-01-08 05:33:18 -05:00
|
|
|
|
clang-rename))))))))
|
2018-11-26 06:42:39 -05:00
|
|
|
|
(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 15:52:03 -05:00
|
|
|
|
|
2021-11-18 10:20:16 -05:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; LLVM variants.
|
|
|
|
|
;;;
|
|
|
|
|
|
2021-03-02 15:52:03 -05: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
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list llvm))
|
2021-03-02 15:52:03 -05:00
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list ocaml ocaml-findlib ocaml-ounit python))
|
2021-03-02 15:52:03 -05:00
|
|
|
|
(propagated-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list ocaml-integers ocaml-ctypes))
|
2021-03-02 15:52:03 -05:00
|
|
|
|
(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))
|
2021-11-18 10:20:16 -05:00
|
|
|
|
|
|
|
|
|
(define-public llvm-julia
|
|
|
|
|
(package
|
|
|
|
|
(inherit llvm-11)
|
|
|
|
|
(name "llvm-julia")
|
|
|
|
|
(properties `((hidden? . #t)
|
|
|
|
|
,@(package-properties llvm-11)))
|
|
|
|
|
(source (origin
|
|
|
|
|
(inherit (package-source llvm-11))
|
|
|
|
|
;; Those patches are inside the Julia source repo.
|
|
|
|
|
;; They are _not_ Julia specific (https://github.com/julialang/julia#llvm)
|
|
|
|
|
;; but they are required to build Julia.
|
|
|
|
|
;; Discussion: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919628
|
|
|
|
|
(patches
|
|
|
|
|
(map (match-lambda
|
|
|
|
|
((name hash)
|
|
|
|
|
(julia-patch name hash)))
|
|
|
|
|
(list
|
|
|
|
|
'("llvm-D27629-AArch64-large_model_6.0.1"
|
|
|
|
|
"1qrshmlqvnasdyc158vfn3hnbigqph3lsq7acb9w8lwkpnnm2j4z")
|
|
|
|
|
'("llvm8-D34078-vectorize-fdiv"
|
|
|
|
|
"19spqc3xsazn1xs9gpcgv9ldadfkv49rmc5khl7sf1dlmhgi4602")
|
|
|
|
|
'("llvm-7.0-D44650"
|
|
|
|
|
"1h55kkmkiisfj6sk956if2bcj9s0v6n5czn8dxb870vp5nccj3ir")
|
|
|
|
|
'("llvm7-symver-jlprefix"
|
|
|
|
|
"00ng32x6xhm9czczirn5r1q1mc1myad44fqhi061hwh1vb46dwgm")
|
|
|
|
|
'("llvm-6.0-DISABLE_ABI_CHECKS"
|
|
|
|
|
"014fawd1ba7yckalypfld22zgic87x9nx3cim42zrwygywd36pyg")
|
|
|
|
|
'("llvm9-D50010-VNCoercion-ni"
|
|
|
|
|
"1s1d3sjsiq4vxg7ncy5cz56zgy5vcq6ls3iqaiqkvr23wyryqmdx")
|
|
|
|
|
'("llvm7-revert-D44485"
|
|
|
|
|
"0f59kq3p3mpwsbmskypbi4zn01l6ig0x7v2rjp08k2r8z8m6fa8n")
|
|
|
|
|
'("llvm-11-D75072-SCEV-add-type"
|
|
|
|
|
"176xi1lnbnv2rcs05ywhyb7pd0xgmibayvwzksksg44wg2dh8mbx")
|
|
|
|
|
'("llvm-julia-tsan-custom-as"
|
|
|
|
|
"0awh40kf6lm4wn1nsjd1bmhfwq7rqj811szanp2xkpspykw9hg9s")
|
|
|
|
|
'("llvm-D80101"
|
|
|
|
|
"1gsdwmgmpbignvqyxcnlprj899259p3dvdznlncd84ss445qgq3j")
|
|
|
|
|
'("llvm-D84031"
|
|
|
|
|
"0nks9sbk7p0r5gyr0idrmm93a5fmdai8kihz9532dx4zhcvvqbjc")
|
|
|
|
|
'("llvm-10-D85553"
|
|
|
|
|
"1zjq7j9q2qp56hwkc8yc8f0z7kvam3j7hj8sb7qyd77r255ff78l")
|
|
|
|
|
'("llvm-10-unique_function_clang-sa"
|
|
|
|
|
"1jys9w2zqk3dasnxqh0qz5ij7rxi6mkgq9pqjsclmamr5169zyan")
|
|
|
|
|
;'("llvm-D88630-clang-cmake"
|
|
|
|
|
; "0rs6s71nqnjkny7i69gqazhqj5jqfdr0bkxs2v5a55sfx8fa1k54")
|
|
|
|
|
'("llvm-11-D85313-debuginfo-empty-arange"
|
|
|
|
|
"1f672d5385xpgb8yrim8d3b7wg2z1l81agnshm1q61kdvjixqx32")
|
|
|
|
|
'("llvm-11-D90722-rtdyld-absolute-relocs"
|
|
|
|
|
"0kmnai229yyxkmpk9lxd180mcnhk2i8d87k2sg89gc8as18w10r6")
|
|
|
|
|
'("llvm-invalid-addrspacecast-sink"
|
|
|
|
|
"1n1b7j4s80vj7x5377aj9vyphmxx1q6bm0chhkxp6zsy3mx3g2ry")
|
|
|
|
|
'("llvm-11-D92906-ppc-setjmp"
|
|
|
|
|
"0cmd4dsblp7a8m03j16dqxws0ijh55zf4jzzxmj341qxa1gamdp9")
|
|
|
|
|
'("llvm-11-PR48458-X86ISelDAGToDAG"
|
|
|
|
|
"0vwzvlhsdazhxg4gj8g2f00a4f8qc5cgac23w575xk3pgba1jh6y")
|
|
|
|
|
'("llvm-11-D93092-ppc-knownbits"
|
|
|
|
|
"1748bypsc7c9lbs3fnkv0kwvch6bn85kj98j4jdaz254ig0wa6xj")
|
|
|
|
|
'("llvm-11-D93154-globalisel-as"
|
|
|
|
|
"1k5wd4z3pa7zj0gyjkif7viqj906dhqlbb7dc95gig40nbxv6zpj")
|
|
|
|
|
'("llvm-11-ppc-half-ctr"
|
|
|
|
|
"0piywisfz6cmw3133kz7vzhiqflq2y7igakqxlym0gi8pqylv7w9")
|
|
|
|
|
'("llvm-11-ppc-sp-from-bp"
|
|
|
|
|
"1wmg3485cx5f9pbykyl3jibk1wwv4w1x30hl4jyfndzr2yh8azf9")
|
|
|
|
|
'("llvm-rGb498303066a6-gcc11-header-fix"
|
|
|
|
|
"0hkd4rwhvh8g2yh13g29wiwnjpv2yd1hdyiv1ryw8izl25bz9c67")
|
|
|
|
|
'("llvm-11-D94813-mergeicmps"
|
|
|
|
|
"0cmy0ywkgyrdcvr9bd6pd912lyd4gcsrib4z0v05dwgcdxhk7y29")
|
|
|
|
|
'("llvm-11-D94980-CTR-half"
|
|
|
|
|
"1yf8cxib3z8hz7zi9n6v2g2c6vpfr4slq9hpx8m8yq8f1jbyw3fw")
|
|
|
|
|
'("llvm-11-D94058-sext-atomic-ops"
|
|
|
|
|
"1x6p6k6q651z5jcqxx8vj17cxnv196mka7mwn7dpp6c23lwgfdpb")
|
|
|
|
|
'("llvm-11-D96283-dagcombine-half"
|
|
|
|
|
"0lv4iq2f8qrcz1xyxfic3bcr5p0aqam3a7c6pp6fnw3riixm096k"))))
|
|
|
|
|
(patch-flags '("-p1"))))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments llvm-11)
|
|
|
|
|
((#:phases phases)
|
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
(add-after 'unpack 'patch-round-two
|
|
|
|
|
;; We have to do the patching in two rounds because we can't
|
|
|
|
|
;; pass '-p1' and '-p2' in the source field.
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
|
(map (lambda (patchname)
|
|
|
|
|
(invoke "patch" patchname "-p2"))
|
|
|
|
|
(list "llvm-11-AArch64-FastIsel-bug"
|
|
|
|
|
"llvm-11-D97435-AArch64-movaddrreg"
|
|
|
|
|
"llvm-11-D97571-AArch64-loh"
|
|
|
|
|
"llvm-11-aarch64-addrspace"))))))
|
|
|
|
|
((#:build-type _) "Release")
|
|
|
|
|
((#:configure-flags flags)
|
|
|
|
|
`(list
|
|
|
|
|
;; Build a native compiler and the NVPTX backend (NVIDIA) since
|
|
|
|
|
;; Julia insists on it, nothing more. This reduces build times and
|
|
|
|
|
;; disk usage.
|
|
|
|
|
,(string-append "-DLLVM_TARGETS_TO_BUILD=" (system->llvm-target))
|
|
|
|
|
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=NVPTX"
|
|
|
|
|
|
|
|
|
|
"-DLLVM_INSTALL_UTILS=ON"
|
|
|
|
|
"-DLLVM_BUILD_TESTS=ON"
|
|
|
|
|
"-DLLVM_ENABLE_FFI=ON"
|
|
|
|
|
"-DLLVM_ENABLE_RTTI=ON"
|
|
|
|
|
;; "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
|
|
|
|
|
;; "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
|
|
|
|
;; "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
|
|
|
|
|
"-DLLVM_ENABLE_DUMP=ON"
|
|
|
|
|
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
|
|
|
|
"-DLLVM_VERSION_SUFFIX:STRING=jl"))))
|
|
|
|
|
(inputs
|
|
|
|
|
(append
|
|
|
|
|
(package-inputs llvm-11)
|
|
|
|
|
`(("llvm-11-AArch64-FastIsel-bug"
|
|
|
|
|
,(julia-patch "llvm-11-AArch64-FastIsel-bug"
|
|
|
|
|
"1m2vddj1mw4kbij8hbrx82piyy6bvr2x7wwdnlxfaqcm72ipzyh9"))
|
|
|
|
|
("llvm-11-D97435-AArch64-movaddrreg"
|
|
|
|
|
,(julia-patch "llvm-11-D97435-AArch64-movaddrreg"
|
|
|
|
|
"10jnavq9ljkj7j2gqj2zd1pwqpqb5zs3zp9h96pmz0djbmxwa86y"))
|
|
|
|
|
("llvm-11-D97571-AArch64-loh"
|
|
|
|
|
,(julia-patch "llvm-11-D97571-AArch64-loh"
|
|
|
|
|
"128zcbg1w1j7hngsf7z1a7alc6lig6l2rqgjp6i8nk3k3f842v6n"))
|
|
|
|
|
("llvm-11-aarch64-addrspace"
|
|
|
|
|
,(julia-patch "llvm-11-aarch64-addrspace"
|
|
|
|
|
"0ckbzgfirxrf2d5bpinpngp7gnilbjrk0cbdfyl3h6f5v6i6xj6m")))))))
|
2021-11-18 10:26:50 -05:00
|
|
|
|
|
|
|
|
|
(define %cling-version "0.9")
|
|
|
|
|
|
|
|
|
|
(define llvm-cling ;LLVM 9 with approximately 10 patches for cling
|
|
|
|
|
(let ((base llvm-9))
|
|
|
|
|
(package/inherit base
|
|
|
|
|
(name "llvm-cling")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(inherit (package-source base))
|
|
|
|
|
(method git-fetch)
|
|
|
|
|
(uri (git-reference
|
|
|
|
|
(url "http://root.cern/git/llvm.git")
|
|
|
|
|
(commit (string-append "cling-v" %cling-version))))
|
|
|
|
|
(file-name (git-file-name "llvm-cling" %cling-version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0y3iwv3c9152kybmdrwvadggjs163r25h7rmlxzr3hfpr463pnwf"))
|
|
|
|
|
(modules '((guix build utils)))
|
|
|
|
|
(snippet
|
|
|
|
|
;; The source is missing an include directive (see:
|
|
|
|
|
;; https://github.com/vgvassilev/cling/issues/219).
|
|
|
|
|
'(substitute* "utils/benchmark/src/benchmark_register.h"
|
|
|
|
|
(("^#include <vector>.*" all)
|
|
|
|
|
(string-append all "#include <limits>\n"))))))
|
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments base)
|
|
|
|
|
((#:configure-flags _ ''())
|
|
|
|
|
'(list "-DLLVM_PARALLEL_LINK_JOBS=1" ;cater to smaller build machines
|
|
|
|
|
;; Only enable compiler support for the host architecture to
|
|
|
|
|
;; save on build time.
|
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD=host;NVPTX"
|
|
|
|
|
"-DLLVM_INSTALL_UTILS=ON"
|
|
|
|
|
"-DLLVM_ENABLE_RTTI=ON"
|
|
|
|
|
"-DLLVM_ENABLE_FFI=ON"
|
|
|
|
|
"-DLLVM_BUILD_LLVM_DYLIB=ON"
|
|
|
|
|
"-DLLVM_LINK_LLVM_DYLIB=ON"))
|
|
|
|
|
((#:phases phases '%standard-phases)
|
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
(delete 'shared-lib-workaround)
|
|
|
|
|
(delete 'install-opt-viewer))))))))
|
|
|
|
|
|
|
|
|
|
(define clang-cling-runtime
|
|
|
|
|
(let ((base clang-runtime-9))
|
|
|
|
|
(package/inherit base
|
|
|
|
|
(name "clang-cling-runtime")
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments base)
|
|
|
|
|
((#:phases phases '%standard-phases)
|
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
(add-after 'install 'delete-static-libraries
|
|
|
|
|
;; This reduces the size from 22 MiB to 4 MiB.
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(for-each delete-file (find-files out "\\.a$")))))))))
|
|
|
|
|
(inputs (modify-inputs (package-inputs base)
|
|
|
|
|
(replace "llvm" llvm-cling))))))
|
|
|
|
|
|
|
|
|
|
(define clang-cling ;modified clang 9 with ~ 60 patches for cling
|
|
|
|
|
(let ((base clang-9))
|
|
|
|
|
(package/inherit base
|
|
|
|
|
(name "clang-cling")
|
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(inherit (package-source base))
|
|
|
|
|
(method git-fetch)
|
|
|
|
|
(uri (git-reference
|
|
|
|
|
(url "http://root.cern/git/clang.git")
|
|
|
|
|
(commit (string-append "cling-v" %cling-version))))
|
|
|
|
|
(file-name (git-file-name "clang-cling" %cling-version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"128mxkwghss6589wvm6amzv183aq88rdrnfxjiyjcji5hx84vpby"))))
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments base)
|
|
|
|
|
((#:phases phases '%standard-phases)
|
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
(add-after 'install 'delete-static-libraries
|
|
|
|
|
;; This reduces the size by half, from 220 MiB to 112 MiB.
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(for-each delete-file (find-files out "\\.a$")))))))))
|
|
|
|
|
(propagated-inputs
|
|
|
|
|
(modify-inputs (package-propagated-inputs base)
|
|
|
|
|
(replace "llvm" llvm-cling)
|
|
|
|
|
(replace "clang-runtime" clang-cling-runtime))))))
|
|
|
|
|
|
|
|
|
|
(define-public cling
|
|
|
|
|
;; The tagged v0.9 release doesn't build, so use the latest commit.
|
|
|
|
|
(let ((commit "d78d1a03fedfd2bf6d2b6ff295aca576d98940df")
|
|
|
|
|
(revision "1")
|
|
|
|
|
(version* "0.9"))
|
|
|
|
|
(package
|
|
|
|
|
(name "cling")
|
|
|
|
|
(version (git-version version* revision commit))
|
|
|
|
|
(source (origin
|
|
|
|
|
(method git-fetch)
|
|
|
|
|
(uri (git-reference
|
|
|
|
|
(url "http://root.cern/git/cling.git")
|
|
|
|
|
(commit commit)))
|
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0lsbxv21b4qw11xkw9iipdpca64jjwwqxm0qf5v2cgdlibf8m8n9"))
|
|
|
|
|
;; Patch submitted upstream here:
|
|
|
|
|
;; https://github.com/root-project/cling/pull/433.
|
|
|
|
|
(patches (search-patches "cling-use-shared-library.patch"))))
|
|
|
|
|
(build-system cmake-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:build-type "Release" ;keep the build as lean as possible
|
|
|
|
|
#:tests? #f ;FIXME: 78 tests fail (out of ~200)
|
|
|
|
|
#:test-target "check-cling"
|
|
|
|
|
#:configure-flags
|
|
|
|
|
(list (string-append "-DCLING_CXX_PATH="
|
|
|
|
|
(assoc-ref %build-inputs "gcc") "/bin/g++")
|
|
|
|
|
;; XXX: The AddLLVM.cmake module expects LLVM_EXTERNAL_LIT to
|
|
|
|
|
;; be a Python script, not a shell executable.
|
|
|
|
|
(string-append "-DLLVM_EXTERNAL_LIT="
|
|
|
|
|
(assoc-ref %build-inputs "python-lit")
|
|
|
|
|
"/bin/.lit-real"))
|
|
|
|
|
#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'set-version
|
|
|
|
|
(lambda _
|
|
|
|
|
(make-file-writable "VERSION")
|
|
|
|
|
(call-with-output-file "VERSION"
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(format port "~a~%" ,version)))))
|
|
|
|
|
(add-after 'unpack 'patch-paths
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
|
(substitute* "lib/Interpreter/CIFactory.cpp"
|
|
|
|
|
(("\bsed\b")
|
|
|
|
|
(which "sed"))
|
|
|
|
|
;; This ensures that the default C++ library used by Cling is
|
|
|
|
|
;; that of the compiler that was used to build it, rather
|
|
|
|
|
;; than that of whatever g++ happens to be on PATH.
|
|
|
|
|
(("ReadCompilerIncludePaths\\(CLING_CXX_RLTV")
|
|
|
|
|
(string-append "ReadCompilerIncludePaths(\""
|
|
|
|
|
(assoc-ref inputs "gcc") "/bin/g++\""))
|
|
|
|
|
;; Cling uses libclang's CompilerInvocation::GetResourcesPath
|
|
|
|
|
;; to resolve Clang's library prefix, but this fails on Guix
|
|
|
|
|
;; because it is relative to the output of cling rather than
|
|
|
|
|
;; clang (see:
|
|
|
|
|
;; https://github.com/root-project/cling/issues/434). Fully
|
|
|
|
|
;; shortcut the logic in this method to return the correct
|
|
|
|
|
;; static location.
|
|
|
|
|
(("static std::string getResourceDir.*" all)
|
|
|
|
|
(string-append all
|
|
|
|
|
" return std::string(\""
|
|
|
|
|
(assoc-ref inputs "clang-cling")
|
|
|
|
|
"/lib/clang/" ,(package-version clang-cling)
|
|
|
|
|
"\");")))
|
|
|
|
|
;; Check for the 'lit' command for the tests, not 'lit.py'
|
|
|
|
|
;; (see: https://github.com/root-project/cling/issues/432).
|
|
|
|
|
(substitute* "CMakeLists.txt"
|
|
|
|
|
(("lit.py")
|
|
|
|
|
"lit"))))
|
|
|
|
|
(add-after 'unpack 'adjust-lit.cfg
|
|
|
|
|
;; See: https://github.com/root-project/cling/issues/435.
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "test/lit.cfg"
|
|
|
|
|
(("config.llvm_tools_dir \\+ '")
|
|
|
|
|
"config.cling_obj_root + '/bin"))))
|
|
|
|
|
(add-after 'install 'delete-static-libraries
|
|
|
|
|
;; This reduces the size from 17 MiB to 5.4 MiB.
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(for-each delete-file (find-files out "\\.a$"))))))))
|
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list python python-lit))
|
2021-11-18 10:26:50 -05:00
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list clang-cling llvm-cling))
|
2021-11-18 10:26:50 -05:00
|
|
|
|
(home-page "https://root.cern/cling/")
|
|
|
|
|
(synopsis "Interactive C++ interpreter")
|
|
|
|
|
(description "Cling is an interactive C++17 standard compliant
|
|
|
|
|
interpreter, built on top of LLVM and Clang. Cling can be used as a
|
|
|
|
|
read-eval-print loop (REPL) to assist with rapid application development.
|
|
|
|
|
Here's how to print @samp{\"Hello World!\"} using @command{cling}:
|
|
|
|
|
|
|
|
|
|
@example
|
|
|
|
|
cling '#include <stdio.h>' 'printf(\"Hello World!\\n\");'
|
|
|
|
|
@end example")
|
|
|
|
|
(license license:lgpl2.1+)))) ;for the combined work
|