From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59064) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iO1i3-0000PT-FD for guix-patches@gnu.org; Fri, 25 Oct 2019 11:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iO1i2-0000Ey-7S for guix-patches@gnu.org; Fri, 25 Oct 2019 11:41:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iO1i2-0000Es-41 for guix-patches@gnu.org; Fri, 25 Oct 2019 11:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iO1i1-0002CC-Vx for guix-patches@gnu.org; Fri, 25 Oct 2019 11:41:02 -0400 Subject: [bug#37924] [PATCH] gnu: Fix make-gcc-libc Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:58997) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iO1hY-000738-Rk for guix-patches@gnu.org; Fri, 25 Oct 2019 11:40:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iO1hW-0008W7-6o for guix-patches@gnu.org; Fri, 25 Oct 2019 11:40:32 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:39107) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iO1hV-0008Ur-LK for guix-patches@gnu.org; Fri, 25 Oct 2019 11:40:30 -0400 Date: Fri, 25 Oct 2019 15:40:19 +0000 From: Carl Dong Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Carl Dong Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37924@debbugs.gnu.org Reviewers, would like some insight into whether it's okay to remove the FLAGS_FOR_TARGET. From what I can tell it comes from CROSS-GCC-ARGUMENTS in= (gnu packages cross-base) which might not be needed here since we're not cross-building. I've tested this toolchain built without FLAGS_FOR_TARGET a= nd it _seems_ to work fine. ----- Until now the following wouldn't build: --8<---------------cut here---------------start------------->8--- (use-modules (gnu packages commencement) (gnu packages gcc) (gnu packages base)) (make-gcc-libc gcc-9 glibc-2.27) --8<---------------cut here---------------end--------------->8--- * gnu/packages/base.scm (make-gcc-libc)[phases]: Add environment variables to place the target libc on the system header search path. [make-flags]: Remove unncessary FLAGS_FOR_TARGET. [native-inputs]: Construct in a way that doesn't require emptying inputs. --- gnu/packages/base.scm | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 4e80a2fadb..3a3360dc7a 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -981,18 +981,23 @@ with the Linux kernel.") (substitute-keyword-arguments (ensure-keyword-arguments (package-arguments base-gcc) '(#:implicit-inputs? #f)) - ((#:make-flags flags) - `(let ((libc (assoc-ref %build-inputs "libc"))) - ;; FLAGS_FOR_TARGET are needed for the target libraries t= o receive - ;; the -Bxxx for the startfiles. - (cons (string-append "FLAGS_FOR_TARGET=3D-B" libc "/lib") - ,flags))))) + ((#: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 "/inclu= de"))) + '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH")) + #t))))))) (native-inputs - `(("libc" ,libc) - ("libc:static" ,libc "static") - ,@(append (package-inputs base-gcc) - (fold alist-delete (%final-inputs) '("libc" "libc:= static"))))) - (inputs '()))) + `(,@(package-native-inputs base-gcc) + ,@(append (fold alist-delete (%final-inputs) '("libc" "libc:= static"))) + ("libc" ,libc) + ("libc:static" ,libc "static"))))) (define-public (make-glibc-locales glibc) (package -- 2.23.0