Browse Source

gnu: gcc: Switch back to using 'C_INCLUDE_PATH' instead of 'CPATH'.

Fixes <https://bugs.gnu.org/30756>.
Initially reported by Julien Lepiller <julien@lepiller.eu>.

* 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.
gn-latest-20200725
Ludovic Courtès 2 years ago
parent
commit
2073b55e6b
No known key found for this signature in database GPG Key ID: 90B11993D9AEBB5
  1. 19
      gnu/packages/base.scm
  2. 9
      gnu/packages/commencement.scm
  3. 18
      gnu/packages/gcc.scm
  4. 25
      gnu/packages/make-bootstrap.scm
  5. 4
      gnu/packages/patches/python-2.7-search-paths.patch
  6. 4
      gnu/packages/patches/python-3-search-paths.patch
  7. 5
      guix/build-system/cmake.scm
  8. 16
      guix/build-system/glib-or-gtk.scm
  9. 10
      guix/build-system/gnu.scm
  10. 14
      guix/build-system/meson.scm

19
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 <ludo@gnu.org>
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2019 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
@ -981,21 +981,8 @@ with the Linux kernel.")
(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")))

9
gnu/packages/commencement.scm

@ -2193,15 +2193,6 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
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

18
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 <ludo@gnu.org>
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
@ -340,7 +340,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
(files '("include")))
(search-path-specification
(variable "CPLUS_INCLUDE_PATH")
(files '("include")))
;; Add 'include/c++' here so that <cstdlib>'s "#include_next
;; <stdlib.h>" finds GCC's <stdlib.h>, not libc's.
(files '("include/c++" "include")))
(search-path-specification
(variable "LIBRARY_PATH")
(files '("lib" "lib64")))))
@ -476,17 +478,7 @@ Go. It also includes runtime support libraries for these languages.")
"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
;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129>.
(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

25
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 <ludo@gnu.org>
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Mark H Weaver <mhw@netris.org>
@ -95,32 +95,11 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(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

4
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)

4
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

5
guix/build-system/cmake.scm

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013, 2014, 2015, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;;
@ -72,6 +72,7 @@
'())
,@`(("cmake" ,cmake))
,@native-inputs
,@(if target '() inputs)
,@(if target
;; Use the standard cross inputs of
;; 'gnu-build-system'.
@ -79,7 +80,7 @@
'())
;; Keep the standard inputs of 'gnu-build-system'.
,@(standard-packages)))
(host-inputs inputs)
(host-inputs (if target inputs '()))
;; The cross-libc is really a target package, but for bootstrapping
;; reasons, we can't put it in 'host-inputs'. Namely, 'cross-gcc' is a

16
guix/build-system/glib-or-gtk.scm

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;;
@ -92,15 +92,15 @@
(bag
(name name)
(system system)
(host-inputs `(,@(if source
`(("source" ,source))
'())
,@inputs))
(build-inputs `(("glib:bin" ,glib "bin") ; to compile schemas
(host-inputs (if source
`(("source" ,source))
'()))
(build-inputs `(,@native-inputs
,@inputs
("glib:bin" ,glib "bin") ; to compile schemas
,@(if implicit-inputs?
(standard-packages)
'())
,@native-inputs))
'())))
(outputs outputs)
(build glib-or-gtk-build)
(arguments (strip-keyword-arguments private-keywords arguments)))))

10
guix/build-system/gnu.scm

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -296,13 +296,19 @@ standard packages used as implicit inputs of the GNU build system."
`(("source" ,source))
'())
,@native-inputs
;; When not cross-compiling, ensure implicit inputs come
;; last. That way, libc headers come last, which allows
;; #include_next to work correctly; see
;; <https://bugs.gnu.org/30756>.
,@(if target '() inputs)
,@(if (and target implicit-cross-inputs?)
(standard-cross-packages target 'host)
'())
,@(if implicit-inputs?
(standard-packages)
'())))
(host-inputs inputs)
(host-inputs (if target inputs '()))
;; The cross-libc is really a target package, but for bootstrapping
;; reasons, we can't put it in 'host-inputs'. Namely, 'cross-gcc' is a

14
guix/build-system/meson.scm

@ -74,13 +74,13 @@
(system system)
(build-inputs `(("meson" ,meson)
("ninja" ,ninja)
,@native-inputs))
(host-inputs `(,@(if source
`(("source" ,source))
'())
,@inputs
;; Keep the standard inputs of 'gnu-build-system'.
,@(standard-packages)))
,@native-inputs
,@inputs
;; Keep the standard inputs of 'gnu-build-system'.
,@(standard-packages)))
(host-inputs (if source
`(("source" ,source))
'()))
(outputs outputs)
(build meson-build)
(arguments (strip-keyword-arguments private-keywords arguments)))))

Loading…
Cancel
Save