* [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling.
@ 2024-09-03 16:30 Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 1/2] utils: Add 'objcopy-for-target' and 'objdump-for-target' Zheng Junjie
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Zheng Junjie @ 2024-09-03 16:30 UTC (permalink / raw)
To: 73006; +Cc: Ludovic Courtès
Zheng Junjie (2):
utils: Add 'objcopy-for-target' and 'objdump-for-target'.
gnu: glibc: Fix cross-compiling.
gnu/packages/base.scm | 4 ++++
guix/utils.scm | 12 ++++++++++++
2 files changed, 16 insertions(+)
base-commit: c843564a28b01c900e012c804b5c8721e9762edc
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#73006] [PATCH 1/2] utils: Add 'objcopy-for-target' and 'objdump-for-target'.
2024-09-03 16:30 [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling Zheng Junjie
@ 2024-09-03 16:33 ` Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 2/2] gnu: glibc: Fix cross-compiling Zheng Junjie
2024-09-04 17:16 ` [bug#73006] [PATCH 0/2] " Ludovic Courtès
2 siblings, 0 replies; 7+ messages in thread
From: Zheng Junjie @ 2024-09-03 16:33 UTC (permalink / raw)
To: 73006
Cc: Christopher Baines, Josselin Poiret, Ludovic Courtès,
Mathieu Othacehe, Simon Tournier, Tobias Geerinckx-Rice
* guix/utils.scm (objcopy-for-target, objdump-for-target): New procedures.
Change-Id: I302be242752cd1f4f23368bcbfc8c1674a815224
---
guix/utils.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/utils.scm b/guix/utils.scm
index d8ce6ed886..368a34dfbf 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -115,6 +115,8 @@ (define-module (guix utils)
cc-for-target
cxx-for-target
ld-for-target
+ objcopy-for-target
+ objdump-for-target
pkg-config-for-target
strip-for-target
@@ -826,6 +828,16 @@ (define* (ld-for-target #:optional (target (%current-target-system)))
(string-append target "-ld")
"ld"))
+(define* (objcopy-for-target #:optional (target (%current-target-system)))
+ (if target
+ (string-append target "-objcopy")
+ "objcopy"))
+
+(define* (objdump-for-target #:optional (target (%current-target-system)))
+ (if target
+ (string-append target "-objdump")
+ "objdump"))
+
(define* (pkg-config-for-target #:optional (target (%current-target-system)))
(if target
(string-append target "-pkg-config")
--
2.45.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#73006] [PATCH 2/2] gnu: glibc: Fix cross-compiling.
2024-09-03 16:30 [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 1/2] utils: Add 'objcopy-for-target' and 'objdump-for-target' Zheng Junjie
@ 2024-09-03 16:33 ` Zheng Junjie
2024-09-04 17:16 ` [bug#73006] [PATCH 0/2] " Ludovic Courtès
2 siblings, 0 replies; 7+ messages in thread
From: Zheng Junjie @ 2024-09-03 16:33 UTC (permalink / raw)
To: 73006; +Cc: Ludovic Courtès
* gnu/packages/base.scm (glibc)[arguments]<#:configure-flags>: When
cross-compiling, Set OBJCOPY and OBJDUMP.
Change-Id: I9abd3bda792619903233f5f48a57065da45da50c
---
gnu/packages/base.scm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 4e8121ae2c..2802af2946 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -920,6 +920,10 @@ (define-public glibc
'%build-inputs)
"kernel-headers")
"/include")
+ ,@(if (%current-target-system)
+ `((string-append "OBJCOPY=" ,(objcopy-for-target))
+ (string-append "OBJDUMP=" ,(objdump-for-target)))
+ '())
;; This is the default for most architectures as of GNU libc 2.26,
;; but we specify it explicitly for clarity and consistency. See
--
2.45.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling.
2024-09-03 16:30 [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 1/2] utils: Add 'objcopy-for-target' and 'objdump-for-target' Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 2/2] gnu: glibc: Fix cross-compiling Zheng Junjie
@ 2024-09-04 17:16 ` Ludovic Courtès
2024-09-05 15:52 ` Zheng Junjie
2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2024-09-04 17:16 UTC (permalink / raw)
To: Zheng Junjie; +Cc: 73006
Hi,
Zheng Junjie <zhengjunjie@iscas.ac.cn> skribis:
> utils: Add 'objcopy-for-target' and 'objdump-for-target'.
> gnu: glibc: Fix cross-compiling.
Could you explain what this is addressing?
The ‘add-cross-binutils-to-PATH’ phase is supposed to do the right
thing, as suggested in the discussion at
<https://inbox.sourceware.org/libc-alpha/d72f5f6f-cc3a-bd89-0800-ffb068928e0f@linaro.org/t/>,
and that means ‘objdump-for-target’ & co. shouldn’t be necessary.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling.
2024-09-04 17:16 ` [bug#73006] [PATCH 0/2] " Ludovic Courtès
@ 2024-09-05 15:52 ` Zheng Junjie
2024-09-27 12:24 ` Z572
2024-10-15 15:33 ` bug#73006: " Ludovic Courtès
0 siblings, 2 replies; 7+ messages in thread
From: Zheng Junjie @ 2024-09-05 15:52 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 73006
[-- Attachment #1.1: Type: text/plain, Size: 1110 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Zheng Junjie <zhengjunjie@iscas.ac.cn> skribis:
>
>> utils: Add 'objcopy-for-target' and 'objdump-for-target'.
>> gnu: glibc: Fix cross-compiling.
>
> Could you explain what this is addressing?
all cross-compiling image build fail, because glibc 2.39 cross-compiling fail.
>
> The ‘add-cross-binutils-to-PATH’ phase is supposed to do the right
this is in cross-libc*, but glibc not have this phase.
> thing, as suggested in the discussion at
> <https://inbox.sourceware.org/libc-alpha/d72f5f6f-cc3a-bd89-0800-ffb068928e0f@linaro.org/t/>,
> and that means ‘objdump-for-target’ & co. shouldn’t be necessary.
>
> Ludo’.
glibc 2.35 have "glibc-cross-objdump.patch" and "glibc-cross-objcopy.patch"
patch, but glibc 2.39 not have them, so 2.39 cross compiling try use objdump
and build fail, and 2.35 success.
I checked again today. because (gnu services base)'s nscd-configuration
default use glibc, not '(cross-libc target)', This is why glibc was
introduced. Maybe the following patch can also be useful.
[-- Attachment #1.2: 0001-services-nscd-When-cross-compiling-Use-cross-libc-ta.patch --]
[-- Type: text/x-patch, Size: 2278 bytes --]
From f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4 Mon Sep 17 00:00:00 2001
Message-ID: <f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4.1725551406.git.zhengjunjie@iscas.ac.cn>
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
Date: Thu, 5 Sep 2024 23:48:34 +0800
Subject: [PATCH] services: nscd: When cross-compiling, Use (cross-libc
target).
* gnu/services/base.scm (nscd-configuration)[glibc]: When cross-compiling,
Use (cross-libc target).
Change-Id: Ib219459b1ec28f7edfac075e70be3d61edf72d27
---
gnu/services/base.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 4b5b103cc3..4eda5382f5 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -21,6 +21,7 @@
;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li>
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -67,6 +68,8 @@ (define-module (gnu services base)
libc-utf8-locales-for-target
make-glibc-utf8-locales
tar canonical-package))
+ #:use-module ((gnu packages cross-base)
+ #:select (cross-libc))
#:use-module ((gnu packages compression) #:select (gzip))
#:use-module (gnu packages fonts)
#:autoload (gnu packages guile-xyz) (guile-netlink)
@@ -1313,7 +1316,7 @@ (define-record-type* <nscd-configuration> nscd-configuration
;; from 'glibc-final' instead of pulling in a second
;; glibc copy.
(if target
- glibc
+ (cross-libc target)
(canonical-package glibc))))))
(define-record-type* <nscd-cache> nscd-cache make-nscd-cache
base-commit: 993d6d2e7be4dac738629c76a51058f4dc5bc449
prerequisite-patch-id: dd51603b3f57923df8ac28ca5f41557be07ee742
prerequisite-patch-id: f86942972fa6ddef6e83b54c6120e9d5dfb63098
prerequisite-patch-id: c3394b41809ae9e5a91a51d7c77401cb58192c51
prerequisite-patch-id: 68f03643905981a0a79b4ae13971a58a808877f5
--
2.45.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling.
2024-09-05 15:52 ` Zheng Junjie
@ 2024-09-27 12:24 ` Z572
2024-10-15 15:33 ` bug#73006: " Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: Z572 @ 2024-09-27 12:24 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 73006
[-- Attachment #1: Type: text/plain, Size: 3572 bytes --]
Zheng Junjie <zhengjunjie@iscas.ac.cn> writes:
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hi,
>>
>> Zheng Junjie <zhengjunjie@iscas.ac.cn> skribis:
>>
>>> utils: Add 'objcopy-for-target' and 'objdump-for-target'.
>>> gnu: glibc: Fix cross-compiling.
>>
>> Could you explain what this is addressing?
>
> all cross-compiling image build fail, because glibc 2.39 cross-compiling fail.
>
>>
>> The ‘add-cross-binutils-to-PATH’ phase is supposed to do the right
>
> this is in cross-libc*, but glibc not have this phase.
>
>> thing, as suggested in the discussion at
>> <https://inbox.sourceware.org/libc-alpha/d72f5f6f-cc3a-bd89-0800-ffb068928e0f@linaro.org/t/>,
>> and that means ‘objdump-for-target’ & co. shouldn’t be necessary.
>>
>> Ludo’.
>
> glibc 2.35 have "glibc-cross-objdump.patch" and "glibc-cross-objcopy.patch"
> patch, but glibc 2.39 not have them, so 2.39 cross compiling try use objdump
> and build fail, and 2.35 success.
>
>
> I checked again today. because (gnu services base)'s nscd-configuration
> default use glibc, not '(cross-libc target)', This is why glibc was
> introduced. Maybe the following patch can also be useful.
>
> From f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4 Mon Sep 17 00:00:00 2001
> Message-ID: <f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4.1725551406.git.zhengjunjie@iscas.ac.cn>
> From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
> Date: Thu, 5 Sep 2024 23:48:34 +0800
> Subject: [PATCH] services: nscd: When cross-compiling, Use (cross-libc
> target).
>
> * gnu/services/base.scm (nscd-configuration)[glibc]: When cross-compiling,
> Use (cross-libc target).
>
> Change-Id: Ib219459b1ec28f7edfac075e70be3d61edf72d27
> ---
> gnu/services/base.scm | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index 4b5b103cc3..4eda5382f5 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -21,6 +21,7 @@
> ;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li>
> ;;; Copyright © 2022 ( <paren@disroot.org>
> ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
> +;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -67,6 +68,8 @@ (define-module (gnu services base)
> libc-utf8-locales-for-target
> make-glibc-utf8-locales
> tar canonical-package))
> + #:use-module ((gnu packages cross-base)
> + #:select (cross-libc))
> #:use-module ((gnu packages compression) #:select (gzip))
> #:use-module (gnu packages fonts)
> #:autoload (gnu packages guile-xyz) (guile-netlink)
> @@ -1313,7 +1316,7 @@ (define-record-type* <nscd-configuration> nscd-configuration
> ;; from 'glibc-final' instead of pulling in a second
> ;; glibc copy.
> (if target
> - glibc
> + (cross-libc target)
> (canonical-package glibc))))))
>
> (define-record-type* <nscd-cache> nscd-cache make-nscd-cache
>
> base-commit: 993d6d2e7be4dac738629c76a51058f4dc5bc449
> prerequisite-patch-id: dd51603b3f57923df8ac28ca5f41557be07ee742
> prerequisite-patch-id: f86942972fa6ddef6e83b54c6120e9d5dfb63098
> prerequisite-patch-id: c3394b41809ae9e5a91a51d7c77401cb58192c51
> prerequisite-patch-id: 68f03643905981a0a79b4ae13971a58a808877f5
ping.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73006: [PATCH 0/2] gnu: glibc: Fix cross-compiling.
2024-09-05 15:52 ` Zheng Junjie
2024-09-27 12:24 ` Z572
@ 2024-10-15 15:33 ` Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2024-10-15 15:33 UTC (permalink / raw)
To: Zheng Junjie; +Cc: 73006-done
Hi,
Zheng Junjie <zhengjunjie@iscas.ac.cn> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
[...]
>> thing, as suggested in the discussion at
>> <https://inbox.sourceware.org/libc-alpha/d72f5f6f-cc3a-bd89-0800-ffb068928e0f@linaro.org/t/>,
>> and that means ‘objdump-for-target’ & co. shouldn’t be necessary.
>>
>> Ludo’.
>
> glibc 2.35 have "glibc-cross-objdump.patch" and "glibc-cross-objcopy.patch"
> patch, but glibc 2.39 not have them, so 2.39 cross compiling try use objdump
> and build fail, and 2.35 success.
The reason 2.39 doesn’t have these patches in Guix is because they were
integrated upstream, if I’m not mistaken. Or am I missing something?
> I checked again today. because (gnu services base)'s nscd-configuration
> default use glibc, not '(cross-libc target)', This is why glibc was
> introduced. Maybe the following patch can also be useful.
>
> From f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4 Mon Sep 17 00:00:00 2001
> Message-ID: <f23d1e48bd0fd9d3b66cbc831cc40f475faff7a4.1725551406.git.zhengjunjie@iscas.ac.cn>
> From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
> Date: Thu, 5 Sep 2024 23:48:34 +0800
> Subject: [PATCH] services: nscd: When cross-compiling, Use (cross-libc
> target).
>
> * gnu/services/base.scm (nscd-configuration)[glibc]: When cross-compiling,
> Use (cross-libc target).
>
> Change-Id: Ib219459b1ec28f7edfac075e70be3d61edf72d27
Yes, this one doesn’t hurt, applied.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-15 15:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 16:30 [bug#73006] [PATCH 0/2] gnu: glibc: Fix cross-compiling Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 1/2] utils: Add 'objcopy-for-target' and 'objdump-for-target' Zheng Junjie
2024-09-03 16:33 ` [bug#73006] [PATCH 2/2] gnu: glibc: Fix cross-compiling Zheng Junjie
2024-09-04 17:16 ` [bug#73006] [PATCH 0/2] " Ludovic Courtès
2024-09-05 15:52 ` Zheng Junjie
2024-09-27 12:24 ` Z572
2024-10-15 15:33 ` bug#73006: " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.