From 2073b55e6b964cb8ca15e8c74cb32dac00f05f0d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 6 Feb 2020 15:32:00 +0100 Subject: gnu: gcc: Switch back to using 'C_INCLUDE_PATH' instead of 'CPATH'. Fixes . Initially reported by Julien Lepiller . * gnu/packages/base.scm (make-gcc-libc): Remove 'treat-glibc-as-system-header' phase from 'arguments'. * gnu/packages/commencement.scm (gcc-final): Likewise. * gnu/packages/gcc.scm (gcc-4.7)[arguments]: Add "include/c++" to 'CPLUS_INCLUDE_PATH'. (gcc-6)[native-search-paths]: Remove. * gnu/packages/make-bootstrap.scm (gcc-for-bootstrap): Remove 'native-search-paths' and 'arguments'. * gnu/packages/patches/python-2.7-search-paths.patch, gnu/packages/patches/python-3-search-paths.patch: Replace "CPATH" with "C_INCLUDE_PATH". * guix/build-system/cmake.scm (lower): When not cross-compiling, move INPUTS from the 'host-inputs' field to the 'build-inputs' field of the bag, right after NATIVE-INPUTS. * guix/build-system/glib-or-gtk.scm (lower): Likewise. * guix/build-system/gnu.scm (lower): Likewise. * guix/build-system/meson.scm (lower): Likewise. --- gnu/packages/base.scm | 19 +++------------- gnu/packages/commencement.scm | 9 -------- gnu/packages/gcc.scm | 18 +++++----------- gnu/packages/make-bootstrap.scm | 25 ++-------------------- gnu/packages/patches/python-2.7-search-paths.patch | 4 ++-- gnu/packages/patches/python-3-search-paths.patch | 4 ++-- 6 files changed, 14 insertions(+), 65 deletions(-) (limited to 'gnu/packages') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 45f6cf79ba..05a48ce7e0 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014, 2019 Andreas Enge ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver @@ -981,21 +981,8 @@ (define-public (make-gcc-libc base-gcc libc) (package-name libc) "-" (package-version libc))) (arguments - (substitute-keyword-arguments - (ensure-keyword-arguments (package-arguments base-gcc) - '(#:implicit-inputs? #f)) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'treat-glibc-as-system-header - (lambda _ - (let ((libc (assoc-ref %build-inputs "libc"))) - ;; GCCs build processes requires that the libc - ;; we're building against is on the system header - ;; search path. - (for-each (lambda (var) - (setenv var (string-append libc "/include"))) - '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH")) - #t))))))) + (ensure-keyword-arguments (package-arguments base-gcc) + '(#:implicit-inputs? #f))) (native-inputs `(,@(package-native-inputs base-gcc) ,@(append (fold alist-delete (%final-inputs) '("libc" "libc:static"))) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e26bc1cec2..2a0a83ad49 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -2193,15 +2193,6 @@ (define gcc-final char-set:letter) ,(package-name lib))) (list gmp-6.0 mpfr mpc)) - #t))) - (add-before 'configure 'treat-glibc-as-system-header - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc"))) - ;; Make sure Glibc is treated as a "system header" so - ;; #include_next does the right thing. - (for-each (lambda (var) - (setenv var (string-append libc "/include"))) - '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH")) #t)))))))) ;; This time we want Texinfo, so we get the manual. Add diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 94f7e15382..69bac8dd0c 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014, 2015, 2018 Mark H Weaver ;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus ;;; Copyright © 2015 Andreas Enge @@ -340,7 +340,9 @@ (define-public gcc-4.7 (files '("include"))) (search-path-specification (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) + ;; Add 'include/c++' here so that 's "#include_next + ;; " finds GCC's , not libc's. + (files '("include/c++" "include"))) (search-path-specification (variable "LIBRARY_PATH") (files '("lib" "lib64"))))) @@ -476,17 +478,7 @@ (define-public gcc-6 "gcc-5.0-libvtv-runpath.patch")))) (inputs `(("isl" ,isl) - ,@(package-inputs gcc-4.7))) - - (native-search-paths - ;; We have to use 'CPATH' for GCC > 5, not 'C_INCLUDE_PATH' & co., due to - ;; . - (list (search-path-specification - (variable "CPATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib" "lib64"))))))) + ,@(package-inputs gcc-4.7))))) (define-public gcc-7 (package diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 0144a6e9a2..eea59758fd 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Mark H Weaver @@ -95,32 +95,11 @@ (define gcc-for-bootstrap (package (inherit gcc) (outputs '("out")) ;all in one so libgcc_s is easily found - (native-search-paths - ;; Set CPLUS_INCLUDE_PATH so GCC is able to find the libc - ;; C++ headers. - (cons (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) - (package-native-search-paths gcc))) (inputs `( ;; Distinguish the name so we can refer to it below. ("bootstrap-libc" ,(glibc-for-bootstrap glibc)) ("libc:static" ,(glibc-for-bootstrap glibc) "static") - ,@(package-inputs gcc))) - (arguments - (substitute-keyword-arguments (package-arguments gcc) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'treat-glibc-as-system-header - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "bootstrap-libc"))) - ;; GCCs build processes requires that the libc - ;; we're building against is on the system header - ;; search path. - (for-each (lambda (var) - (setenv var (string-append libc "/include"))) - '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH")) - #t)))))))))) + ,@(package-inputs gcc)))))) (define (package-with-relocatable-glibc p) "Return a variant of P that uses the libc as defined by diff --git a/gnu/packages/patches/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch index 5a345c7691..3318f44d23 100644 --- a/gnu/packages/patches/python-2.7-search-paths.patch +++ b/gnu/packages/patches/python-2.7-search-paths.patch @@ -1,4 +1,4 @@ -Make sure the build system honors CPATH and LIBRARY_PATH when +Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when looking for headers and libraries. --- Python-2.7.10/setup.py 2015-10-07 18:33:18.125153186 +0200 @@ -10,7 +10,7 @@ looking for headers and libraries. + # Always honor these variables. + if not cross_compiling: + lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) -+ inc_dirs += os.getenv('CPATH', '').split(os.pathsep) ++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) + else: + lib_dirs = os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep) + inc_dirs = os.getenv('CROSS_CPATH', '').split(os.pathsep) diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch index aaf7236631..612201d1f2 100644 --- a/gnu/packages/patches/python-3-search-paths.patch +++ b/gnu/packages/patches/python-3-search-paths.patch @@ -1,4 +1,4 @@ -Make sure the build system honors CPATH and LIBRARY_PATH when +Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when looking for headers and libraries. --- a/setup.py 2015-10-07 23:32:58.891329173 +0200 @@ -10,7 +10,7 @@ looking for headers and libraries. - self.lib_dirs = self.compiler.library_dirs + system_lib_dirs - self.inc_dirs = self.compiler.include_dirs + system_include_dirs + self.lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep) -+ self.inc_dirs = os.getenv('CPATH', '').split(os.pathsep) ++ self.inc_dirs = os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) else: # Add the sysroot paths. 'sysroot' is a compiler option used to # set the logical path of the standard system headers and -- cgit v1.2.3