GNU bug report logs - #35611
[PATCH 1/2] gnu: cross-base: Allow using non-default glibc.

Previous Next

Package: guix-patches;

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

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

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#35611: closed ([PATCH 1/2] gnu: cross-base: Allow using
 non-default glibc.)
Date: Mon, 13 May 2019 07:47:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 13 May 2019 09:45:56 +0200
with message-id <87lfzavlu3.fsf <at> gnu.org>
and subject line Re: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.
has caused the debbugs.gnu.org bug report #35611,
regarding [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
35611: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35611
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Carl Dong <accounts <at> carldong.me>
To: guix-patches <at> gnu.org
Cc: Carl Dong <accounts <at> carldong.me>
Subject: [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.
Date: Mon, 06 May 2019 22:21:43 +0000
* 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:
-- 
2.21.0




[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Carl Dong <accounts <at> carldong.me>
Cc: "35611 <at> debbugs.gnu.org" <35611-done <at> debbugs.gnu.org>
Subject: Re: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default
 glibc.
Date: Mon, 13 May 2019 09:45:56 +0200
Hi Carl,

Carl Dong <accounts <at> carldong.me> skribis:

>> Really a detail, but for clarity I would change “xlibc” to “libc”, because
>> this argument denotes a C library, not a cross-compiled C library.
>>
>> Ditto in other places.
>>
>> You can send an updated patch or I can make this change on your behalf if you
>> prefer, let me know!
>
> Ah yes! That does make it more clear. Could you make this change for me? Thanks!

Done!

>> This procedure is starting to look weird. :-) I wonder if we should inline it
>> at the call sites, but we can look into it later.
>
> Haha that's what I thought too... Inlining would probably make the most sense.
> I'll submit another patch to this effect at some point!

Awesome.  :-)

Thank you!

Ludo’.


This bug report was last modified 6 years and 5 days ago.

Previous Next


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