[bug#73006,0/2] gnu: glibc: Fix cross-compiling.
Commit Message
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.
Comments
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.
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’.
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(-)
@@ -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