From patchwork Tue Feb 4 13:00:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 20091 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A3104168CA; Tue, 4 Feb 2020 13:02:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2E6F3168C9 for ; Tue, 4 Feb 2020 13:02:40 +0000 (GMT) Received: from localhost ([::1]:58018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxqh-0001hJ-Ok for patchwork@mira.cbaines.net; Tue, 04 Feb 2020 08:02:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxq7-0001Hw-Jk for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyxq6-0008Sb-CZ for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyxq6-0008S3-9F for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iyxq6-0006mc-6Y for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39414] [PATCH 1/2] gnu: commencement: Avoid hard-coded GCC version numbers. References: <20200204125314.27494-1-ludo@gnu.org> In-Reply-To: <20200204125314.27494-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Feb 2020 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39414 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39414@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , janneke@gnu.org Received: via spool by 39414-submit@debbugs.gnu.org id=B39414.158082128026008 (code B ref 39414); Tue, 04 Feb 2020 13:02:02 +0000 Received: (at 39414) by debbugs.gnu.org; 4 Feb 2020 13:01:20 +0000 Received: from localhost ([127.0.0.1]:42768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpQ-0006lQ-Ii for submit@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpP-0006lD-Af for 39414@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iyxpK-0005HD-2T; Tue, 04 Feb 2020 08:01:14 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50238 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iyxp7-0007nn-Sv; Tue, 04 Feb 2020 08:01:11 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 4 Feb 2020 14:00:41 +0100 Message-Id: <20200204130042.27757-1-ludo@gnu.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/commencement.scm (gcc-mesboot1, gcc-mesboot): Use 'package-version' instead of hard-coding the version number. --- gnu/packages/commencement.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 851bb02163..f011891725 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -938,7 +938,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (package (inherit gcc-mesboot0) (name "gcc-mesboot1") - (version "4.7.4") + (version (package-version gcc-4.7)) (source (bootstrap-origin (origin (inherit (package-source gcc-4.7)) (patches (search-patches "gcc-boot-4.7.4.patch"))))) @@ -1265,7 +1265,7 @@ exec " gcc "/bin/" program (package (inherit gcc-mesboot1) (name "gcc-mesboot") - (version "4.9.4") + (version (package-version gcc-4.9)) (source (bootstrap-origin (package-source gcc-4.9))) (native-inputs `(("binutils" ,binutils-mesboot) ("gcc-wrapper" ,gcc-mesboot1-wrapper) From patchwork Tue Feb 4 13:00:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 20090 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 03C12168CA; Tue, 4 Feb 2020 13:02:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 201D5168BA for ; Tue, 4 Feb 2020 13:02:20 +0000 (GMT) Received: from localhost ([::1]:58008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxqN-0001QK-J5 for patchwork@mira.cbaines.net; Tue, 04 Feb 2020 08:02:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34325) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxqD-0001MO-Qk for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyxq7-0008Vi-Is for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyxq6-0008Ti-O4 for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iyxq6-0006mj-MZ for guix-patches@gnu.org; Tue, 04 Feb 2020 08:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39414] [PATCH 2/2] gnu: commencement: Rationalize search path handling. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Feb 2020 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39414 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39414@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , janneke@gnu.org Received: via spool by 39414-submit@debbugs.gnu.org id=B39414.158082128626026 (code B ref 39414); Tue, 04 Feb 2020 13:02:02 +0000 Received: (at 39414) by debbugs.gnu.org; 4 Feb 2020 13:01:26 +0000 Received: from localhost ([127.0.0.1]:42771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpV-0006lh-Qu for submit@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyxpT-0006lI-PH for 39414@debbugs.gnu.org; Tue, 04 Feb 2020 08:01:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iyxpO-0005ZK-HW; Tue, 04 Feb 2020 08:01:18 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50238 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iyxpK-0007nn-GM; Tue, 04 Feb 2020 08:01:15 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 4 Feb 2020 14:00:42 +0100 Message-Id: <20200204130042.27757-2-ludo@gnu.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200204130042.27757-1-ludo@gnu.org> References: <20200204130042.27757-1-ludo@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This commit ensures that only packages that correspond to compilers have a search path set. It also reduces manual handling of search path environment variables. * gnu/packages/commencement.scm (tcc-boot0)[native-search-paths]: Remove copy/pasted comment. (gcc-core-mesboot)[arguments]: In 'install2' phase, do not copy TCC/include to OUT/include. [native-search-paths]: Remove leading slash in "lib/gcc-lib/…" directory name. (mesboot-headers)[native-search-paths]: Remove. (glibc-mesboot0)[native-search-paths]: Remove. (gcc-mesboot0)[native-inputs]: Reorder so that we have libc, then kernel-headers, then gcc. [arguments]: Rewrite 'setenv' phase to only set CONFIG_SHELL and create 'config.cache'. (gcc-mesboot1)[native-inputs]: Reorder similarly. [arguments]: In 'setenv' phase, only set CONFIG_SHELL, C_INCLUDE_PATH, and CPLUS_INCLUDE_PATH. (glibc-headers-mesboot)[arguments]: In 'setenv' phase, replace references to '%build-inputs' by references to 'inputs'; simplify setting of CONFIG_SHELL and SHELL; simplify patching of /bin/pwd in the "configure" file; leave C_INCLUDE_PATH and LIBRARY_PATH unset. (glibc-mesboot)[native-search-paths]: Remove. (gcc-mesboot)[native-inputs]: Reorder. [arguments]: Remove clause for #:phases that would change the 'setenv' phase. --- gnu/packages/commencement.scm | 197 ++++++++-------------------------- 1 file changed, 46 insertions(+), 151 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index f011891725..adc4447454 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.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 Andreas Enge ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2014, 2015, 2017 Mark H Weaver @@ -148,11 +148,6 @@ (lambda _ (invoke "sh" "install.sh")))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") (files '("share/mes/include"))) @@ -266,11 +261,6 @@ (lambda _ (invoke "sh" "install.sh")))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") (files '("include"))) @@ -627,18 +617,14 @@ ac_cv_c_float_format='IEEE (little-endian)' (string-append tcc-lib "/libc+gnu.o") (string-append tcc-lib "/libtcc1.o")) (invoke "ls" "-ltrF" gcc-dir) - (copy-recursively (string-append tcc "/include") - (string-append out "/include")) #t)))))) (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. (list (search-path-specification (variable "C_INCLUDE_PATH") - (files '("include" "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"))) + (files '("include" + + ;; Needed to get things like GCC's . + "lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"))) (search-path-specification (variable "LIBRARY_PATH") (files '("lib"))))))) @@ -669,16 +655,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (mkdir-p include) (copy-recursively "include" out) (copy-recursively headers out) - #t)))))) - (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))))))) + #t)))))))) (define glibc-mesboot0 ;; GNU C Library 2.2.5 is the most recent glibc that we managed to build @@ -760,67 +737,38 @@ ac_cv_c_float_format='IEEE (little-endian)' (lambda* (#:key configure-flags #:allow-other-keys) (format (current-error-port) "running ./configure ~a\n" (string-join configure-flags)) - (apply invoke "./configure" configure-flags)))))) - (native-search-paths - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib"))))))) + (apply invoke "./configure" configure-flags)))))))) (define gcc-mesboot0 (package (inherit gcc-core-mesboot) (name "gcc-mesboot0") (native-inputs `(("binutils" ,binutils-mesboot0) - ("gcc" ,gcc-core-mesboot) + + ;; GCC-CORE-MESBOOT must appear last because it also + ;; provides libc headers from Mes that we want to shadow + ;; with those of GLIBC-MESBOOT0. ("libc" ,glibc-mesboot0) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("gcc" ,gcc-core-mesboot) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot0))) (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot) ((#:phases phases) `(modify-phases ,phases (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" - ":" kernel-headers "/include" - ":" glibc "/include")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - ;; FIXME: add glibc dirs to paths manually - (setenv "LIBRARY_PATH" (string-join - (list (string-append glibc "/lib") - (getenv "LIBRARY_PATH")) - ":")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - (with-output-to-file "config.cache" - (lambda _ - (display " + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + (with-output-to-file "config.cache" + (lambda _ + (display " ac_cv_c_float_format='IEEE (little-endian)' "))) - #t))) + #t)) (replace 'install2 (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -946,13 +894,14 @@ ac_cv_c_float_format='IEEE (little-endian)' ("mpfr-source" ,(package-source mpfr-boot)) ("mpc-source" ,(package-source mpc-boot)))) (native-inputs `(("binutils" ,binutils-mesboot) - ("gcc" ,gcc-mesboot0) + ("libc" ,glibc-mesboot0) + ("kernel-headers" ,%bootstrap-linux-libre-headers) + ("gcc" ,gcc-mesboot0) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot))) (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot) @@ -994,24 +943,18 @@ ac_cv_c_float_format='IEEE (little-endian)' #t))) (delete 'remove-info) (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t))) + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + + ;; Allow MPFR headers to be found. + (setenv "C_INCLUDE_PATH" + (string-append (getcwd) "/mpfr/src:" + (getenv "C_INCLUDE_PATH"))) + + ;; Set the C++ search path so that C headers can be found as + ;; libstdc++ is being compiled. + (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) + #t)) (delete 'install2))) ((#:configure-flags configure-flags) `(let ((out (assoc-ref %outputs "out")) @@ -1158,22 +1101,18 @@ exec " gcc "/bin/" program ((#:phases phases) `(modify-phases ,phases (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (headers (assoc-ref %build-inputs "headers")) - (bash (assoc-ref %build-inputs "bash")) - (coreutils (assoc-ref %build-inputs "coreutils")) - (libc (assoc-ref %build-inputs "libc")) - (gcc (assoc-ref %build-inputs "gcc")) + (lambda* (#:key inputs #:allow-other-keys) + (let* ((headers (assoc-ref inputs "headers")) + (libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc")) (cppflags (string-append " -I " (getcwd) "/nptl/sysdeps/pthread/bits" " -D BOOTSTRAP_GLIBC=1")) (cflags (string-append " -L " (getcwd) " -L " libc "/lib"))) (setenv "libc_cv_friendly_stddef" "yes") - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "SHELL" (getenv "CONFIG_SHELL")) - (format (current-error-port) "CONFIG_SHELL=~s\n" (getenv "CONFIG_SHELL")) + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "SHELL" (which "sh")) (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)) @@ -1181,10 +1120,7 @@ exec " gcc "/bin/" program ;; avoid -fstack-protector (setenv "libc_cv_ssp" "false") (substitute* "configure" - (("/bin/pwd") (string-append coreutils "/bin/pwd"))) - (setenv "C_INCLUDE_PATH" (string-append libc "/include" - headers "/include")) - (setenv "LIBRARY_PATH" (string-append libc "/lib")) + (("/bin/pwd") "pwd")) #t))) (replace 'install (lambda* (#:key outputs make-flags #:allow-other-keys) @@ -1244,22 +1180,7 @@ exec " gcc "/bin/" program (install-flags (cons "install" make-flags))) (apply invoke "make" install-flags) (copy-recursively kernel-headers out) - #t)))))))) - (native-search-paths ;; FIXME: move to glibc-mesboot0 - ;; Use the language-specific variables rather than 'CPATH' because they - ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. - ;; The intent is to allow headers that are in the search path to be - ;; treated as "system headers" (headers exempt from warnings) just like - ;; the typical /usr/include headers on an FHS system. - (list (search-path-specification - (variable "C_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "CPLUS_INCLUDE_PATH") - (files '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (files '("lib"))))))) + #t)))))))))) (define gcc-mesboot (package @@ -1268,14 +1189,15 @@ exec " gcc "/bin/" program (version (package-version gcc-4.9)) (source (bootstrap-origin (package-source gcc-4.9))) (native-inputs `(("binutils" ,binutils-mesboot) + + ("libc" ,glibc-mesboot) + ("kernel-headers" ,%bootstrap-linux-libre-headers) ("gcc-wrapper" ,gcc-mesboot1-wrapper) ("gcc" ,gcc-mesboot1) - ("libc" ,glibc-mesboot) ("bash" ,%bootstrap-coreutils&co) ("coreutils" ,%bootstrap-coreutils&co) ("diffutils" ,diffutils-mesboot) - ("kernel-headers" ,%bootstrap-linux-libre-headers) ("make" ,make-mesboot))) (arguments `(#:validate-runpath? #f @@ -1318,34 +1240,7 @@ exec " gcc "/bin/" program "--disable-libstdcxx-pch" ;; for libcpp ... - "--disable-build-with-cxx"))) - ((#:phases phases) - `(modify-phases ,phases - (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "CPLUS_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.7.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t)))))))))) + "--disable-build-with-cxx")))))))) (define gcc-mesboot-wrapper ;; We need this so gcc-mesboot can be used to create shared binaries that