gnu: bitcoin-unlimited: Update to 1.9.2.0.
[jackhill/guix/guix.git] / gnu / packages / gcc.scm
CommitLineData
e9c0b944 1;;; GNU Guix --- Functional package management for GNU
2bb5b1d4 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
f888d5bb 3;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
fbeb92d7 4;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
ed2b1c4f 5;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
cac88b28 6;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
fc649d0a 7;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
ba81ca6a 8;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5d8a4354 9;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
76d2b9a2 10;;; Copyright © 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
0f7e6964 11;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
a4fe16ee 12;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
cac88b28 13;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
e9c0b944
LC
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages gcc)
c6d7e299 31 #:use-module ((guix licenses)
50c7a1e2 32 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
e9c0b944
LC
33 #:use-module (gnu packages)
34 #:use-module (gnu packages bootstrap)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages multiprecision)
c8ebc821 37 #:use-module (gnu packages texinfo)
c364a287 38 #:use-module (gnu packages dejagnu)
99828fa7 39 #:use-module (gnu packages documentation)
98b385d1
LC
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages graphviz)
3e778ad3 43 #:use-module (gnu packages elf)
38cf2ba0 44 #:use-module (gnu packages perl)
e9c0b944
LC
45 #:use-module (guix packages)
46 #:use-module (guix download)
ca16cb96 47 #:use-module (guix build-system gnu)
74574fd1 48 #:use-module (guix build-system trivial)
fdd6c726 49 #:use-module (guix utils)
e052c7e1 50 #:use-module (srfi srfi-1)
ca16cb96 51 #:use-module (ice-9 regex))
e9c0b944 52
832abc76
LC
53(define %gcc-infrastructure
54 ;; Base URL for GCC's infrastructure.
966a543b 55 "mirror://gcc/infrastructure/")
832abc76 56
76e639a0 57(define (gcc-configure-flags-for-triplet target)
ca16cb96
LC
58 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
59
60The purpose of this procedure is to translate extended GNU triplets---e.g.,
61where the OS part is overloaded to denote a specific ABI---into GCC
62`configure' options. We take extended GNU triplets that glibc recognizes."
63 (cond ((string-match "^mips64el.*gnuabin?64$" target)
64 ;; Triplets recognized by glibc as denoting the N64 ABI; see
65 ;; ports/sysdeps/mips/preconfigure.
66 '("--with-abi=64"))
3f00ff8b
MW
67
68 ((string-match "^arm.*-gnueabihf$" target)
69 '("--with-arch=armv7-a"
70 "--with-float=hard"
71 "--with-mode=thumb"
aa725117 72 "--with-fpu=neon"))
3f00ff8b 73
ec6ba5c1
LC
74 ((and (string-suffix? "-gnu" target)
75 (not (string-contains target "-linux")))
76 ;; Cross-compilation of libcilkrts in GCC 5.5.0 to GNU/Hurd fails
77 ;; with:
78 ;; libcilkrts/runtime/os-unix.c:388:2: error: #error "Unknown architecture"
79 ;; Cilk has been removed from GCC 8 anyway.
80 '("--disable-libcilkrts"))
81
ca16cb96 82 (else
3f00ff8b 83 ;; TODO: Add `arm.*-gnueabi', etc.
ca16cb96
LC
84 '())))
85
e9c0b944 86(define-public gcc-4.7
9063ef0f 87 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
de1d41f9
LC
88 (maybe-target-tools
89 (lambda ()
90 ;; Return the `_FOR_TARGET' variables that are needed when
91 ;; cross-compiling GCC.
92 (let ((target (%current-target-system)))
93 (if target
94 (map (lambda (var tool)
95 (string-append (string-append var "_FOR_TARGET")
96 "=" target "-" tool))
066ccc2c
LC
97 '("CC" "CXX" "LD" "AR" "NM" "OBJDUMP" "RANLIB" "STRIP")
98 '("gcc" "g++" "ld" "ar" "nm" "objdump" "ranlib" "strip"))
de1d41f9 99 '()))))
7e3c9f74
LC
100 (libdir
101 (let ((base '(or (assoc-ref outputs "lib")
102 (assoc-ref outputs "out"))))
103 (lambda ()
104 ;; Return the directory that contains lib/libgcc_s.so et al.
105 (if (%current-target-system)
106 `(string-append ,base "/" ,(%current-target-system))
107 base))))
de1d41f9
LC
108 (configure-flags
109 (lambda ()
110 ;; This is terrible. Since we have two levels of quasiquotation,
111 ;; we have to do this convoluted thing just so we can insert the
112 ;; contents of (maybe-target-tools).
113 (list 'quasiquote
114 (append
115 '("--enable-plugin"
116 "--enable-languages=c,c++"
117 "--disable-multilib"
98bd851e 118 "--with-system-zlib"
de1d41f9 119
06213498
LC
120 ;; No pre-compiled libstdc++ headers, to save space.
121 "--disable-libstdcxx-pch"
122
de1d41f9
LC
123 "--with-local-prefix=/no-gcc-local-prefix"
124
84e6756c
LC
125 ;; With a separate "lib" output, the build system
126 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
127 ;; it. (Don't use a versioned sub-directory, that's
128 ;; unnecessary.)
129 ,(string-append "--with-gxx-include-dir="
130 (assoc-ref %outputs "out")
131 "/include/c++")
132
de1d41f9
LC
133 ,(let ((libc (assoc-ref %build-inputs "libc")))
134 (if libc
135 (string-append "--with-native-system-header-dir=" libc
136 "/include")
137 "--without-headers")))
138
76e639a0
MW
139 ;; Pass the right options for the target triplet.
140 (let ((triplet
141 (or (%current-target-system)
142 (nix-system->gnu-triplet (%current-system)))))
143 (gcc-configure-flags-for-triplet triplet))
ca16cb96 144
de1d41f9 145 (maybe-target-tools))))))
d78010b8
RW
146 (hidden-package
147 (package
148 (name "gcc")
149 (version "4.7.4")
150 (source (origin
151 (method url-fetch)
152 (uri (string-append "mirror://gnu/gcc/gcc-"
153 version "/gcc-" version ".tar.bz2"))
154 (sha256
155 (base32
156 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
157 (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
158 "gcc-fix-texi2pod.patch"))))
159 (build-system gnu-build-system)
160
161 ;; Separate out the run-time support libraries because all the
162 ;; dynamic-linked objects depend on it.
163 (outputs '("out" ;commands, etc. (60+ MiB)
164 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
165 "debug")) ;debug symbols of run-time libraries
166
167 (inputs `(("gmp" ,gmp)
168 ("mpfr" ,mpfr)
169 ("mpc" ,mpc)
170 ("libelf" ,libelf)
171 ("zlib" ,zlib)))
172
173 ;; GCC < 5 is one of the few packages that doesn't ship .info files.
174 ;; Newer texinfos fail to build the manual, so we use an older one.
175 (native-inputs `(("perl" ,perl) ;for manpages
176 ("texinfo" ,texinfo-5)))
177
178 (arguments
179 `(#:out-of-source? #t
180 #:configure-flags ,(configure-flags)
181 #:make-flags
182 ;; None of the flags below are needed when doing a Canadian cross.
183 ;; TODO: Simplify this.
184 ,(if (%current-target-system)
185 (if stripped?
186 ''("CFLAGS=-g0 -O2")
187 ''())
188 `(let* ((libc (assoc-ref %build-inputs "libc"))
189 (libc-native (or (assoc-ref %build-inputs "libc-native")
190 libc)))
191 `(,@(if libc
192 (list (string-append "LDFLAGS_FOR_TARGET="
193 "-B" libc "/lib "
194 "-Wl,-dynamic-linker "
195 "-Wl," libc
196 ,(glibc-dynamic-linker)))
197 '())
198
199 ;; Native programs like 'genhooks' also need that right.
200 ,(string-append "LDFLAGS="
201 "-Wl,-rpath=" libc-native "/lib "
202 "-Wl,-dynamic-linker "
203 "-Wl," libc-native ,(glibc-dynamic-linker))
204 ,(string-append "BOOT_CFLAGS=-O2 "
205 ,(if stripped? "-g0" "-g")))))
206
207 #:tests? #f
208
209 #:phases
210 (modify-phases %standard-phases
211 (add-before 'configure 'pre-configure
212 (lambda* (#:key inputs outputs #:allow-other-keys)
213 (let ((libdir ,(libdir))
214 (libc (assoc-ref inputs "libc")))
215 (when libc
216 ;; The following is not performed for `--without-headers'
217 ;; cross-compiler builds.
218
219 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
220 ;; single line, to allow the next step to work properly.
221 (for-each
222 (lambda (x)
ba81ca6a
TGR
223 (substitute* (find-files "gcc/config"
224 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
d78010b8
RW
225 (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
226 line)))
227 '(1 2 3))
228
229 ;; Fix the dynamic linker's file name.
230 (substitute* (find-files "gcc/config"
231 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
232 (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
233 _ gnu-user suffix)
234 (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
235 gnu-user suffix
236 (string-append libc ,(glibc-dynamic-linker)))))
237
238 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
239 ;; `crt{begin,end}.o', which come with GCC.
240 (substitute* (find-files "gcc/config"
241 "^gnu-user.*\\.h$")
242 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
243 ;; Help libgcc_s.so be found (see also below.) Always use
244 ;; '-lgcc_s' so that libgcc_s.so is always found by those
245 ;; programs that use 'pthread_cancel' (glibc dlopens
246 ;; libgcc_s.so when pthread_cancel support is needed, but
247 ;; having it in the application's RUNPATH isn't enough; see
248 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
249 ;;
250 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
251 ;; later phase of %gcc-static. If you change the string
252 ;; below, make sure to update the relevant code in
253 ;; %gcc-static package as needed.
254 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
81197492 255\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
d78010b8
RW
256 libc libc libdir suffix))
257 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
258 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
e9c0b944 259#define STANDARD_STARTFILE_PREFIX_2 \"\"
06213498 260~a"
d78010b8
RW
261 libc line)))
262
263 ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
264 ;; GNU_USER_* defines. Do the above for this case.
265 (substitute*
266 "gcc/config/rs6000/sysv4.h"
267 (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
268 (format #f "#define LIB_LINUX_SPEC \
fc649d0a 269\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
d78010b8
RW
270 libc libc libdir suffix))
271 (("#define STARTFILE_LINUX_SPEC.*$" line)
272 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
fc649d0a
CSLL
273#define STANDARD_STARTFILE_PREFIX_2 \"\"
274~a"
d78010b8
RW
275 libc line))))
276
cac88b28
CM
277 ;; TODO: Make this unconditional in core-updates.
278 ,@(if (target-powerpc?)
279 `((when (file-exists? "gcc/config/rs6000")
280 ;; Force powerpc libdir to be /lib and not /lib64
281 (substitute* (find-files "gcc/config/rs6000")
282 (("/lib64") "/lib"))))
283 `())
284
d78010b8
RW
285 ;; Don't retain a dependency on the build-time sed.
286 (substitute* "fixincludes/fixincl.x"
287 (("static char const sed_cmd_z\\[\\] =.*;")
288 "static char const sed_cmd_z[] = \"sed\";"))
289
290 ;; Aarch64 support didn't land in GCC until the 4.8 series.
291 (when (file-exists? "gcc/config/aarch64")
292 ;; Force Aarch64 libdir to be /lib and not /lib64
293 (substitute* "gcc/config/aarch64/t-aarch64-linux"
294 (("lib64") "lib")))
295
296 (when (file-exists? "libbacktrace")
297 ;; GCC 4.8+ comes with libbacktrace. By default it builds
298 ;; with -Werror, which fails with a -Wcast-qual error in glibc
299 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
300 (substitute* "libbacktrace/configure"
301 (("WARN_FLAGS=(.*)-Werror" _ flags)
302 (string-append "WARN_FLAGS=" flags)))
303
304 (when (file-exists? "libsanitizer/libbacktrace")
305 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
306 (substitute* "libsanitizer/libbacktrace/Makefile.in"
307 (("-Werror")
308 ""))))
309
310 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
311 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
312 ;; and <http://bugs.gnu.org/20358>.
313 (substitute* "libstdc++-v3/src/Makefile.in"
314 (("^OPT_LDFLAGS = ")
315 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
316
317 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
318 ;; circularity between "out" and "lib". (Note:
319 ;; --with-python-dir is useless because it imposes $(prefix) as
320 ;; the parent directory.)
321 (substitute* "libstdc++-v3/python/Makefile.in"
322 (("pythondir = .*$")
323 (string-append "pythondir = " libdir "/share"
324 "/gcc-$(gcc_version)/python\n")))
325
326 ;; Avoid another circularity between the outputs: this #define
327 ;; ends up in auto-host.h in the "lib" output, referring to
328 ;; "out". (This variable is used to augment cpp's search path,
329 ;; but there's nothing useful to look for here.)
330 (substitute* "gcc/config.in"
331 (("PREFIX_INCLUDE_DIR")
332 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
333 #t)))
334
335 (add-after 'configure 'post-configure
336 (lambda _
337 ;; Don't store configure flags, to avoid retaining references to
338 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
339 (substitute* "Makefile"
340 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
341 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
342 #t)))))
343
344 (native-search-paths
345 ;; Use the language-specific variables rather than 'CPATH' because they
346 ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
347 ;; The intent is to allow headers that are in the search path to be
348 ;; treated as "system headers" (headers exempt from warnings) just like
349 ;; the typical /usr/include headers on an FHS system.
350 (list (search-path-specification
351 (variable "C_INCLUDE_PATH")
352 (files '("include")))
353 (search-path-specification
354 (variable "CPLUS_INCLUDE_PATH")
2073b55e
LC
355 ;; Add 'include/c++' here so that <cstdlib>'s "#include_next
356 ;; <stdlib.h>" finds GCC's <stdlib.h>, not libc's.
357 (files '("include/c++" "include")))
d78010b8
RW
358 (search-path-specification
359 (variable "LIBRARY_PATH")
360 (files '("lib" "lib64")))))
361
362 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
363 (synopsis "GNU Compiler Collection")
364 (description
365 "GCC is the GNU Compiler Collection. It provides compiler front-ends
a22dc0c4 366for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
79c311b8 367Go. It also includes runtime support libraries for these languages.")
d78010b8
RW
368 (license gpl3+)
369 (supported-systems (delete "aarch64-linux" %supported-systems))
370 (home-page "https://gcc.gnu.org/")))))
832abc76 371
3b401612 372(define-public gcc-4.8
3b401612 373 (package (inherit gcc-4.7)
ab5f49cf 374 (version "4.8.5")
3b401612 375 (source (origin
7e35b9dd
LC
376 (method url-fetch)
377 (uri (string-append "mirror://gnu/gcc/gcc-"
378 version "/gcc-" version ".tar.bz2"))
379 (sha256
380 (base32
ab5f49cf 381 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
19d27131 382 (patches (search-patches "gcc-arm-link-spec-fix.patch"
0b93d04a 383 "gcc-4.8-libsanitizer-fix.patch"
8e7ec29d 384 "gcc-asan-missing-include.patch"
7bbc708a
EF
385 "gcc-fix-texi2pod.patch"))
386 (modules '((guix build utils)))
387 ;; This is required for building with glibc-2.26.
388 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
389 (snippet
6cbee49d
MW
390 '(begin
391 (for-each
392 (lambda (dir)
393 (substitute* (string-append "libgcc/config/"
394 dir "/linux-unwind.h")
395 (("struct ucontext") "ucontext_t")))
396 '("aarch64" "alpha" "bfin" "i386" "m68k"
397 "pa" "sh" "tilepro" "xtensa"))
398 #t))))
2b8d4ce8
EF
399 (supported-systems %supported-systems)
400 (inputs
ab53bdf0 401 `(("isl" ,isl-0.11)
2b8d4ce8
EF
402 ("cloog" ,cloog)
403 ,@(package-inputs gcc-4.7)))))
3b401612 404
571aa6cd 405(define-public gcc-4.9
dd4efefd 406 (package (inherit gcc-4.8)
b0847497 407 (version "4.9.4")
571aa6cd 408 (source (origin
7e35b9dd
LC
409 (method url-fetch)
410 (uri (string-append "mirror://gnu/gcc/gcc-"
411 version "/gcc-" version ".tar.bz2"))
412 (sha256
413 (base32
b0847497 414 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
d6593070 415 (patches (search-patches "gcc-4.9-libsanitizer-fix.patch"
3469a5ea 416 "gcc-4.9-libsanitizer-ustat.patch"
a33eac03 417 "gcc-4.9-libsanitizer-mode-size.patch"
d6593070 418 "gcc-arm-bug-71399.patch"
e80514bc 419 "gcc-asan-missing-include.patch"
19d27131 420 "gcc-libvtv-runpath.patch"
809b0a90
EF
421 "gcc-fix-texi2pod.patch"))
422 (modules '((guix build utils)))
423 ;; This is required for building with glibc-2.26.
424 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
425 (snippet
6cbee49d
MW
426 '(begin
427 (for-each
428 (lambda (dir)
429 (substitute* (string-append "libgcc/config/"
430 dir "/linux-unwind.h")
431 (("struct ucontext") "ucontext_t")))
432 '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
433 "pa" "sh" "tilepro" "xtensa"))
434 #t))))
19d27131
MC
435 ;; Override inherited texinfo-5 with latest version.
436 (native-inputs `(("perl" ,perl) ;for manpages
56c833ea
MB
437 ("texinfo" ,texinfo)))
438 (arguments
439 (if (%current-target-system)
440 (package-arguments gcc-4.8)
441 ;; For native builds of GCC 4.9 and GCC 5, the C++ include path needs
442 ;; to be adjusted so it does not interfere with GCC's own build processes.
443 (substitute-keyword-arguments (package-arguments gcc-4.8)
444 ((#:modules modules %gnu-build-system-modules)
445 `((srfi srfi-1)
446 ,@modules))
447 ((#:phases phases)
448 `(modify-phases ,phases
449 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
450 (lambda* (#:key inputs #:allow-other-keys)
451 (let ((libc (assoc-ref inputs "libc"))
452 (gcc (assoc-ref inputs "gcc")))
453 (setenv "CPLUS_INCLUDE_PATH"
454 (string-join (fold delete
455 (string-split (getenv "CPLUS_INCLUDE_PATH")
456 #\:)
457 (list (string-append libc "/include")
458 (string-append gcc "/include/c++")))
459 ":"))
460 (format #t
461 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
462 (getenv "CPLUS_INCLUDE_PATH"))
463 #t))))))))))
571aa6cd 464
629f4d2e 465(define-public gcc-5
7912677c
LC
466 ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
467 ;; them in a VPATH build.
7e35b9dd 468 (package (inherit gcc-4.9)
404e3d8b 469 (version "5.5.0")
60e2d5fe 470 (source (origin
7e35b9dd
LC
471 (method url-fetch)
472 (uri (string-append "mirror://gnu/gcc/gcc-"
404e3d8b 473 version "/gcc-" version ".tar.xz"))
7e35b9dd
LC
474 (sha256
475 (base32
404e3d8b 476 "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k"))
b810a850 477 (patches (search-patches "gcc-arm-bug-71399.patch"
1aef659e 478 "gcc-libsanitizer-ustat.patch"
b810a850 479 "gcc-strmov-store-file-names.patch"
d71d6fe8
MB
480 "gcc-5.0-libvtv-runpath.patch"
481 "gcc-5-source-date-epoch-1.patch"
19d27131 482 "gcc-5-source-date-epoch-2.patch"
a33eac03 483 "gcc-6-libsanitizer-mode-size.patch"
25bc0f34
JN
484 "gcc-fix-texi2pod.patch"
485 "gcc-5-hurd.patch"))
066ccc2c
LC
486 (modules '((guix build utils)))
487 (snippet
488 ;; Fix 'libcc1/configure' error when cross-compiling GCC.
489 ;; Without that, 'libcc1/configure' wrongfully determines that
490 ;; '-rdynamic' support is missing because $gcc_cv_objdump is
491 ;; empty:
492 ;;
493 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67590
494 ;; http://cgit.openembedded.org/openembedded-core/commit/?id=f6e47aa9b12f9ab61530c40e0343f451699d9077
6cbee49d
MW
495 '(begin
496 (substitute* "libcc1/configure"
497 (("\\$gcc_cv_objdump -T")
498 "$OBJDUMP_FOR_TARGET -T"))
499 #t))))
eb9696e7 500 (inputs
25bd7267
MB
501 `(;; GCC5 needs <isl/band.h> which is removed in later versions.
502 ("isl" ,isl-0.18)
eb9696e7 503 ,@(package-inputs gcc-4.7)))))
60e2d5fe 504
e760ec41
LC
505(define-public gcc-6
506 (package
507 (inherit gcc-5)
8d65ae44 508 (version "6.5.0")
e760ec41
LC
509 (source (origin
510 (method url-fetch)
511 (uri (string-append "mirror://gnu/gcc/gcc-"
0dd87919 512 version "/gcc-" version ".tar.xz"))
e760ec41
LC
513 (sha256
514 (base32
8d65ae44
MB
515 "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby"))
516 (patches (search-patches "gcc-strmov-store-file-names.patch"
a33eac03 517 "gcc-6-libsanitizer-mode-size.patch"
aace9be8
MB
518 "gcc-6-source-date-epoch-1.patch"
519 "gcc-6-source-date-epoch-2.patch"
8d65ae44 520 "gcc-5.0-libvtv-runpath.patch"))))
56c833ea
MB
521
522 ;; GCC 4.9 and 5 has a workaround that is not needed for GCC 6 and later.
523 (arguments (package-arguments gcc-4.8))
524
2b8d4ce8
EF
525 (inputs
526 `(("isl" ,isl)
12dc9f58
LC
527
528 ;; XXX: This gross hack allows us to have libstdc++'s <bits/c++config.h>
529 ;; in the search path, thereby avoiding misconfiguration of libstdc++:
530 ;; <https://bugs.gnu.org/42392>.
531 ("libstdc++" ,libstdc++-headers)
532
2073b55e 533 ,@(package-inputs gcc-4.7)))))
2b8d4ce8 534
0c5658df
EF
535(define-public gcc-7
536 (package
537 (inherit gcc-6)
8456f9fc 538 (version "7.5.0")
0c5658df
EF
539 (source (origin
540 (method url-fetch)
541 (uri (string-append "mirror://gnu/gcc/gcc-"
2bccf1c0 542 version "/gcc-" version ".tar.xz"))
0c5658df
EF
543 (sha256
544 (base32
8456f9fc 545 "0qg6kqc5l72hpnj4vr6l0p69qav0rh4anlkk3y55540zy3klc6dq"))
0c5658df 546 (patches (search-patches "gcc-strmov-store-file-names.patch"
a33eac03 547 "gcc-7-libsanitizer-mode-size.patch"
35dadded
EF
548 "gcc-5.0-libvtv-runpath.patch"))))
549 (description
550 "GCC is the GNU Compiler Collection. It provides compiler front-ends
551for several languages, including C, C++, Objective-C, Fortran, Ada, and Go.
552It also includes runtime support libraries for these languages.")))
e760ec41 553
a1fa2691
MB
554(define-public gcc-8
555 (package
556 (inherit gcc-7)
60ce496a 557 (version "8.4.0")
a1fa2691
MB
558 (source (origin
559 (method url-fetch)
560 (uri (string-append "mirror://gnu/gcc/gcc-"
561 version "/gcc-" version ".tar.xz"))
562 (sha256
563 (base32
60ce496a 564 "1m1d3gfix56w4aq8myazzfffkl8bqcrx4jhhapnjf7qfs596w2p3"))
a1fa2691
MB
565 (patches (search-patches "gcc-8-strmov-store-file-names.patch"
566 "gcc-5.0-libvtv-runpath.patch"))))))
567
bdfc3276
CD
568(define-public gcc-9
569 (package
570 (inherit gcc-8)
3dade1d5 571 (version "9.3.0")
bdfc3276
CD
572 (source (origin
573 (method url-fetch)
574 (uri (string-append "mirror://gnu/gcc/gcc-"
575 version "/gcc-" version ".tar.xz"))
576 (sha256
577 (base32
3dade1d5 578 "1la2yy27ziasyf0jvzk58y1i5b5bq2h176qil550bxhifs39gqbi"))
bdfc3276 579 (patches (search-patches "gcc-9-strmov-store-file-names.patch"
0e293f75 580 "gcc-9-asan-fix-limits-include.patch"
bdfc3276
CD
581 "gcc-5.0-libvtv-runpath.patch"))))))
582
2bb5b1d4
LC
583(define-public gcc-10
584 (package
585 (inherit gcc-8)
a365777e 586 (version "10.3.0")
2bb5b1d4
LC
587 (source (origin
588 (method url-fetch)
589 (uri (string-append "mirror://gnu/gcc/gcc-"
590 version "/gcc-" version ".tar.xz"))
591 (sha256
592 (base32
a365777e 593 "0i6378ig6h397zkhd7m4ccwjx5alvzrf2hm27p1pzwjhlv0h9x34"))
2bb5b1d4
LC
594 (patches (search-patches "gcc-9-strmov-store-file-names.patch"
595 "gcc-5.0-libvtv-runpath.patch"))))))
596
007ec662
EF
597(define-public gcc-11
598 (package
599 (inherit gcc-8)
600 (version "11.1.0")
601 (source (origin
602 (method url-fetch)
603 (uri (string-append "mirror://gnu/gcc/gcc-"
604 version "/gcc-" version ".tar.xz"))
605 (sha256
606 (base32
607 "1pwxrjhsymv90xzh0x42cxfnmhjinf2lnrrf3hj5jq1rm2w6yjjc"))
608 (patches (search-patches "gcc-9-strmov-store-file-names.patch"
609 "gcc-5.0-libvtv-runpath.patch"))))))
610
ce362de8 611;; Note: When changing the default gcc version, update
a172def5 612;; the gcc-toolchain-* definitions.
01e8263f 613(define-public gcc gcc-7)
eed67cbb 614
d0abf829
LC
615(define-public (make-libstdc++ gcc)
616 "Return a libstdc++ package based on GCC. The primary use case is when
617using compilers other than GCC."
618 (package
619 (inherit gcc)
620 (name "libstdc++")
621 (arguments
622 `(#:out-of-source? #t
cac88b28
CM
623 #:phases
624 ;; TODO: Use the target-powerpc arm for everyone.
625 ,(if (target-powerpc?)
626 `(modify-phases %standard-phases
627 ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64.
628 (add-before 'chdir 'fix-rs6000-libdir
629 (lambda _
630 (when (file-exists? "gcc/config/rs6000")
631 (substitute* (find-files "gcc/config/rs6000")
632 (("/lib64") "/lib")))
633 #t))
634 (add-before 'configure 'chdir
635 (lambda _
636 (chdir "libstdc++-v3")
637 #t)))
638 `(alist-cons-before 'configure 'chdir
639 (lambda _
640 (chdir "libstdc++-v3")
641 #t)
642 %standard-phases))
643
d0abf829
LC
644 #:configure-flags `("--disable-libstdcxx-pch"
645 ,(string-append "--with-gxx-include-dir="
646 (assoc-ref %outputs "out")
647 "/include"))))
648 (outputs '("out" "debug"))
649 (inputs '())
650 (native-inputs '())
651 (propagated-inputs '())
652 (synopsis "GNU C++ standard library")))
653
12dc9f58
LC
654(define libstdc++
655 ;; Libstdc++ matching the default GCC.
656 (make-libstdc++ gcc))
657
658(define libstdc++-headers
659 ;; XXX: This package is for internal use to work around
660 ;; <https://bugs.gnu.org/42392> (see above). The main difference compared
661 ;; to the libstdc++ headers that come with 'gcc' is that <bits/c++config.h>
662 ;; is right under include/c++ and not under
663 ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR).
664 (package
665 (inherit libstdc++)
666 (name "libstdc++-headers")
667 (outputs '("out"))
668 (build-system trivial-build-system)
669 (arguments
670 '(#:builder (let* ((out (assoc-ref %outputs "out"))
671 (libstdc++ (assoc-ref %build-inputs "libstdc++")))
672 (mkdir out)
673 (mkdir (string-append out "/include"))
674 (symlink (string-append libstdc++ "/include")
675 (string-append out "/include/c++")))))
676 (inputs `(("libstdc++" ,libstdc++)))
677 (synopsis "Headers of GNU libstdc++")))
678
d0abf829
LC
679(define-public libstdc++-4.9
680 (make-libstdc++ gcc-4.9))
681
2b6b6d13
RW
682(define (make-libiberty gcc)
683 "Return a libiberty package based on GCC."
684 (package
685 (inherit gcc)
686 (name "libiberty")
687 (arguments
688 `(#:out-of-source? #t
689 #:phases
690 (modify-phases %standard-phases
691 (add-before 'configure 'chdir
0f7e6964 692 (lambda _
693 (chdir "libiberty")
694 #t))
695 (replace 'install
696 (lambda* (#:key outputs #:allow-other-keys)
697 (let* ((out (assoc-ref outputs "out"))
698 (lib (string-append out "/lib/"))
699 (include (string-append out "/include/")))
700 (install-file "libiberty.a" lib)
701 (install-file "../include/libiberty.h" include))
702 #t)))))
2b6b6d13
RW
703 (inputs '())
704 (outputs '("out"))
705 (native-inputs '())
706 (propagated-inputs '())
0f665134 707 (properties '())
2b6b6d13
RW
708 (synopsis "Collection of subroutines used by various GNU programs")))
709
710(define-public libiberty
711 (make-libiberty gcc))
712
009b53fd
LC
713(define* (custom-gcc gcc name languages
714 #:optional
715 (search-paths (package-native-search-paths gcc))
716 #:key (separate-lib-output? #t))
717 "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
718as the 'native-search-paths' field."
fdd6c726
NK
719 (package (inherit gcc)
720 (name name)
c4df90a5
MW
721 (outputs (if separate-lib-output?
722 (package-outputs gcc)
723 (delete "lib" (package-outputs gcc))))
009b53fd 724 (native-search-paths search-paths)
fbeb92d7 725 (properties (alist-delete 'hidden? (package-properties gcc)))
fdd6c726 726 (arguments
587398d2
MB
727 (substitute-keyword-arguments (package-arguments gcc)
728 ((#:modules modules %gnu-build-system-modules)
729 `(,@modules
730 (srfi srfi-1)
731 (srfi srfi-26)
732 (ice-9 regex)))
fdd6c726
NK
733 ((#:configure-flags flags)
734 `(cons (string-append "--enable-languages="
735 ,(string-join languages ","))
736 (remove (cut string-match "--enable-languages.*" <>)
82f145ef
RW
737 ,flags)))
738 ((#:phases phases)
739 `(modify-phases ,phases
740 (add-after 'install 'remove-broken-or-conflicting-files
741 (lambda* (#:key outputs #:allow-other-keys)
742 (for-each delete-file
743 (find-files (string-append (assoc-ref outputs "out") "/bin")
a1a3b25d 744 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
82f145ef 745 #t))))))))
fdd6c726 746
009b53fd
LC
747(define %generic-search-paths
748 ;; This is the language-neutral search path for GCC. Entries in $CPATH are
749 ;; not considered "system headers", which means GCC can raise warnings for
750 ;; issues in those headers. 'CPATH' is the only one that works for
751 ;; front-ends not in the C family.
752 (list (search-path-specification
753 (variable "CPATH")
754 (files '("include")))
755 (search-path-specification
756 (variable "LIBRARY_PATH")
757 (files '("lib" "lib64")))))
758
0681f054 759(define-public gfortran
a7c75b8d 760 (hidden-package
12dc9f58
LC
761 (custom-gcc (package
762 (inherit gcc)
763 ;; XXX: Remove LIBSTDC++-HEADERS from the inputs just to
764 ;; avoid a rebuild of all the GFORTRAN dependents.
765 ;; TODO: Remove this hack on the next rebuild cycle.
766 (inputs (alist-delete "libstdc++" (package-inputs gcc))))
767 "gfortran" '("fortran")
a7c75b8d 768 %generic-search-paths)))
f66be84d 769
163686d8 770(define-public gdc-10
771 (hidden-package
772 (custom-gcc gcc-10 "gdc" '("d")
773 %generic-search-paths)))
774
1f5543e7
EF
775(define-public gdc-11
776 (hidden-package
777 (custom-gcc gcc-11 "gdc" '("d")
778 %generic-search-paths)))
779
76d2b9a2
JL
780(define-public libgccjit
781 (package
782 (inherit gcc-9)
783 (name "libgccjit")
784 (outputs (delete "lib" (package-outputs gcc)))
785 (properties (alist-delete 'hidden? (package-properties gcc)))
786 (arguments
787 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
788 (guix build utils)
789 (ice-9 regex)
790 (srfi srfi-1)
791 (srfi srfi-26))
792 ,@(package-arguments gcc))
793 ((#:configure-flags flags)
794 `(append `("--enable-host-shared"
795 ,(string-append "--enable-languages=jit"))
796 (remove (cut string-match "--enable-languages.*" <>)
797 ,flags)))
798 ((#:phases phases)
799 `(modify-phases ,phases
800 (add-after 'install 'remove-broken-or-conflicting-files
801 (lambda* (#:key outputs #:allow-other-keys)
802 (for-each delete-file
803 (find-files (string-append (assoc-ref outputs "out") "/bin")
804 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
a4fe16ee 805 #t))))))
806 (synopsis "GCC library generating machine code on-the-fly at runtime")
807 (description
808 "This package is part of the GNU Compiler Collection and provides an
809embeddable library for generating machine code on-the-fly at runtime. This
810shared library can then be dynamically-linked into bytecode interpreters and
811other such programs that want to generate machine code on-the-fly at run-time.
812It can also be used for ahead-of-time code generation for building standalone
813compilers. The just-in-time (jit) part of the name is now something of a
814misnomer.")))
76d2b9a2
JL
815
816
c8732e19 817(define-public gccgo-4.9
542c4707 818 (custom-gcc (package
819 (inherit gcc-4.9)
820 (synopsis "Go frontend to GCC")
821 (description
822 "This package is part of the GNU Compiler Collection and
823provides the GNU compiler for the Go programming language."))
824 "gccgo" '("go")
009b53fd 825 %generic-search-paths
c4df90a5
MW
826 ;; Suppress the separate "lib" output, because otherwise the
827 ;; "lib" and "out" outputs would refer to each other, creating
828 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
829 #:separate-lib-output? #f))
fdd6c726 830
14cce84c
JK
831(define %objc-search-paths
832 (list (search-path-specification
833 (variable "OBJC_INCLUDE_PATH")
834 (files '("include")))
835 (search-path-specification
836 (variable "LIBRARY_PATH")
837 (files '("lib" "lib64")))))
838
fdd6c726 839(define-public gcc-objc-4.8
009b53fd 840 (custom-gcc gcc-4.8 "gcc-objc" '("objc")
14cce84c 841 %objc-search-paths))
fdd6c726 842
2d69c161
RW
843(define-public gcc-objc-4.9
844 (custom-gcc gcc-4.9 "gcc-objc" '("objc")
14cce84c 845 %objc-search-paths))
2d69c161 846
f51d01e1
EF
847(define-public gcc-objc-5
848 (custom-gcc gcc-5 "gcc-objc" '("objc")
14cce84c 849 %objc-search-paths))
f51d01e1 850
4072c10b
EF
851(define-public gcc-objc-6
852 (custom-gcc gcc-6 "gcc-objc" '("objc")
14cce84c 853 %objc-search-paths))
ce9afe2b
EF
854
855(define-public gcc-objc-7
856 (custom-gcc gcc-7 "gcc-objc" '("objc")
14cce84c 857 %objc-search-paths))
4072c10b 858
f66be84d
EB
859(define-public gcc-objc-8
860 (custom-gcc gcc-8 "gcc-objc" '("objc")
14cce84c
JK
861 %objc-search-paths))
862
863(define-public gcc-objc-9
864 (custom-gcc gcc-9 "gcc-objc" '("objc")
865 %objc-search-paths))
866
867(define-public gcc-objc-10
868 (custom-gcc gcc-10 "gcc-objc" '("objc")
869 %objc-search-paths))
f66be84d 870
01e8263f 871(define-public gcc-objc gcc-objc-7)
8b196ad2 872
14cce84c
JK
873(define %objc++-search-paths
874 (list (search-path-specification
875 (variable "OBJCPLUS_INCLUDE_PATH")
876 (files '("include")))
877 (search-path-specification
878 (variable "LIBRARY_PATH")
879 (files '("lib" "lib64")))))
880
fdd6c726 881(define-public gcc-objc++-4.8
009b53fd 882 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
14cce84c 883 %objc++-search-paths))
fdd6c726 884
a5948c0d
RW
885(define-public gcc-objc++-4.9
886 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
14cce84c 887 %objc++-search-paths))
fdd6c726 888
ed8cdab8
EF
889(define-public gcc-objc++-5
890 (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
14cce84c 891 %objc++-search-paths))
ed8cdab8 892
7a7c6308
EF
893(define-public gcc-objc++-6
894 (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
14cce84c 895 %objc++-search-paths))
7a7c6308 896
e05f8d2f
EF
897(define-public gcc-objc++-7
898 (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
14cce84c 899 %objc++-search-paths))
e05f8d2f 900
f66be84d
EB
901(define-public gcc-objc++-8
902 (custom-gcc gcc-8 "gcc-objc++" '("obj-c++")
14cce84c
JK
903 %objc++-search-paths))
904
905(define-public gcc-objc++-9
906 (custom-gcc gcc-9 "gcc-objc++" '("obj-c++")
907 %objc++-search-paths))
908
909(define-public gcc-objc++-10
910 (custom-gcc gcc-10 "gcc-objc++" '("obj-c++")
911 %objc++-search-paths))
f66be84d 912
01e8263f 913(define-public gcc-objc++ gcc-objc++-7)
987a1183 914
98b385d1
LC
915(define (make-libstdc++-doc gcc)
916 "Return a package with the libstdc++ documentation for GCC."
917 (package
918 (inherit gcc)
919 (name "libstdc++-doc")
920 (version (package-version gcc))
921 (synopsis "GNU libstdc++ documentation")
922 (outputs '("out"))
923 (native-inputs `(("doxygen" ,doxygen)
924 ("texinfo" ,texinfo)
925 ("libxml2" ,libxml2)
926 ("libxslt" ,libxslt)
927 ("docbook-xml" ,docbook-xml)
928 ("docbook-xsl" ,docbook-xsl)
929 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
930 (inputs '())
931 (propagated-inputs '())
932 (arguments
933 '(#:out-of-source? #t
934 #:tests? #f ;it's just documentation
935 #:phases (modify-phases %standard-phases
936 (add-before 'configure 'chdir
937 (lambda _
61a815eb
MW
938 (chdir "libstdc++-v3")
939 #t))
98b385d1
LC
940 (add-before 'configure 'set-xsl-directory
941 (lambda* (#:key inputs #:allow-other-keys)
942 (let ((docbook (assoc-ref inputs "docbook-xsl")))
943 (substitute* (find-files "doc"
944 "^Makefile\\.in$")
945 (("@XSL_STYLE_DIR@")
946 (string-append
947 docbook "/xml/xsl/"
61a815eb
MW
948 (strip-store-file-name docbook))))
949 #t)))
98b385d1
LC
950 (replace 'build
951 (lambda _
952 ;; XXX: There's also a 'doc-info' target, but it
953 ;; relies on docbook2X, which itself relies on
954 ;; DocBook 4.1.2, which is not really usable
955 ;; (lacks a catalog.xml.)
61a815eb
MW
956 (invoke "make"
957 "doc-html"
958 "doc-man")))
98b385d1
LC
959 (replace 'install
960 (lambda* (#:key outputs #:allow-other-keys)
961 (let ((out (assoc-ref outputs "out")))
61a815eb
MW
962 (invoke "make"
963 "doc-install-html"
798591b6
LC
964 "doc-install-man")))))))
965 (properties (alist-delete 'hidden? (package-properties gcc)))))
98b385d1 966
629f4d2e
MW
967(define-public libstdc++-doc-5
968 (make-libstdc++-doc gcc-5))
98b385d1 969
e7313ae2
LC
970(define-public libstdc++-doc-9
971 (make-libstdc++-doc gcc-9))
972
832abc76
LC
973(define-public isl
974 (package
975 (name "isl")
4a0c71f9 976 (version "0.22.1")
832abc76
LC
977 (source (origin
978 (method url-fetch)
979 (uri (list (string-append
590a4904 980 "http://isl.gforge.inria.fr/isl-"
832abc76
LC
981 version
982 ".tar.bz2")
983 (string-append %gcc-infrastructure
9f1da6ce 984 name "-" version ".tar.bz2")))
832abc76
LC
985 (sha256
986 (base32
4a0c71f9 987 "1kf54jib0nind1pvakblnfhimmwzm0y1llz8470ag0di5vwqwrhs"))))
832abc76 988 (build-system gnu-build-system)
5d8a4354
MB
989 (outputs '("out" "static"))
990 (arguments
991 '(#:phases (modify-phases %standard-phases
992 (add-after 'install 'move-static-library
993 (lambda* (#:key outputs #:allow-other-keys)
994 (let* ((out (assoc-ref outputs "out"))
995 (static (assoc-ref outputs "static"))
996 (source (string-append out "/lib/libisl.a"))
997 (target (string-append static "/lib/libisl.a")))
998 (mkdir-p (dirname target))
999 (link source target)
1000 (delete-file source)
1001
1002 ;; Remove reference to libisl.a from the .la file so
1003 ;; libtool looks for it in the usual locations.
1004 (substitute* (string-append out "/lib/libisl.la")
1005 (("^old_library=.*")
1006 "old_library=''\n"))
1007 #t))))))
832abc76 1008 (inputs `(("gmp" ,gmp)))
590a4904 1009 (home-page "http://isl.gforge.inria.fr/")
832abc76 1010 (synopsis
9e771e3b
LC
1011 "Manipulating sets and relations of integer points \
1012bounded by linear constraints")
832abc76
LC
1013 (description
1014 "isl is a library for manipulating sets and relations of integer points
35b9e423 1015bounded by linear constraints. Supported operations on sets include
832abc76
LC
1016intersection, union, set difference, emptiness check, convex hull, (integer)
1017affine hull, integer projection, computing the lexicographic minimum using
1018parametric integer programming, coalescing and parametric vertex
35b9e423 1019enumeration. It also includes an ILP solver based on generalized basis
832abc76
LC
1020reduction, transitive closures on maps (which may encode infinite graphs),
1021dependence analysis and bounds on piecewise step-polynomials.")
1022 (license lgpl2.1+)))
1023
25bd7267
MB
1024(define-public isl-0.18
1025 (package
1026 (inherit isl)
1027 (version "0.18")
1028 (source (origin
1029 (method url-fetch)
1030 (uri (list (string-append "http://isl.gforge.inria.fr/isl-"
1031 version ".tar.bz2")
1032 (string-append %gcc-infrastructure
9f1da6ce 1033 "isl-" version ".tar.bz2")))
25bd7267
MB
1034 (sha256
1035 (base32
1036 "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))))
1037
ab53bdf0
EF
1038(define-public isl-0.11
1039 (package
1040 (inherit isl)
1041 (name "isl")
1042 (version "0.11.1")
1043 (source (origin
1044 (method url-fetch)
1045 (uri (list (string-append
1046 "http://isl.gforge.inria.fr/isl-"
1047 version
1048 ".tar.bz2")
1049 (string-append %gcc-infrastructure
9f1da6ce 1050 name "-" version ".tar.bz2")))
ab53bdf0
EF
1051 (sha256
1052 (base32
1053 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
1054 (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))))
1055
832abc76
LC
1056(define-public cloog
1057 (package
1058 (name "cloog")
1059 (version "0.18.0")
1060 (source
1061 (origin
1062 (method url-fetch)
1063 (uri (list (string-append
1064 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
1065 version
1066 ".tar.gz")
1067 (string-append %gcc-infrastructure
1068 name "-" version ".tar.gz")))
1069 (sha256
1070 (base32
1071 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
1072 (file-name (string-append name "-" version ".tar.gz"))))
1073 (build-system gnu-build-system)
1074 (inputs `(("gmp" ,gmp)
ab53bdf0 1075 ("isl" ,isl-0.11)))
832abc76
LC
1076 (arguments '(#:configure-flags '("--with-isl=system")))
1077 (home-page "http://www.cloog.org/")
9e771e3b 1078 (synopsis "Library to generate code for scanning Z-polyhedra")
832abc76
LC
1079 (description
1080 "CLooG is a free software library to generate code for scanning
1081Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
1082reaches each integral point of one or more parameterized polyhedra.
1083CLooG has been originally written to solve the code generation problem
1084for optimizing compilers based on the polytope model. Nevertheless it
1085is used now in various area e.g., to build control automata for
1086high-level synthesis or to find the best polynomial approximation of a
1087function. CLooG may help in any situation where scanning polyhedra
1088matters. While the user has full control on generated code quality,
1089CLooG is designed to avoid control overhead and to produce a very
1090effective code.")
1091 (license gpl2+)))
5c126b64 1092
50c7a1e2
LC
1093(define-public gnu-c-manual
1094 (package
1095 (name "gnu-c-manual")
d35f8c7c 1096 (version "0.2.5")
50c7a1e2
LC
1097 (source (origin
1098 (method url-fetch)
1099 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
1100 version ".tar.gz"))
1101 (sha256
1102 (base32
d35f8c7c 1103 "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
50c7a1e2
LC
1104 (build-system gnu-build-system)
1105 (native-inputs `(("texinfo" ,texinfo)))
1106 (arguments
1107 '(#:phases (modify-phases %standard-phases
1108 (delete 'configure)
1109 (delete 'check)
1110 (replace 'build
1111 (lambda _
9feb4fd5
MW
1112 (invoke "make"
1113 "gnu-c-manual.info"
1114 "gnu-c-manual.html")))
50c7a1e2
LC
1115 (replace 'install
1116 (lambda* (#:key outputs #:allow-other-keys)
1117 (let* ((out (assoc-ref outputs "out"))
1118 (info (string-append out "/share/info"))
1119 (html (string-append
1120 out "/share/doc/gnu-c-manual")))
1121 (mkdir-p info)
1122 (mkdir-p html)
1123
1124 (for-each (lambda (file)
1125 (copy-file file
1126 (string-append info "/"
1127 file)))
1128 (find-files "." "\\.info(-[0-9])?$"))
1129 (for-each (lambda (file)
1130 (copy-file file
1131 (string-append html "/"
1132 file)))
1133 (find-files "." "\\.html$"))
1134 #t))))))
1135 (synopsis "Reference manual for the C programming language")
1136 (description
1137 "This is a reference manual for the C programming language, as
1138implemented by the GNU C Compiler (gcc). As a reference, it is not intended
1139to be a tutorial of the language. Rather, it outlines all of the constructs
1140of the language. Library functions are not included.")
6fd52309 1141 (home-page "https://www.gnu.org/software/gnu-c-manual/")
50c7a1e2 1142 (license fdl1.3+)))