--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: [bug#35611] [PATCH 1/2] gnu: cross-base: Allow using non-default glibc. |
Date: |
Mon, 13 May 2019 09:45:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Hi Carl,
Carl Dong <address@hidden> 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’.
--- End Message ---