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>
9 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages gcc)
27 #:use-module ((guix licenses)
28 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
29 #:use-module (gnu packages)
30 #:use-module (gnu packages bootstrap)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages multiprecision)
33 #:use-module (gnu packages texinfo)
34 #:use-module (gnu packages dejagnu)
35 #:use-module (gnu packages documentation)
36 #:use-module (gnu packages xml)
37 #:use-module (gnu packages docbook)
38 #:use-module (gnu packages graphviz)
39 #:use-module (gnu packages elf)
40 #:use-module (gnu packages perl)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system trivial)
45 #:use-module (guix utils)
46 #:use-module (srfi srfi-1)
47 #:use-module (ice-9 regex))
49 (define %gcc-infrastructure
50 ;; Base URL for GCC's infrastructure.
51 "mirror://gcc/infrastructure/")
53 (define (gcc-configure-flags-for-triplet target)
54 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
56 The purpose of this procedure is to translate extended GNU triplets---e.g.,
57 where the OS part is overloaded to denote a specific ABI---into GCC
58 `configure' options. We take extended GNU triplets that glibc recognizes."
59 (cond ((string-match "^mips64el.*gnuabin?64$" target)
60 ;; Triplets recognized by glibc as denoting the N64 ABI; see
61 ;; ports/sysdeps/mips/preconfigure.
64 ((string-match "^arm.*-gnueabihf$" target)
65 '("--with-arch=armv7-a"
70 ((and (string-suffix? "-gnu" target)
71 (not (string-contains target "-linux")))
72 ;; Cross-compilation of libcilkrts in GCC 5.5.0 to GNU/Hurd fails
74 ;; libcilkrts/runtime/os-unix.c:388:2: error: #error "Unknown architecture"
75 ;; Cilk has been removed from GCC 8 anyway.
76 '("--disable-libcilkrts"))
79 ;; TODO: Add `arm.*-gnueabi', etc.
82 (define-public gcc-4.7
83 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
86 ;; Return the `_FOR_TARGET' variables that are needed when
87 ;; cross-compiling GCC.
88 (let ((target (%current-target-system)))
90 (map (lambda (var tool)
91 (string-append (string-append var "_FOR_TARGET")
93 '("CC" "CXX" "LD" "AR" "NM" "OBJDUMP" "RANLIB" "STRIP")
94 '("gcc" "g++" "ld" "ar" "nm" "objdump" "ranlib" "strip"))
97 (let ((base '(or (assoc-ref outputs "lib")
98 (assoc-ref outputs "out"))))
100 ;; Return the directory that contains lib/libgcc_s.so et al.
101 (if (%current-target-system)
102 `(string-append ,base "/" ,(%current-target-system))
106 ;; This is terrible. Since we have two levels of quasiquotation,
107 ;; we have to do this convoluted thing just so we can insert the
108 ;; contents of (maybe-target-tools).
112 "--enable-languages=c,c++"
116 ;; No pre-compiled libstdc++ headers, to save space.
117 "--disable-libstdcxx-pch"
119 "--with-local-prefix=/no-gcc-local-prefix"
121 ;; With a separate "lib" output, the build system
122 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
123 ;; it. (Don't use a versioned sub-directory, that's
125 ,(string-append "--with-gxx-include-dir="
126 (assoc-ref %outputs "out")
129 ,(let ((libc (assoc-ref %build-inputs "libc")))
131 (string-append "--with-native-system-header-dir=" libc
133 "--without-headers")))
135 ;; Pass the right options for the target triplet.
137 (or (%current-target-system)
138 (nix-system->gnu-triplet (%current-system)))))
139 (gcc-configure-flags-for-triplet triplet))
141 (maybe-target-tools))))))
147 (uri (string-append "mirror://gnu/gcc/gcc-"
148 version "/gcc-" version ".tar.bz2"))
151 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
152 (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
153 "gcc-fix-texi2pod.patch"))))
154 (build-system gnu-build-system)
156 ;; Separate out the run-time support libraries because all the
157 ;; dynamic-linked objects depend on it.
158 (outputs '("out" ;commands, etc. (60+ MiB)
159 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
160 "debug")) ;debug symbols of run-time libraries
162 (inputs `(("gmp" ,gmp)
168 ;; GCC < 5 is one of the few packages that doesn't ship .info files.
169 ;; Newer texinfos fail to build the manual, so we use an older one.
170 (native-inputs `(("perl" ,perl) ;for manpages
171 ("texinfo" ,texinfo-5)))
174 `(#:out-of-source? #t
175 #:configure-flags ,(configure-flags)
177 ;; None of the flags below are needed when doing a Canadian cross.
178 ;; TODO: Simplify this.
179 ,(if (%current-target-system)
183 `(let* ((libc (assoc-ref %build-inputs "libc"))
184 (libc-native (or (assoc-ref %build-inputs "libc-native")
187 (list (string-append "LDFLAGS_FOR_TARGET="
189 "-Wl,-dynamic-linker "
191 ,(glibc-dynamic-linker)))
194 ;; Native programs like 'genhooks' also need that right.
195 ,(string-append "LDFLAGS="
196 "-Wl,-rpath=" libc-native "/lib "
197 "-Wl,-dynamic-linker "
198 "-Wl," libc-native ,(glibc-dynamic-linker))
199 ,(string-append "BOOT_CFLAGS=-O2 "
200 ,(if stripped? "-g0" "-g")))))
205 (modify-phases %standard-phases
206 (add-before 'configure 'pre-configure
207 (lambda* (#:key inputs outputs #:allow-other-keys)
208 (let ((libdir ,(libdir))
209 (libc (assoc-ref inputs "libc")))
211 ;; The following is not performed for `--without-headers'
212 ;; cross-compiler builds.
214 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
215 ;; single line, to allow the next step to work properly.
218 (substitute* (find-files "gcc/config"
219 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
220 (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
224 ;; Fix the dynamic linker's file name.
225 (substitute* (find-files "gcc/config"
226 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
227 (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
229 (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
231 (string-append libc ,(glibc-dynamic-linker)))))
233 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
234 ;; `crt{begin,end}.o', which come with GCC.
235 (substitute* (find-files "gcc/config"
237 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
238 ;; Help libgcc_s.so be found (see also below.) Always use
239 ;; '-lgcc_s' so that libgcc_s.so is always found by those
240 ;; programs that use 'pthread_cancel' (glibc dlopens
241 ;; libgcc_s.so when pthread_cancel support is needed, but
242 ;; having it in the application's RUNPATH isn't enough; see
243 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
245 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
246 ;; later phase of %gcc-static. If you change the string
247 ;; below, make sure to update the relevant code in
248 ;; %gcc-static package as needed.
249 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
250 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
251 libc libc libdir suffix))
252 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
253 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
254 #define STANDARD_STARTFILE_PREFIX_2 \"\"
258 ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
259 ;; GNU_USER_* defines. Do the above for this case.
261 "gcc/config/rs6000/sysv4.h"
262 (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
263 (format #f "#define LIB_LINUX_SPEC \
264 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
265 libc libc libdir suffix))
266 (("#define STARTFILE_LINUX_SPEC.*$" line)
267 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
268 #define STANDARD_STARTFILE_PREFIX_2 \"\"
272 ;; Don't retain a dependency on the build-time sed.
273 (substitute* "fixincludes/fixincl.x"
274 (("static char const sed_cmd_z\\[\\] =.*;")
275 "static char const sed_cmd_z[] = \"sed\";"))
277 ;; Aarch64 support didn't land in GCC until the 4.8 series.
278 (when (file-exists? "gcc/config/aarch64")
279 ;; Force Aarch64 libdir to be /lib and not /lib64
280 (substitute* "gcc/config/aarch64/t-aarch64-linux"
283 (when (file-exists? "libbacktrace")
284 ;; GCC 4.8+ comes with libbacktrace. By default it builds
285 ;; with -Werror, which fails with a -Wcast-qual error in glibc
286 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
287 (substitute* "libbacktrace/configure"
288 (("WARN_FLAGS=(.*)-Werror" _ flags)
289 (string-append "WARN_FLAGS=" flags)))
291 (when (file-exists? "libsanitizer/libbacktrace")
292 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
293 (substitute* "libsanitizer/libbacktrace/Makefile.in"
297 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
298 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
299 ;; and <http://bugs.gnu.org/20358>.
300 (substitute* "libstdc++-v3/src/Makefile.in"
302 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
304 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
305 ;; circularity between "out" and "lib". (Note:
306 ;; --with-python-dir is useless because it imposes $(prefix) as
307 ;; the parent directory.)
308 (substitute* "libstdc++-v3/python/Makefile.in"
310 (string-append "pythondir = " libdir "/share"
311 "/gcc-$(gcc_version)/python\n")))
313 ;; Avoid another circularity between the outputs: this #define
314 ;; ends up in auto-host.h in the "lib" output, referring to
315 ;; "out". (This variable is used to augment cpp's search path,
316 ;; but there's nothing useful to look for here.)
317 (substitute* "gcc/config.in"
318 (("PREFIX_INCLUDE_DIR")
319 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
322 (add-after 'configure 'post-configure
324 ;; Don't store configure flags, to avoid retaining references to
325 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
326 (substitute* "Makefile"
327 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
328 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
332 ;; Use the language-specific variables rather than 'CPATH' because they
333 ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
334 ;; The intent is to allow headers that are in the search path to be
335 ;; treated as "system headers" (headers exempt from warnings) just like
336 ;; the typical /usr/include headers on an FHS system.
337 (list (search-path-specification
338 (variable "C_INCLUDE_PATH")
339 (files '("include")))
340 (search-path-specification
341 (variable "CPLUS_INCLUDE_PATH")
342 (files '("include")))
343 (search-path-specification
344 (variable "LIBRARY_PATH")
345 (files '("lib" "lib64")))))
347 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
348 (synopsis "GNU Compiler Collection")
350 "GCC is the GNU Compiler Collection. It provides compiler front-ends
351 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
352 Go. It also includes runtime support libraries for these languages.")
354 (supported-systems (delete "aarch64-linux" %supported-systems))
355 (home-page "https://gcc.gnu.org/"))))
357 (define-public gcc-4.8
358 (package (inherit gcc-4.7)
362 (uri (string-append "mirror://gnu/gcc/gcc-"
363 version "/gcc-" version ".tar.bz2"))
366 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
367 (patches (search-patches "gcc-arm-link-spec-fix.patch"
368 "gcc-4.8-libsanitizer-fix.patch"
369 "gcc-asan-missing-include.patch"
370 "gcc-fix-texi2pod.patch"))
371 (modules '((guix build utils)))
372 ;; This is required for building with glibc-2.26.
373 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
378 (substitute* (string-append "libgcc/config/"
379 dir "/linux-unwind.h")
380 (("struct ucontext") "ucontext_t")))
381 '("aarch64" "alpha" "bfin" "i386" "m68k"
382 "pa" "sh" "tilepro" "xtensa"))
384 (supported-systems %supported-systems)
388 ,@(package-inputs gcc-4.7)))))
390 (define-public gcc-4.9
391 (package (inherit gcc-4.8)
395 (uri (string-append "mirror://gnu/gcc/gcc-"
396 version "/gcc-" version ".tar.bz2"))
399 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
400 (patches (search-patches "gcc-4.9-libsanitizer-fix.patch"
401 "gcc-4.9-libsanitizer-ustat.patch"
402 "gcc-arm-bug-71399.patch"
403 "gcc-asan-missing-include.patch"
404 "gcc-libvtv-runpath.patch"
405 "gcc-fix-texi2pod.patch"))
406 (modules '((guix build utils)))
407 ;; This is required for building with glibc-2.26.
408 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
413 (substitute* (string-append "libgcc/config/"
414 dir "/linux-unwind.h")
415 (("struct ucontext") "ucontext_t")))
416 '("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
417 "pa" "sh" "tilepro" "xtensa"))
419 ;; Override inherited texinfo-5 with latest version.
420 (native-inputs `(("perl" ,perl) ;for manpages
421 ("texinfo" ,texinfo)))))
424 ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
425 ;; them in a VPATH build.
426 (package (inherit gcc-4.9)
430 (uri (string-append "mirror://gnu/gcc/gcc-"
431 version "/gcc-" version ".tar.xz"))
434 "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k"))
435 (patches (search-patches "gcc-arm-bug-71399.patch"
436 "gcc-libsanitizer-ustat.patch"
437 "gcc-strmov-store-file-names.patch"
438 "gcc-5.0-libvtv-runpath.patch"
439 "gcc-5-source-date-epoch-1.patch"
440 "gcc-5-source-date-epoch-2.patch"
441 "gcc-fix-texi2pod.patch"))
442 (modules '((guix build utils)))
444 ;; Fix 'libcc1/configure' error when cross-compiling GCC.
445 ;; Without that, 'libcc1/configure' wrongfully determines that
446 ;; '-rdynamic' support is missing because $gcc_cv_objdump is
449 ;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67590
450 ;; http://cgit.openembedded.org/openembedded-core/commit/?id=f6e47aa9b12f9ab61530c40e0343f451699d9077
452 (substitute* "libcc1/configure"
453 (("\\$gcc_cv_objdump -T")
454 "$OBJDUMP_FOR_TARGET -T"))
457 `(;; GCC5 needs <isl/band.h> which is removed in later versions.
459 ,@(package-inputs gcc-4.7)))))
467 (uri (string-append "mirror://gnu/gcc/gcc-"
468 version "/gcc-" version ".tar.xz"))
471 "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby"))
472 (patches (search-patches "gcc-strmov-store-file-names.patch"
473 "gcc-6-source-date-epoch-1.patch"
474 "gcc-6-source-date-epoch-2.patch"
475 "gcc-5.0-libvtv-runpath.patch"))))
478 ,@(package-inputs gcc-4.7)))
481 ;; We have to use 'CPATH' for GCC > 5, not 'C_INCLUDE_PATH' & co., due to
482 ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129>.
483 (list (search-path-specification
485 (files '("include")))
486 (search-path-specification
487 (variable "LIBRARY_PATH")
488 (files '("lib" "lib64")))))))
496 (uri (string-append "mirror://gnu/gcc/gcc-"
497 version "/gcc-" version ".tar.xz"))
500 "0lgy170b0pp60j9cczqkmaqyjjb584vfamj4c30swd7k0j6y5pgd"))
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.")))
514 (uri (string-append "mirror://gnu/gcc/gcc-"
515 version "/gcc-" version ".tar.xz"))
518 "10007smilswiiv2ymazr3b6x2i933c0ycxrr529zh4r6p823qv0r"))
519 (patches (search-patches "gcc-8-strmov-store-file-names.patch"
520 "gcc-5.0-libvtv-runpath.patch"))))))
522 ;; Note: When changing the default gcc version, update
523 ;; the gcc-toolchain-* definitions and the gfortran definition
525 (define-public gcc gcc-5)
527 (define-public (make-libstdc++ gcc)
528 "Return a libstdc++ package based on GCC. The primary use case is when
529 using compilers other than GCC."
534 `(#:out-of-source? #t
535 #:phases (alist-cons-before
538 (chdir "libstdc++-v3")
541 #:configure-flags `("--disable-libstdcxx-pch"
542 ,(string-append "--with-gxx-include-dir="
543 (assoc-ref %outputs "out")
545 (outputs '("out" "debug"))
548 (propagated-inputs '())
549 (synopsis "GNU C++ standard library")))
551 (define-public libstdc++-4.9
552 (make-libstdc++ gcc-4.9))
554 (define (make-libiberty gcc)
555 "Return a libiberty package based on GCC."
560 `(#:out-of-source? #t
562 (modify-phases %standard-phases
563 (add-before 'configure 'chdir
569 (lambda* (#:key outputs #:allow-other-keys)
570 (let* ((out (assoc-ref outputs "out"))
571 (lib (string-append out "/lib/"))
572 (include (string-append out "/include/")))
575 (copy-file "libiberty.a"
576 (string-append lib "libiberty.a"))
577 (copy-file "../include/libiberty.h"
578 (string-append include "libiberty.h"))
583 (propagated-inputs '())
584 (synopsis "Collection of subroutines used by various GNU programs")))
586 (define-public libiberty
587 (make-libiberty gcc))
589 (define* (custom-gcc gcc name languages
591 (search-paths (package-native-search-paths gcc))
592 #:key (separate-lib-output? #t))
593 "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
594 as the 'native-search-paths' field."
595 (package (inherit gcc)
597 (outputs (if separate-lib-output?
598 (package-outputs gcc)
599 (delete "lib" (package-outputs gcc))))
600 (native-search-paths search-paths)
602 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
607 ,@(package-arguments gcc))
608 ((#:configure-flags flags)
609 `(cons (string-append "--enable-languages="
610 ,(string-join languages ","))
611 (remove (cut string-match "--enable-languages.*" <>)
614 `(modify-phases ,phases
615 (add-after 'install 'remove-broken-or-conflicting-files
616 (lambda* (#:key outputs #:allow-other-keys)
617 (for-each delete-file
618 (find-files (string-append (assoc-ref outputs "out") "/bin")
619 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
622 (define %generic-search-paths
623 ;; This is the language-neutral search path for GCC. Entries in $CPATH are
624 ;; not considered "system headers", which means GCC can raise warnings for
625 ;; issues in those headers. 'CPATH' is the only one that works for
626 ;; front-ends not in the C family.
627 (list (search-path-specification
629 (files '("include")))
630 (search-path-specification
631 (variable "LIBRARY_PATH")
632 (files '("lib" "lib64")))))
634 (define-public gfortran-4.8
635 (custom-gcc gcc-4.8 "gfortran" '("fortran")
636 %generic-search-paths))
638 (define-public gfortran-4.9
639 (custom-gcc gcc-4.9 "gfortran" '("fortran")
640 %generic-search-paths))
642 (define-public gfortran-5
643 (custom-gcc gcc-5 "gfortran" '("fortran")
644 %generic-search-paths))
646 (define-public gfortran-6
647 (custom-gcc gcc-6 "gfortran" '("fortran")
648 %generic-search-paths))
650 (define-public gfortran-7
651 (custom-gcc gcc-7 "gfortran" '("fortran")
652 %generic-search-paths))
654 (define-public gfortran-8
655 (custom-gcc gcc-8 "gfortran" '("fortran")
656 %generic-search-paths))
658 (define-public gfortran
659 ;; Note: Update this when GCC changes! We cannot use
660 ;; (custom-gcc gcc "fortran" …) because that would lead to a package object
661 ;; that is not 'eq?' with GFORTRAN-5, and thus 'fold-packages' would
662 ;; report two gfortran@5 that are in fact identical.
665 (define-public gccgo-4.9
666 (custom-gcc gcc-4.9 "gccgo" '("go")
667 %generic-search-paths
668 ;; Suppress the separate "lib" output, because otherwise the
669 ;; "lib" and "out" outputs would refer to each other, creating
670 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
671 #:separate-lib-output? #f))
673 (define-public gcc-objc-4.8
674 (custom-gcc gcc-4.8 "gcc-objc" '("objc")
675 (list (search-path-specification
676 (variable "OBJC_INCLUDE_PATH")
677 (files '("include")))
678 (search-path-specification
679 (variable "LIBRARY_PATH")
680 (files '("lib" "lib64"))))))
682 (define-public gcc-objc-4.9
683 (custom-gcc gcc-4.9 "gcc-objc" '("objc")
684 (list (search-path-specification
685 (variable "OBJC_INCLUDE_PATH")
686 (files '("include")))
687 (search-path-specification
688 (variable "LIBRARY_PATH")
689 (files '("lib" "lib64"))))))
691 (define-public gcc-objc-5
692 (custom-gcc gcc-5 "gcc-objc" '("objc")
693 (list (search-path-specification
694 (variable "OBJC_INCLUDE_PATH")
695 (files '("include")))
696 (search-path-specification
697 (variable "LIBRARY_PATH")
698 (files '("lib" "lib64"))))))
700 (define-public gcc-objc-6
701 (custom-gcc gcc-6 "gcc-objc" '("objc")
702 (list (search-path-specification
703 (variable "OBJC_INCLUDE_PATH")
704 (files '("include")))
705 (search-path-specification
706 (variable "LIBRARY_PATH")
707 (files '("lib" "lib64"))))))
709 (define-public gcc-objc-7
710 (custom-gcc gcc-7 "gcc-objc" '("objc")
711 (list (search-path-specification
712 (variable "OBJC_INCLUDE_PATH")
713 (files '("include")))
714 (search-path-specification
715 (variable "LIBRARY_PATH")
716 (files '("lib" "lib64"))))))
718 (define-public gcc-objc-8
719 (custom-gcc gcc-8 "gcc-objc" '("objc")
720 (list (search-path-specification
721 (variable "OBJC_INCLUDE_PATH")
722 (files '("include")))
723 (search-path-specification
724 (variable "LIBRARY_PATH")
725 (files '("lib" "lib64"))))))
727 (define-public gcc-objc gcc-objc-5)
729 (define-public gcc-objc++-4.8
730 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
731 (list (search-path-specification
732 (variable "OBJCPLUS_INCLUDE_PATH")
733 (files '("include")))
734 (search-path-specification
735 (variable "LIBRARY_PATH")
736 (files '("lib" "lib64"))))))
738 (define-public gcc-objc++-4.9
739 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
740 (list (search-path-specification
741 (variable "OBJCPLUS_INCLUDE_PATH")
742 (files '("include")))
743 (search-path-specification
744 (variable "LIBRARY_PATH")
745 (files '("lib" "lib64"))))))
747 (define-public gcc-objc++-5
748 (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
749 (list (search-path-specification
750 (variable "OBJCPLUS_INCLUDE_PATH")
751 (files '("include")))
752 (search-path-specification
753 (variable "LIBRARY_PATH")
754 (files '("lib" "lib64"))))))
756 (define-public gcc-objc++-6
757 (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
758 (list (search-path-specification
759 (variable "OBJCPLUS_INCLUDE_PATH")
760 (files '("include")))
761 (search-path-specification
762 (variable "LIBRARY_PATH")
763 (files '("lib" "lib64"))))))
765 (define-public gcc-objc++-7
766 (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
767 (list (search-path-specification
768 (variable "OBJCPLUS_INCLUDE_PATH")
769 (files '("include")))
770 (search-path-specification
771 (variable "LIBRARY_PATH")
772 (files '("lib" "lib64"))))))
774 (define-public gcc-objc++-8
775 (custom-gcc gcc-8 "gcc-objc++" '("obj-c++")
776 (list (search-path-specification
777 (variable "OBJCPLUS_INCLUDE_PATH")
778 (files '("include")))
779 (search-path-specification
780 (variable "LIBRARY_PATH")
781 (files '("lib" "lib64"))))))
783 (define-public gcc-objc++ gcc-objc++-5)
785 (define (make-libstdc++-doc gcc)
786 "Return a package with the libstdc++ documentation for GCC."
789 (name "libstdc++-doc")
790 (version (package-version gcc))
791 (synopsis "GNU libstdc++ documentation")
793 (native-inputs `(("doxygen" ,doxygen)
797 ("docbook-xml" ,docbook-xml)
798 ("docbook-xsl" ,docbook-xsl)
799 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
801 (propagated-inputs '())
803 '(#:out-of-source? #t
804 #:tests? #f ;it's just documentation
805 #:phases (modify-phases %standard-phases
806 (add-before 'configure 'chdir
808 (chdir "libstdc++-v3")
810 (add-before 'configure 'set-xsl-directory
811 (lambda* (#:key inputs #:allow-other-keys)
812 (let ((docbook (assoc-ref inputs "docbook-xsl")))
813 (substitute* (find-files "doc"
818 (strip-store-file-name docbook))))
822 ;; XXX: There's also a 'doc-info' target, but it
823 ;; relies on docbook2X, which itself relies on
824 ;; DocBook 4.1.2, which is not really usable
825 ;; (lacks a catalog.xml.)
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let ((out (assoc-ref outputs "out")))
834 "doc-install-man")))))))))
836 (define-public libstdc++-doc-4.9
837 (make-libstdc++-doc gcc-4.9))
839 (define-public libstdc++-doc-5
840 (make-libstdc++-doc gcc-5))
848 (uri (list (string-append
849 "http://isl.gforge.inria.fr/isl-"
852 (string-append %gcc-infrastructure
853 name "-" version ".tar.gz")))
856 "1n4yz9rj24mv226hqbpw210ifvqkn8dgvpnkzf0s0lkq9zrjd5ym"))))
857 (build-system gnu-build-system)
858 (inputs `(("gmp" ,gmp)))
859 (home-page "http://isl.gforge.inria.fr/")
861 "Manipulating sets and relations of integer points \
862 bounded by linear constraints")
864 "isl is a library for manipulating sets and relations of integer points
865 bounded by linear constraints. Supported operations on sets include
866 intersection, union, set difference, emptiness check, convex hull, (integer)
867 affine hull, integer projection, computing the lexicographic minimum using
868 parametric integer programming, coalescing and parametric vertex
869 enumeration. It also includes an ILP solver based on generalized basis
870 reduction, transitive closures on maps (which may encode infinite graphs),
871 dependence analysis and bounds on piecewise step-polynomials.")
874 (define-public isl-0.18
880 (uri (list (string-append "http://isl.gforge.inria.fr/isl-"
882 (string-append %gcc-infrastructure
883 "isl-" version ".tar.gz")))
886 "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))))
888 (define-public isl-0.11
895 (uri (list (string-append
896 "http://isl.gforge.inria.fr/isl-"
899 (string-append %gcc-infrastructure
900 name "-" version ".tar.gz")))
903 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
904 (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))))
913 (uri (list (string-append
914 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
917 (string-append %gcc-infrastructure
918 name "-" version ".tar.gz")))
921 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
922 (file-name (string-append name "-" version ".tar.gz"))))
923 (build-system gnu-build-system)
924 (inputs `(("gmp" ,gmp)
926 (arguments '(#:configure-flags '("--with-isl=system")))
927 (home-page "http://www.cloog.org/")
928 (synopsis "Library to generate code for scanning Z-polyhedra")
930 "CLooG is a free software library to generate code for scanning
931 Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
932 reaches each integral point of one or more parameterized polyhedra.
933 CLooG has been originally written to solve the code generation problem
934 for optimizing compilers based on the polytope model. Nevertheless it
935 is used now in various area e.g., to build control automata for
936 high-level synthesis or to find the best polynomial approximation of a
937 function. CLooG may help in any situation where scanning polyhedra
938 matters. While the user has full control on generated code quality,
939 CLooG is designed to avoid control overhead and to produce a very
943 (define-public gnu-c-manual
945 (name "gnu-c-manual")
949 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
953 "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
954 (build-system gnu-build-system)
955 (native-inputs `(("texinfo" ,texinfo)))
957 '(#:phases (modify-phases %standard-phases
964 "gnu-c-manual.html")))
966 (lambda* (#:key outputs #:allow-other-keys)
967 (let* ((out (assoc-ref outputs "out"))
968 (info (string-append out "/share/info"))
970 out "/share/doc/gnu-c-manual")))
974 (for-each (lambda (file)
976 (string-append info "/"
978 (find-files "." "\\.info(-[0-9])?$"))
979 (for-each (lambda (file)
981 (string-append html "/"
983 (find-files "." "\\.html$"))
985 (synopsis "Reference manual for the C programming language")
987 "This is a reference manual for the C programming language, as
988 implemented by the GNU C Compiler (gcc). As a reference, it is not intended
989 to be a tutorial of the language. Rather, it outlines all of the constructs
990 of the language. Library functions are not included.")
991 (home-page "https://www.gnu.org/software/gnu-c-manual/")