From patchwork Mon May 6 22:21:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Dong X-Patchwork-Id: 13923 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 0A0F616FB6; Mon, 6 May 2019 23:23:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 97F6816FB3 for ; Mon, 6 May 2019 23:23:13 +0100 (BST) Received: from localhost ([127.0.0.1]:34674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNm0u-00032y-3T for patchwork@mira.cbaines.net; Mon, 06 May 2019 18:23:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNm0m-000318-Kx for guix-patches@gnu.org; Mon, 06 May 2019 18:23:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNm0k-0007rF-Ep for guix-patches@gnu.org; Mon, 06 May 2019 18:23:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNm0k-0007pN-AZ for guix-patches@gnu.org; Mon, 06 May 2019 18:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNm0j-0006Bj-WE for guix-patches@gnu.org; Mon, 06 May 2019 18:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default glibc. Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 May 2019 22:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35611 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35611@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155718132223672 (code B ref -1); Mon, 06 May 2019 22:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 May 2019 22:22:02 +0000 Received: from localhost ([127.0.0.1]:57685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNlzl-00069d-KC for submit@debbugs.gnu.org; Mon, 06 May 2019 18:22:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNlzj-000693-1r for submit@debbugs.gnu.org; Mon, 06 May 2019 18:22:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:42619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNlzd-0006yf-VS for submit@debbugs.gnu.org; Mon, 06 May 2019 18:21:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNlzc-0002p1-T9 for guix-patches@gnu.org; Mon, 06 May 2019 18:21:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNlzb-0006xc-Pk for guix-patches@gnu.org; Mon, 06 May 2019 18:21:52 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]:43643) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNlzb-0006wH-8A for guix-patches@gnu.org; Mon, 06 May 2019 18:21:51 -0400 Date: Mon, 06 May 2019 22:21:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; s=protonmail; t=1557181308; bh=+mkus5IuGkkphsrZ92wzHPdJqR8mq6waKm06nyLbdZk=; h=Date:To:From:Cc:Reply-To:Subject:Feedback-ID:From; b=j9kLvIAdJ1BTSW7al+MiSyxhMlkhb+GFzUzgtLNUCRWOXASWAPEWfhFu1PHaA2AD/ LpwvwY52BSiH+/Df+NeUigz8RWQ0xLRTuA3oNDvMwIWT6Y3FjIj9BbKOaseO5At1jj IO7ZCS1uOCb6Tv7usIib5tqkAxpeufO/THchyGxU= From: Carl Dong Message-ID: Feedback-ID: a8j8tDUaJ4AYuDVBywMTwsJebN4w8TVXadJLsJb8td3t3dZi9RdXFlPaQvoFKnI9KgXySsPXcRkajVyY0cGTcA==:Ext:ProtonMail MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: , Reply-To: Carl Dong Cc: Carl Dong Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cross-base.scm (cross-libc, native-libc, cross-newlib?): Add xlibc optional argument to specify using a non-default glibc package. --- gnu/packages/cross-base.scm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 25caacb723..51e9e2962a 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -422,14 +422,15 @@ target that libc." (define* (cross-libc target #:optional + (xlibc glibc) (xgcc (cross-gcc target)) (xbinutils (cross-binutils target)) (xheaders (cross-kernel-headers target))) - "Return a libc cross-built for TARGET, a GNU triplet. Use XGCC and -XBINUTILS and the cross tool chain." - (if (cross-newlib? target) - (native-libc target) - (let ((libc glibc)) + "Return XLIBC cross-built for TARGET, a GNU triplet. Use XGCC and XBINUTILS +and the cross tool chain." + (if (cross-newlib? target xlibc) + (native-libc target xlibc) + (let ((libc xlibc)) (package (inherit libc) (name (string-append "glibc-cross-" target)) (arguments @@ -502,13 +503,17 @@ XBINUTILS and the cross tool chain." ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc))))))) -(define (native-libc target) +(define* (native-libc target + #:optional + (xlibc glibc)) (if (target-mingw? target) mingw-w64 - glibc)) + xlibc)) -(define (cross-newlib? target) - (not (eq? (native-libc target) glibc))) +(define* (cross-newlib? target + #:optional + (xlibc glibc)) + (not (eq? (native-libc target xlibc) xlibc))) ;;; Concrete cross tool chains are instantiated like this: From patchwork Mon May 6 22:21:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Dong X-Patchwork-Id: 13924 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 6DA1E16FB4; Mon, 6 May 2019 23:23:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D7C5D16FAF for ; Mon, 6 May 2019 23:23:12 +0100 (BST) Received: from localhost ([127.0.0.1]:34676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNm0u-000337-9g for patchwork@mira.cbaines.net; Mon, 06 May 2019 18:23:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNm0o-000327-F1 for guix-patches@gnu.org; Mon, 06 May 2019 18:23:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNm0m-0007wJ-Lh for guix-patches@gnu.org; Mon, 06 May 2019 18:23:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNm0k-0007sk-TV for guix-patches@gnu.org; Mon, 06 May 2019 18:23:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNm0k-0006CC-OY for guix-patches@gnu.org; Mon, 06 May 2019 18:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35612] [PATCH 2/2] gnu: Allow building gcc with non-default libc. Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 May 2019 22:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35612@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155718133523721 (code B ref -1); Mon, 06 May 2019 22:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 May 2019 22:22:15 +0000 Received: from localhost ([127.0.0.1]:57689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNlzz-0006AX-0b for submit@debbugs.gnu.org; Mon, 06 May 2019 18:22:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNlzw-0006AI-LE for submit@debbugs.gnu.org; Mon, 06 May 2019 18:22:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:58492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNlzr-000781-IO for submit@debbugs.gnu.org; Mon, 06 May 2019 18:22:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNlzq-0002qH-JD for guix-patches@gnu.org; Mon, 06 May 2019 18:22:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNlzp-000774-Nw for guix-patches@gnu.org; Mon, 06 May 2019 18:22:06 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]:25123) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNlzp-00076V-HB for guix-patches@gnu.org; Mon, 06 May 2019 18:22:05 -0400 Date: Mon, 06 May 2019 22:21:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; s=protonmail; t=1557181324; bh=s8Bt6k3oxPCigU/VMKudSkGiyrO6hVVW7OPmhYB6BKI=; h=Date:To:From:Cc:Reply-To:Subject:Feedback-ID:From; b=VKDW+sIXEr2tt2BoDe1u5reDjJSAtHCVj5mWdK5G0k6h6btQu0MjDhjF2i7r0TR5k v3ZUUEjet74rncyPeAUDWuXy4y2+WDIV0YzUarCof84FZjOgxPlTEFXqUtvzP0dT1H EEZlwJ/UODu4VZZ1eHDv3TnR9QhATOZehsP+gGEE= From: Carl Dong Message-ID: Feedback-ID: a8j8tDUaJ4AYuDVBywMTwsJebN4w8TVXadJLsJb8td3t3dZi9RdXFlPaQvoFKnI9KgXySsPXcRkajVyY0cGTcA==:Ext:ProtonMail MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: , Reply-To: Carl Dong Cc: Carl Dong Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/base.scm (make-gcc-libc): New procedure, returns a gcc that targets a specified libc. (gcc-glibc-2.26, gcc-glibc-2.27): New public variables. --- gnu/packages/base.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index e33e3c52c8..5c0cd36c14 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1009,6 +1009,35 @@ with the Linux kernel.") (("/bin/pwd") "pwd")) #t)))))))) +(define (make-gcc-libc base-gcc libc) + "Return a GCC that targets LIBC." + (package (inherit base-gcc) + (name (string-append (package-name base-gcc) "-" + (package-name libc) "-" + (package-version libc))) + (arguments + (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 to receive + ;; the -Bxxx for the startfiles. + (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib") + ,flags))))) + (native-inputs + `(("libc" ,libc) + ("libc:static" ,libc "static") + ,@(append (package-inputs base-gcc) + (fold alist-delete (%final-inputs) '("libc" "libc:static"))))) + (inputs '()))) + +(define-public gcc-glibc-2.27 + (make-gcc-libc gcc glibc-2.27)) + +(define-public gcc-glibc-2.26 + (make-gcc-libc gcc glibc-2.26)) + (define-public (make-glibc-locales glibc) (package (inherit glibc)