Subject: bug#35611: closed (Re: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 13 May 2019 07:47:03 +0000

Your bug report

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

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
35611: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35611
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.
From: Ludovic Courtès <[email-masked]>
To: Carl Dong <[email-masked]>
Cc: "[email-masked]" <[email-masked]>
Date: Mon, 13 May 2019 09:45:56 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Carl,

Carl Dong <[email-masked]> 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’.

Subject: [PATCH 1/2] gnu: cross-base: Allow using non-default glibc.
From: Carl Dong <[email-masked]>
To: [email-masked]
Cc: Carl Dong <[email-masked]>
Date: Mon, 06 May 2019 22:21:43 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

* 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