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