gnu: cross-base: Adjust ‘cross-libc’ for use as non-native input.

When ‘cross-libc’ is used in a context where it’s not a native input, as
is the case with ‘package-with-relocatable-glibc’ when cross-compiling,
the target objdump is to be found in the native inputs.

* gnu/packages/cross-base.scm (cross-libc*): In
‘add-cross-binutils-to-PATH’ phase, look for TARGET’s objdump in
NATIVE-INPUTS in addition to INPUTS.

Change-Id: Ic0e9ee720cf4211edc95be59903b4bd1d94b1e3f
This commit is contained in:
Ludovic Courtès 2024-08-18 21:24:48 +02:00
parent cbcc06b1d7
commit 5d6c55d364
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -716,13 +716,13 @@ (define* (cross-libc* target
(string-append kernel "/lib")) ; for Hurd's libihash
#t)))
(add-before 'configure 'add-cross-binutils-to-PATH
(lambda* (#:key inputs #:allow-other-keys)
(lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Add BINUTILS/TARGET/bin to $PATH so that 'gcc
;; -print-prog-name=objdump' returns the correct name. See
;; <https://inbox.sourceware.org/libc-alpha/d72f5f6f-cc3a-bd89-0800-ffb068928e0f@linaro.org/t/>.
(define cross-objdump
(search-input-file
inputs
(or native-inputs inputs)
(string-append ,target "/bin/objdump")))
(define cross-binutils