From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:45371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNmCN-00054y-Jt for guix-patches@gnu.org; Mon, 06 May 2019 18:35:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNmCM-0003en-MT for guix-patches@gnu.org; Mon, 06 May 2019 18:35:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNmCM-0003eK-8t for guix-patches@gnu.org; Mon, 06 May 2019 18:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNmCM-0000B3-4A for guix-patches@gnu.org; Mon, 06 May 2019 18:35:02 -0400 Subject: [bug#35611] [PATCH 2/2] gnu: Allow building gcc with non-default libc. References: In-Reply-To: Resent-Message-ID: Date: Mon, 06 May 2019 22:34:15 +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: "35611@debbugs.gnu.org" <35611@debbugs.gnu.org> * 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 t= o receive + ;; the -Bxxx for the startfiles. + (cons (string-append "FLAGS_FOR_TARGET=3D-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) -- 2.21.0