1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
8 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages gcc)
26 #:use-module ((guix licenses)
27 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
28 #:use-module (gnu packages)
29 #:use-module (gnu packages bootstrap)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages multiprecision)
32 #:use-module (gnu packages texinfo)
33 #:use-module (gnu packages dejagnu)
34 #:use-module (gnu packages documentation)
35 #:use-module (gnu packages xml)
36 #:use-module (gnu packages docbook)
37 #:use-module (gnu packages graphviz)
38 #:use-module (gnu packages elf)
39 #:use-module (gnu packages perl)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system trivial)
44 #:use-module (guix utils)
45 #:use-module (srfi srfi-1)
46 #:use-module (ice-9 regex))
48 (define %gcc-infrastructure
49 ;; Base URL for GCC's infrastructure.
50 "mirror://gcc/infrastructure/")
52 (define (gcc-configure-flags-for-triplet target)
53 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
55 The purpose of this procedure is to translate extended GNU triplets---e.g.,
56 where the OS part is overloaded to denote a specific ABI---into GCC
57 `configure' options. We take extended GNU triplets that glibc recognizes."
58 (cond ((string-match "^mips64el.*gnuabin?64$" target)
59 ;; Triplets recognized by glibc as denoting the N64 ABI; see
60 ;; ports/sysdeps/mips/preconfigure.
63 ((string-match "^arm.*-gnueabihf$" target)
64 '("--with-arch=armv7-a"
69 ((and (string-suffix? "-gnu" target)
70 (not (string-contains target "-linux")))
71 ;; Cross-compilation of libcilkrts in GCC 5.5.0 to GNU/Hurd fails
73 ;; libcilkrts/runtime/os-unix.c:388:2: error: #error "Unknown architecture"
74 ;; Cilk has been removed from GCC 8 anyway.
75 '("--disable-libcilkrts"))
78 ;; TODO: Add `arm.*-gnueabi', etc.
81 (define-public gcc-4.7
82 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
85 ;; Return the `_FOR_TARGET' variables that are needed when
86 ;; cross-compiling GCC.
87 (let ((target (%current-target-system)))
89 (map (lambda (var tool)
90 (string-append (string-append var "_FOR_TARGET")
92 '("CC" "CXX" "LD" "AR" "NM" "OBJDUMP" "RANLIB" "STRIP")
93 '("gcc" "g++" "ld" "ar" "nm" "objdump" "ranlib" "strip"))
96 (let ((base '(or (assoc-ref outputs "lib")
97 (assoc-ref outputs "out"))))
99 ;; Return the directory that contains lib/libgcc_s.so et al.
100 (if (%current-target-system)
101 `(string-append ,base "/" ,(%current-target-system))
105 ;; This is terrible. Since we have two levels of quasiquotation,
106 ;; we have to do this convoluted thing just so we can insert the
107 ;; contents of (maybe-target-tools).
111 "--enable-languages=c,c++"
115 ;; No pre-compiled libstdc++ headers, to save space.
116 "--disable-libstdcxx-pch"
118 "--with-local-prefix=/no-gcc-local-prefix"
120 ;; With a separate "lib" output, the build system
121 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
122 ;; it. (Don't use a versioned sub-directory, that's
124 ,(string-append "--with-gxx-include-dir="
125 (assoc-ref %outputs "out")
128 ,(let ((libc (assoc-ref %build-inputs "libc")))
130 (string-append "--with-native-system-header-dir=" libc
132 "--without-headers")))
134 ;; Pass the right options for the target triplet.
136 (or (%current-target-system)
137 (nix-system->gnu-triplet (%current-system)))))
138 (gcc-configure-flags-for-triplet triplet))
140 (maybe-target-tools))))))
146 (uri (string-append "mirror://gnu/gcc/gcc-"
147 version "/gcc-" version ".tar.bz2"))
148 (patches (search-patches "gcc-4-compile-with-gcc-5.patch"))
151 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
152 (patches (search-patches "gcc-fix-texi2pod.patch"))))
153 (build-system gnu-build-system)
155 ;; Separate out the run-time support libraries because all the
156 ;; dynamic-linked objects depend on it.
157 (outputs '("out" ;commands, etc. (60+ MiB)
158 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
159 "debug")) ;debug symbols of run-time libraries
161 (inputs `(("gmp" ,gmp)
167 ;; GCC < 5 is one of the few packages that doesn't ship .info files.
168 ;; Newer texinfos fail to build the manual, so we use an older one.
169 (native-inputs `(("perl" ,perl) ;for manpages
170 ("texinfo" ,texinfo-5)))
173 `(#:out-of-source? #t
174 #:configure-flags ,(configure-flags)
176 ;; None of the flags below are needed when doing a Canadian cross.
177 ;; TODO: Simplify this.
178 ,(if (%current-target-system)
182 `(let* ((libc (assoc-ref %build-inputs "libc"))
183 (libc-native (or (assoc-ref %build-inputs "libc-native")
186 (list (string-append "LDFLAGS_FOR_TARGET="
188 "-Wl,-dynamic-linker "
190 ,(glibc-dynamic-linker)))
193 ;; Native programs like 'genhooks' also need that right.
194 ,(string-append "LDFLAGS="
195 "-Wl,-rpath=" libc-native "/lib "
196 "-Wl,-dynamic-linker "
197 "-Wl," libc-native ,(glibc-dynamic-linker))
198 ,(string-append "BOOT_CFLAGS=-O2 "
199 ,(if stripped? "-g0" "-g")))))
204 (modify-phases %standard-phases
205 (add-before 'configure 'pre-configure
206 (lambda* (#:key inputs outputs #:allow-other-keys)
207 (let ((libdir ,(libdir))
208 (libc (assoc-ref inputs "libc")))
210 ;; The following is not performed for `--without-headers'
211 ;; cross-compiler builds.
213 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
214 ;; single line, to allow the next step to work properly.
217 (substitute* (find-files "gcc/config"
218 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
219 (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
223 ;; Fix the dynamic linker's file name.
224 (substitute* (find-files "gcc/config"
225 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
226 (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
228 (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
230 (string-append libc ,(glibc-dynamic-linker)))))
232 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
233 ;; `crt{begin,end}.o', which come with GCC.
234 (substitute* (find-files "gcc/config"
236 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
237 ;; Help libgcc_s.so be found (see also below.) Always use
238 ;; '-lgcc_s' so that libgcc_s.so is always found by those
239 ;; programs that use 'pthread_cancel' (glibc dlopens
240 ;; libgcc_s.so when pthread_cancel support is needed, but
241 ;; having it in the application's RUNPATH isn't enough; see
242 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
244 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
245 ;; later phase of %gcc-static. If you change the string
246 ;; below, make sure to update the relevant code in
247 ;; %gcc-static package as needed.
248 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
249 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
250 libc libc libdir suffix))
251 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
252 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
253 #define STANDARD_STARTFILE_PREFIX_2 \"\"
257 ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
258 ;; GNU_USER_* defines. Do the above for this case.
260 "gcc/config/rs6000/sysv4.h"
261 (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
262 (format #f "#define LIB_LINUX_SPEC \
263 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
264 libc libc libdir suffix))
265 (("#define STARTFILE_LINUX_SPEC.*$" line)
266 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
267 #define STANDARD_STARTFILE_PREFIX_2 \"\"
271 ;; Don't retain a dependency on the build-time sed.
272 (substitute* "fixincludes/fixincl.x"
273 (("static char const sed_cmd_z\\[\\] =.*;")
274 "static char const sed_cmd_z[] = \"sed\";"))
276 ;; Aarch64 support didn't land in GCC until the 4.8 series.
277 (when (file-exists? "gcc/config/aarch64")
278 ;; Force Aarch64 libdir to be /lib and not /lib64
279 (substitute* "gcc/config/aarch64/t-aarch64-linux"
282 (when (file-exists? "libbacktrace")
283 ;; GCC 4.8+ comes with libbacktrace. By default it builds
284 ;; with -Werror, which fails with a -Wcast-qual error in glibc
285 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
286 (substitute* "libbacktrace/configure"
287 (("WARN_FLAGS=(.*)-Werror" _ flags)
288 (string-append "WARN_FLAGS=" flags)))
290 (when (file-exists? "libsanitizer/libbacktrace")
291 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
292 (substitute* "libsanitizer/libbacktrace/Makefile.in"
296 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
297 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
298 ;; and <http://bugs.gnu.org/20358>.
299 (substitute* "libstdc++-v3/src/Makefile.in"
301 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
303 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
304 ;; circularity between "out" and "lib". (Note:
305 ;; --with-python-dir is useless because it imposes $(prefix) as
306 ;; the parent directory.)
307 (substitute* "libstdc++-v3/python/Makefile.in"
309 (string-append "pythondir = " libdir "/share"
310 "/gcc-$(gcc_version)/python\n")))
312 ;; Avoid another circularity between the outputs: this #define
313 ;; ends up in auto-host.h in the "lib" output, referring to
314 ;; "out". (This variable is used to augment cpp's search path,
315 ;; but there's nothing useful to look for here.)
316 (substitute* "gcc/config.in"
317 (("PREFIX_INCLUDE_DIR")
318 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
321 (add-after 'configure 'post-configure
323 ;; Don't store configure flags, to avoid retaining references to
324 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
325 (substitute* "Makefile"
326 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
327 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
331 ;; Use the language-specific variables rather than 'CPATH' because they
332 ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
333 ;; The intent is to allow headers that are in the search path to be
334 ;; treated as "system headers" (headers exempt from warnings) just like
335 ;; the typical /usr/include headers on an FHS system.
336 (list (search-path-specification
337 (variable "C_INCLUDE_PATH")
338 (files '("include")))
339 (search-path-specification
340 (variable "CPLUS_INCLUDE_PATH")
341 (files '("include")))
342 (search-path-specification
343 (variable "LIBRARY_PATH")
344 (files '("lib" "lib64")))))
346 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
347 (synopsis "GNU Compiler Collection")
349 "GCC is the GNU Compiler Collection. It provides compiler front-ends
350 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
351 Go. It also includes runtime support libraries for these languages.")
353 (supported-systems (delete "aarch64-linux" %supported-systems))
354 (home-page "https://gcc.gnu.org/"))))
356 (define-public gcc-4.8
357 (package (inherit gcc-4.7)
361 (uri (string-append "mirror://gnu/gcc/gcc-"
362 version "/gcc-" version ".tar.bz2"))
365 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
366 (patches (search-patches "gcc-arm-link-spec-fix.patch"
367 "gcc-asan-missing-include.patch"
368 "gcc-fix-texi2pod.patch"))
369 (modules '((guix build utils)))
370 ;; This is required for building with glibc-2.26.
371 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
376 (substitute* (string-append "libgcc/config/"
377 dir "/linux-unwind.h")
378 (("struct ucontext") "ucontext_t")))
379 '("aarch64" "alpha" "bfin" "i386" "m68k"
380 "pa" "sh" "tilepro" "xtensa"))
382 (supported-systems %supported-systems)
386 ,@(package-inputs gcc-4.7)))))
388 (define-public gcc-4.9
389 (package (inherit gcc-4.8)
393 (uri (string-append "mirror://gnu/gcc/gcc-"
394 version "/gcc-" version ".tar.bz2"))
397 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
398 (patches (search-patches "gcc-4.9-libsanitizer-fix.patch"
399 "gcc-arm-bug-71399.patch"
400 "gcc-asan-missing-include.patch"
401 "gcc-libvtv-runpath.patch"
402 "gcc-fix-texi2pod.patch"))
403 (modules '((guix build utils)))
404 ;; This is required for building with glibc-2.26.
405 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
410 (substitute* (string-append "libgcc/config/"
411 dir "/linux-unwind.h")
412 (("struct ucontext") "ucontext_t")))
413 '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
414 "pa" "sh" "tilepro" "xtensa"))
416 ;; Override inherited texinfo-5 with latest version.
417 (native-inputs `(("perl" ,perl) ;for manpages
418 ("texinfo" ,texinfo)))))
421 ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
422 ;; them in a VPATH build.
423 (package (inherit gcc-4.9)
427 (uri (string-append "mirror://gnu/gcc/gcc-"
428 version "/gcc-" version ".tar.xz"))
431 "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k"))
432 (patches (search-patches "gcc-arm-bug-71399.patch"
433 "gcc-strmov-store-file-names.patch"
434 "gcc-5.0-libvtv-runpath.patch"
435 "gcc-5-source-date-epoch-1.patch"
436 "gcc-5-source-date-epoch-2.patch"
437 "gcc-fix-texi2pod.patch"))
438 (modules '((guix build utils)))
440 ;; Fix 'libcc1/configure' error when cross-compiling GCC.
441 ;; Without that, 'libcc1/configure' wrongfully determines that
442 ;; '-rdynamic' support is missing because $gcc_cv_objdump is
445 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67590
446 ;; http://cgit.openembedded.org/openembedded-core/commit/?id=f6e47aa9b12f9ab61530c40e0343f451699d9077
448 (substitute* "libcc1/configure"
449 (("\\$gcc_cv_objdump -T")
450 "$OBJDUMP_FOR_TARGET -T"))
454 ,@(package-inputs gcc-4.7)))))
462 (uri (string-append "mirror://gnu/gcc/gcc-"
463 version "/gcc-" version ".tar.xz"))
466 "1m0lr7938lw5d773dkvwld90hjlcq2282517d1gwvrfzmwgg42w5"))
467 (patches (search-patches "gcc-libsanitizer-fix.patch"
468 "gcc-strmov-store-file-names.patch"
469 "gcc-6-source-date-epoch-1.patch"
470 "gcc-6-source-date-epoch-2.patch"
471 "gcc-5.0-libvtv-runpath.patch"))
472 (modules '((guix build utils)))
473 ;; This is required for building with glibc-2.26.
474 ;; This can be removed when gcc-6.5.0 is released.
475 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
480 (substitute* (string-append "libgcc/config/"
481 dir "/linux-unwind.h")
482 (("struct ucontext") "ucontext_t")))
483 '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
484 "pa" "sh" "tilepro" "xtensa"))
488 ,@(package-inputs gcc-4.7)))))
496 (uri (string-append "mirror://gnu/gcc/gcc-"
497 version "/gcc-" version ".tar.xz"))
500 "0p71bij6bfhzyrs8676a8jmpjsfz392s2rg862sdnsk30jpacb43"))
501 (patches (search-patches "gcc-strmov-store-file-names.patch"
502 "gcc-5.0-libvtv-runpath.patch"))))
504 "GCC is the GNU Compiler Collection. It provides compiler front-ends
505 for several languages, including C, C++, Objective-C, Fortran, Ada, and Go.
506 It also includes runtime support libraries for these languages.")))
508 ;; Note: When changing the default gcc version, update
509 ;; the gcc-toolchain-* definitions and the gfortran definition
511 (define-public gcc gcc-5)
513 (define-public (make-libstdc++ gcc)
514 "Return a libstdc++ package based on GCC. The primary use case is when
515 using compilers other than GCC."
520 `(#:out-of-source? #t
521 #:phases (alist-cons-before
524 (chdir "libstdc++-v3"))
526 #:configure-flags `("--disable-libstdcxx-pch"
527 ,(string-append "--with-gxx-include-dir="
528 (assoc-ref %outputs "out")
530 (outputs '("out" "debug"))
533 (propagated-inputs '())
534 (synopsis "GNU C++ standard library")))
536 (define-public libstdc++-4.9
537 (make-libstdc++ gcc-4.9))
539 (define (make-libiberty gcc)
540 "Return a libiberty package based on GCC."
545 `(#:out-of-source? #t
547 (modify-phases %standard-phases
548 (add-before 'configure 'chdir
554 (lambda* (#:key outputs #:allow-other-keys)
555 (let* ((out (assoc-ref outputs "out"))
556 (lib (string-append out "/lib/"))
557 (include (string-append out "/include/")))
560 (copy-file "libiberty.a"
561 (string-append lib "libiberty.a"))
562 (copy-file "../include/libiberty.h"
563 (string-append include "libiberty.h"))
568 (propagated-inputs '())
569 (synopsis "Collection of subroutines used by various GNU programs")))
571 (define-public libiberty
572 (make-libiberty gcc))
574 (define* (custom-gcc gcc name languages
576 (search-paths (package-native-search-paths gcc))
577 #:key (separate-lib-output? #t))
578 "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
579 as the 'native-search-paths' field."
580 (package (inherit gcc)
582 (outputs (if separate-lib-output?
583 (package-outputs gcc)
584 (delete "lib" (package-outputs gcc))))
585 (native-search-paths search-paths)
587 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
592 ,@(package-arguments gcc))
593 ((#:configure-flags flags)
594 `(cons (string-append "--enable-languages="
595 ,(string-join languages ","))
596 (remove (cut string-match "--enable-languages.*" <>)
599 `(modify-phases ,phases
600 (add-after 'install 'remove-broken-or-conflicting-files
601 (lambda* (#:key outputs #:allow-other-keys)
602 (for-each delete-file
603 (find-files (string-append (assoc-ref outputs "out") "/bin")
604 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc.*)"))
607 (define %generic-search-paths
608 ;; This is the language-neutral search path for GCC. Entries in $CPATH are
609 ;; not considered "system headers", which means GCC can raise warnings for
610 ;; issues in those headers. 'CPATH' is the only one that works for
611 ;; front-ends not in the C family.
612 (list (search-path-specification
614 (files '("include")))
615 (search-path-specification
616 (variable "LIBRARY_PATH")
617 (files '("lib" "lib64")))))
619 (define-public gfortran-4.8
620 (custom-gcc gcc-4.8 "gfortran" '("fortran")
621 %generic-search-paths))
623 (define-public gfortran-4.9
624 (custom-gcc gcc-4.9 "gfortran" '("fortran")
625 %generic-search-paths))
627 (define-public gfortran-5
628 (custom-gcc gcc-5 "gfortran" '("fortran")
629 %generic-search-paths))
631 (define-public gfortran-6
632 (custom-gcc gcc-6 "gfortran" '("fortran")
633 %generic-search-paths))
635 (define-public gfortran-7
636 (custom-gcc gcc-7 "gfortran" '("fortran")
637 %generic-search-paths))
639 (define-public gfortran
640 ;; Note: Update this when GCC changes! We cannot use
641 ;; (custom-gcc gcc "fortran" …) because that would lead to a package object
642 ;; that is not 'eq?' with GFORTRAN-5, and thus 'fold-packages' would
643 ;; report two gfortran@5 that are in fact identical.
646 (define-public gccgo-4.9
647 (custom-gcc gcc-4.9 "gccgo" '("go")
648 %generic-search-paths
649 ;; Suppress the separate "lib" output, because otherwise the
650 ;; "lib" and "out" outputs would refer to each other, creating
651 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
652 #:separate-lib-output? #f))
654 (define-public gcc-objc-4.8
655 (custom-gcc gcc-4.8 "gcc-objc" '("objc")
656 (list (search-path-specification
657 (variable "OBJC_INCLUDE_PATH")
658 (files '("include")))
659 (search-path-specification
660 (variable "LIBRARY_PATH")
661 (files '("lib" "lib64"))))))
663 (define-public gcc-objc-4.9
664 (custom-gcc gcc-4.9 "gcc-objc" '("objc")
665 (list (search-path-specification
666 (variable "OBJC_INCLUDE_PATH")
667 (files '("include")))
668 (search-path-specification
669 (variable "LIBRARY_PATH")
670 (files '("lib" "lib64"))))))
672 (define-public gcc-objc-5
673 (custom-gcc gcc-5 "gcc-objc" '("objc")
674 (list (search-path-specification
675 (variable "OBJC_INCLUDE_PATH")
676 (files '("include")))
677 (search-path-specification
678 (variable "LIBRARY_PATH")
679 (files '("lib" "lib64"))))))
681 (define-public gcc-objc-6
682 (custom-gcc gcc-6 "gcc-objc" '("objc")
683 (list (search-path-specification
684 (variable "OBJC_INCLUDE_PATH")
685 (files '("include")))
686 (search-path-specification
687 (variable "LIBRARY_PATH")
688 (files '("lib" "lib64"))))))
690 (define-public gcc-objc-7
691 (custom-gcc gcc-7 "gcc-objc" '("objc")
692 (list (search-path-specification
693 (variable "OBJC_INCLUDE_PATH")
694 (files '("include")))
695 (search-path-specification
696 (variable "LIBRARY_PATH")
697 (files '("lib" "lib64"))))))
699 (define-public gcc-objc gcc-objc-5)
701 (define-public gcc-objc++-4.8
702 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
703 (list (search-path-specification
704 (variable "OBJCPLUS_INCLUDE_PATH")
705 (files '("include")))
706 (search-path-specification
707 (variable "LIBRARY_PATH")
708 (files '("lib" "lib64"))))))
710 (define-public gcc-objc++-4.9
711 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
712 (list (search-path-specification
713 (variable "OBJCPLUS_INCLUDE_PATH")
714 (files '("include")))
715 (search-path-specification
716 (variable "LIBRARY_PATH")
717 (files '("lib" "lib64"))))))
719 (define-public gcc-objc++-5
720 (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
721 (list (search-path-specification
722 (variable "OBJCPLUS_INCLUDE_PATH")
723 (files '("include")))
724 (search-path-specification
725 (variable "LIBRARY_PATH")
726 (files '("lib" "lib64"))))))
728 (define-public gcc-objc++-6
729 (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
730 (list (search-path-specification
731 (variable "OBJCPLUS_INCLUDE_PATH")
732 (files '("include")))
733 (search-path-specification
734 (variable "LIBRARY_PATH")
735 (files '("lib" "lib64"))))))
737 (define-public gcc-objc++-7
738 (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
739 (list (search-path-specification
740 (variable "OBJCPLUS_INCLUDE_PATH")
741 (files '("include")))
742 (search-path-specification
743 (variable "LIBRARY_PATH")
744 (files '("lib" "lib64"))))))
746 (define-public gcc-objc++ gcc-objc++-5)
748 (define (make-libstdc++-doc gcc)
749 "Return a package with the libstdc++ documentation for GCC."
752 (name "libstdc++-doc")
753 (version (package-version gcc))
754 (synopsis "GNU libstdc++ documentation")
756 (native-inputs `(("doxygen" ,doxygen)
760 ("docbook-xml" ,docbook-xml)
761 ("docbook-xsl" ,docbook-xsl)
762 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
764 (propagated-inputs '())
766 '(#:out-of-source? #t
767 #:tests? #f ;it's just documentation
768 #:phases (modify-phases %standard-phases
769 (add-before 'configure 'chdir
771 (chdir "libstdc++-v3")))
772 (add-before 'configure 'set-xsl-directory
773 (lambda* (#:key inputs #:allow-other-keys)
774 (let ((docbook (assoc-ref inputs "docbook-xsl")))
775 (substitute* (find-files "doc"
780 (strip-store-file-name docbook)))))))
783 ;; XXX: There's also a 'doc-info' target, but it
784 ;; relies on docbook2X, which itself relies on
785 ;; DocBook 4.1.2, which is not really usable
786 ;; (lacks a catalog.xml.)
787 (zero? (system* "make"
791 (lambda* (#:key outputs #:allow-other-keys)
792 (let ((out (assoc-ref outputs "out")))
793 (zero? (system* "make"
795 "doc-install-man"))))))))))
797 (define-public libstdc++-doc-4.9
798 (make-libstdc++-doc gcc-4.9))
800 (define-public libstdc++-doc-5
801 (make-libstdc++-doc gcc-5))
809 (uri (list (string-append
810 "http://isl.gforge.inria.fr/isl-"
813 (string-append %gcc-infrastructure
814 name "-" version ".tar.gz")))
817 "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))
818 (build-system gnu-build-system)
819 (inputs `(("gmp" ,gmp)))
820 (home-page "http://isl.gforge.inria.fr/")
822 "Manipulating sets and relations of integer points \
823 bounded by linear constraints")
825 "isl is a library for manipulating sets and relations of integer points
826 bounded by linear constraints. Supported operations on sets include
827 intersection, union, set difference, emptiness check, convex hull, (integer)
828 affine hull, integer projection, computing the lexicographic minimum using
829 parametric integer programming, coalescing and parametric vertex
830 enumeration. It also includes an ILP solver based on generalized basis
831 reduction, transitive closures on maps (which may encode infinite graphs),
832 dependence analysis and bounds on piecewise step-polynomials.")
835 (define-public isl-0.11
842 (uri (list (string-append
843 "http://isl.gforge.inria.fr/isl-"
846 (string-append %gcc-infrastructure
847 name "-" version ".tar.gz")))
850 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
851 (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))))
860 (uri (list (string-append
861 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
864 (string-append %gcc-infrastructure
865 name "-" version ".tar.gz")))
868 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
869 (file-name (string-append name "-" version ".tar.gz"))))
870 (build-system gnu-build-system)
871 (inputs `(("gmp" ,gmp)
873 (arguments '(#:configure-flags '("--with-isl=system")))
874 (home-page "http://www.cloog.org/")
875 (synopsis "Library to generate code for scanning Z-polyhedra")
877 "CLooG is a free software library to generate code for scanning
878 Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
879 reaches each integral point of one or more parameterized polyhedra.
880 CLooG has been originally written to solve the code generation problem
881 for optimizing compilers based on the polytope model. Nevertheless it
882 is used now in various area e.g., to build control automata for
883 high-level synthesis or to find the best polynomial approximation of a
884 function. CLooG may help in any situation where scanning polyhedra
885 matters. While the user has full control on generated code quality,
886 CLooG is designed to avoid control overhead and to produce a very
890 (define-public gnu-c-manual
892 (name "gnu-c-manual")
896 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
900 "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
901 (build-system gnu-build-system)
902 (native-inputs `(("texinfo" ,texinfo)))
904 '(#:phases (modify-phases %standard-phases
909 (zero? (system* "make"
911 "gnu-c-manual.html"))))
913 (lambda* (#:key outputs #:allow-other-keys)
914 (let* ((out (assoc-ref outputs "out"))
915 (info (string-append out "/share/info"))
917 out "/share/doc/gnu-c-manual")))
921 (for-each (lambda (file)
923 (string-append info "/"
925 (find-files "." "\\.info(-[0-9])?$"))
926 (for-each (lambda (file)
928 (string-append html "/"
930 (find-files "." "\\.html$"))
932 (synopsis "Reference manual for the C programming language")
934 "This is a reference manual for the C programming language, as
935 implemented by the GNU C Compiler (gcc). As a reference, it is not intended
936 to be a tutorial of the language. Rather, it outlines all of the constructs
937 of the language. Library functions are not included.")
938 (home-page "https://www.gnu.org/software/gnu-c-manual/")