GNU bug report logs - #35612
[PATCH 2/2] gnu: Allow building gcc with non-default libc.

Previous Next

Package: guix-patches;

Reported by: Carl Dong <accounts <at> carldong.me>

Date: Mon, 6 May 2019 22:23:02 UTC

Severity: normal

Tags: fixed, patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35612 in the body.
You can then email your comments to 35612 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#35612; Package guix-patches. (Mon, 06 May 2019 22:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <accounts <at> carldong.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 06 May 2019 22:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <accounts <at> carldong.me>
To: guix-patches <at> gnu.org
Cc: Carl Dong <accounts <at> carldong.me>
Subject: [PATCH 2/2] gnu: Allow building gcc with non-default libc.
Date: Mon, 06 May 2019 22:21:58 +0000
* 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)
-- 
2.21.0






Added tag(s) fixed. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 13 May 2019 07:47:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 35612 <at> debbugs.gnu.org and Carl Dong <accounts <at> carldong.me> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 13 May 2019 07:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Jun 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.