X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/c6d02bcf1bcc06c70e440221e317274926c0fce3..e0f983c0d55e301fc646d956039cc425ad18076d:/gnu/packages/gcc.scm diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6221a123d8..a412c93c29 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -3,12 +3,14 @@ ;;; Copyright © 2014, 2015, 2018 Mark H Weaver ;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus ;;; Copyright © 2015 Andreas Enge -;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner +;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Efraim Flashner ;;; Copyright © 2016 Carlos Sánchez de La Lama ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2020 Marius Bakke ;;; Copyright © 2020 Joseph LaFreniere ;;; Copyright © 2020 Guy Fleury Iteriteka +;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; @@ -272,6 +274,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC ~a" libc line)))) + ;; TODO: Make this unconditional in core-updates. + ,@(if (target-powerpc?) + `((when (file-exists? "gcc/config/rs6000") + ;; Force powerpc libdir to be /lib and not /lib64 + (substitute* (find-files "gcc/config/rs6000") + (("/lib64") "/lib")))) + `()) + ;; Don't retain a dependency on the build-time sed. (substitute* "fixincludes/fixincl.x" (("static char const sed_cmd_z\\[\\] =.*;") @@ -514,6 +524,12 @@ Go. It also includes runtime support libraries for these languages.") (inputs `(("isl" ,isl) + + ;; XXX: This gross hack allows us to have libstdc++'s + ;; in the search path, thereby avoiding misconfiguration of libstdc++: + ;; . + ("libstdc++" ,libstdc++-headers) + ,@(package-inputs gcc-4.7))))) (define-public gcc-7 @@ -547,7 +563,6 @@ It also includes runtime support libraries for these languages."))) (base32 "1m1d3gfix56w4aq8myazzfffkl8bqcrx4jhhapnjf7qfs596w2p3")) (patches (search-patches "gcc-8-strmov-store-file-names.patch" - "gcc-8-libsanitizer-mode-size.patch" "gcc-5.0-libvtv-runpath.patch")))))) (define-public gcc-9 @@ -565,9 +580,22 @@ It also includes runtime support libraries for these languages."))) "gcc-9-asan-fix-limits-include.patch" "gcc-5.0-libvtv-runpath.patch")))))) +(define-public gcc-10 + (package + (inherit gcc-8) + (version "10.3.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gcc/gcc-" + version "/gcc-" version ".tar.xz")) + (sha256 + (base32 + "0i6378ig6h397zkhd7m4ccwjx5alvzrf2hm27p1pzwjhlv0h9x34")) + (patches (search-patches "gcc-9-strmov-store-file-names.patch" + "gcc-5.0-libvtv-runpath.patch")))))) + ;; Note: When changing the default gcc version, update -;; the gcc-toolchain-* definitions and the gfortran definition -;; accordingly. +;; the gcc-toolchain-* definitions. (define-public gcc gcc-7) (define-public (make-libstdc++ gcc) @@ -578,12 +606,27 @@ using compilers other than GCC." (name "libstdc++") (arguments `(#:out-of-source? #t - #:phases (alist-cons-before - 'configure 'chdir - (lambda _ - (chdir "libstdc++-v3") - #t) - %standard-phases) + #:phases + ;; TODO: Use the target-powerpc arm for everyone. + ,(if (target-powerpc?) + `(modify-phases %standard-phases + ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64. + (add-before 'chdir 'fix-rs6000-libdir + (lambda _ + (when (file-exists? "gcc/config/rs6000") + (substitute* (find-files "gcc/config/rs6000") + (("/lib64") "/lib"))) + #t)) + (add-before 'configure 'chdir + (lambda _ + (chdir "libstdc++-v3") + #t))) + `(alist-cons-before 'configure 'chdir + (lambda _ + (chdir "libstdc++-v3") + #t) + %standard-phases)) + #:configure-flags `("--disable-libstdcxx-pch" ,(string-append "--with-gxx-include-dir=" (assoc-ref %outputs "out") @@ -594,6 +637,31 @@ using compilers other than GCC." (propagated-inputs '()) (synopsis "GNU C++ standard library"))) +(define libstdc++ + ;; Libstdc++ matching the default GCC. + (make-libstdc++ gcc)) + +(define libstdc++-headers + ;; XXX: This package is for internal use to work around + ;; (see above). The main difference compared + ;; to the libstdc++ headers that come with 'gcc' is that + ;; is right under include/c++ and not under + ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR). + (package + (inherit libstdc++) + (name "libstdc++-headers") + (outputs '("out")) + (build-system trivial-build-system) + (arguments + '(#:builder (let* ((out (assoc-ref %outputs "out")) + (libstdc++ (assoc-ref %build-inputs "libstdc++"))) + (mkdir out) + (mkdir (string-append out "/include")) + (symlink (string-append libstdc++ "/include") + (string-append out "/include/c++"))))) + (inputs `(("libstdc++" ,libstdc++))) + (synopsis "Headers of GNU libstdc++"))) + (define-public libstdc++-4.9 (make-libstdc++ gcc-4.9)) @@ -642,12 +710,12 @@ as the 'native-search-paths' field." (native-search-paths search-paths) (properties (alist-delete 'hidden? (package-properties gcc))) (arguments - (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system) - (guix build utils) - (ice-9 regex) - (srfi srfi-1) - (srfi srfi-26)) - ,@(package-arguments gcc)) + (substitute-keyword-arguments (package-arguments gcc) + ((#:modules modules %gnu-build-system-modules) + `(,@modules + (srfi srfi-1) + (srfi srfi-26) + (ice-9 regex))) ((#:configure-flags flags) `(cons (string-append "--enable-languages=" ,(string-join languages ",")) @@ -674,48 +742,22 @@ as the 'native-search-paths' field." (variable "LIBRARY_PATH") (files '("lib" "lib64"))))) -(define-public gfortran-4.8 - (hidden-package - (custom-gcc gcc-4.8 "gfortran" '("fortran") - %generic-search-paths))) - -(define-public gfortran-4.9 - (hidden-package - (custom-gcc gcc-4.9 "gfortran" '("fortran") - %generic-search-paths))) - -(define-public gfortran-5 - (hidden-package - (custom-gcc gcc-5 "gfortran" '("fortran") - %generic-search-paths))) - -(define-public gfortran-6 - (hidden-package - (custom-gcc gcc-6 "gfortran" '("fortran") - %generic-search-paths))) - -(define-public gfortran-7 - (hidden-package - (custom-gcc gcc-7 "gfortran" '("fortran") - %generic-search-paths))) - -(define-public gfortran-8 +(define-public gfortran (hidden-package - (custom-gcc gcc-8 "gfortran" '("fortran") + (custom-gcc (package + (inherit gcc) + ;; XXX: Remove LIBSTDC++-HEADERS from the inputs just to + ;; avoid a rebuild of all the GFORTRAN dependents. + ;; TODO: Remove this hack on the next rebuild cycle. + (inputs (alist-delete "libstdc++" (package-inputs gcc)))) + "gfortran" '("fortran") %generic-search-paths))) -(define-public gfortran-9 +(define-public gdc-10 (hidden-package - (custom-gcc gcc-9 "gfortran" '("fortran") + (custom-gcc gcc-10 "gdc" '("d") %generic-search-paths))) -(define-public gfortran - ;; Note: Update this when GCC changes! We cannot use - ;; (custom-gcc gcc "fortran" …) because that would lead to a package object - ;; that is not 'eq?' with GFORTRAN-5, and thus 'fold-packages' would - ;; report two gfortran@5 that are in fact identical. - gfortran-7) - (define-public libgccjit (package (inherit gcc-9) @@ -741,126 +783,113 @@ as the 'native-search-paths' field." (for-each delete-file (find-files (string-append (assoc-ref outputs "out") "/bin") ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)")) - #t)))))))) + #t)))))) + (synopsis "GCC library generating machine code on-the-fly at runtime") + (description + "This package is part of the GNU Compiler Collection and provides an +embeddable library for generating machine code on-the-fly at runtime. This +shared library can then be dynamically-linked into bytecode interpreters and +other such programs that want to generate machine code on-the-fly at run-time. +It can also be used for ahead-of-time code generation for building standalone +compilers. The just-in-time (jit) part of the name is now something of a +misnomer."))) (define-public gccgo-4.9 - (custom-gcc gcc-4.9 "gccgo" '("go") + (custom-gcc (package + (inherit gcc-4.9) + (synopsis "Go frontend to GCC") + (description + "This package is part of the GNU Compiler Collection and +provides the GNU compiler for the Go programming language.")) + "gccgo" '("go") %generic-search-paths ;; Suppress the separate "lib" output, because otherwise the ;; "lib" and "out" outputs would refer to each other, creating ;; a cyclic dependency. #:separate-lib-output? #f)) +(define %objc-search-paths + (list (search-path-specification + (variable "OBJC_INCLUDE_PATH") + (files '("include"))) + (search-path-specification + (variable "LIBRARY_PATH") + (files '("lib" "lib64"))))) + (define-public gcc-objc-4.8 (custom-gcc gcc-4.8 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) (define-public gcc-objc-4.9 (custom-gcc gcc-4.9 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) (define-public gcc-objc-5 (custom-gcc gcc-5 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) (define-public gcc-objc-6 (custom-gcc gcc-6 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) (define-public gcc-objc-7 (custom-gcc gcc-7 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) (define-public gcc-objc-8 (custom-gcc gcc-8 "gcc-objc" '("objc") - (list (search-path-specification - (variable "OBJC_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc-search-paths)) + +(define-public gcc-objc-9 + (custom-gcc gcc-9 "gcc-objc" '("objc") + %objc-search-paths)) + +(define-public gcc-objc-10 + (custom-gcc gcc-10 "gcc-objc" '("objc") + %objc-search-paths)) (define-public gcc-objc gcc-objc-7) +(define %objc++-search-paths + (list (search-path-specification + (variable "OBJCPLUS_INCLUDE_PATH") + (files '("include"))) + (search-path-specification + (variable "LIBRARY_PATH") + (files '("lib" "lib64"))))) + (define-public gcc-objc++-4.8 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) (define-public gcc-objc++-4.9 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) (define-public gcc-objc++-5 (custom-gcc gcc-5 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) (define-public gcc-objc++-6 (custom-gcc gcc-6 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) (define-public gcc-objc++-7 (custom-gcc gcc-7 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) (define-public gcc-objc++-8 (custom-gcc gcc-8 "gcc-objc++" '("obj-c++") - (list (search-path-specification - (variable "OBJCPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64")))))) + %objc++-search-paths)) + +(define-public gcc-objc++-9 + (custom-gcc gcc-9 "gcc-objc++" '("obj-c++") + %objc++-search-paths)) + +(define-public gcc-objc++-10 + (custom-gcc gcc-10 "gcc-objc++" '("obj-c++") + %objc++-search-paths)) (define-public gcc-objc++ gcc-objc++-7)