[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49025] [[PATCH v2 core-updates] 34/37] libelf: Use the cross-compil
From: |
Maxime Devos |
Subject: |
[bug#49025] [[PATCH v2 core-updates] 34/37] libelf: Use the cross-compiler when cross-compiling. |
Date: |
Fri, 18 Jun 2021 18:09:33 +0200 |
* gnu/packages/elf.scm
(libelf)[arguments]<#:phases>{delete-configure}: Regenerate
the configure script when cross-compiling.
(libelf)[arguments]<#:phases>{configure}: Do not replace
when cross-compiling.
(libelf)[native-inputs]: Add autoconf when cross-compiling.
---
gnu/packages/elf.scm | 48 +++++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 16 deletions(-)
diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 0309dd95b5..66c2334e5c 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2020 Mark Wielaard <mark@klomp.org>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32,6 +33,7 @@
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+))
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages compression)
#:use-module (gnu packages documentation)
#:use-module (gnu packages gcc)
@@ -205,22 +207,36 @@ static analysis of the ELF binaries at hand.")
(arguments
`(#:phases
(modify-phases %standard-phases
- (replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- ;; This old `configure' script doesn't support
- ;; variables passed as arguments.
- (let ((out (assoc-ref outputs "out")))
- (setenv "CONFIG_SHELL" (which "bash"))
- (invoke "./configure"
- (string-append "--prefix=" out)
- ,@(if (string=? "powerpc64le-linux"
- (%current-system))
- '("--host=powerpc64le-unknown-linux-gnu")
- '())
- ,@(if (string=? "aarch64-linux"
- (%current-system))
- '("--host=aarch64-unknown-linux-gnu")
- '()))))))))
+ ,(if (%current-target-system)
+ ;; This old 'configure' script doesn't
+ ;; support cross-compilation well. E.g., it fails
+ ;; to find the cross-compiler.
+ `(add-before 'bootstrap 'delete-configure
+ (lambda _
+ (delete-file "configure")))
+ `(replace 'configure
+ ;; This old `configure' script doesn't support
+ ;; variables passed as arguments. TODO: would
+ ;; simply regenerating 'configure' work
+ ;; well enough, even if compiling natively
+ ;; on powerpc or aarch64?
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "CONFIG_SHELL" (which "bash"))
+ (invoke "./configure"
+ (string-append "--prefix=" out)
+ ,@(if (string=? "powerpc64le-linux"
+ (%current-system))
+ '("--host=powerpc64le-unknown-linux-gnu")
+ '())
+ ,@(if (string=? "aarch64-linux"
+ (%current-system))
+ '("--host=aarch64-unknown-linux-gnu")
+ '())))))))))
+ (native-inputs
+ (if (%current-target-system)
+ `(("autoconf" ,autoconf))
+ '()))
(home-page (string-append "https://web.archive.org/web/20181111033959/"
"http://www.mr511.de/software/english.html"))
(synopsis "ELF object file access library")
--
2.32.0
- [bug#49025] [[PATCH v2 core-updates] 05/37] net-base: Fix cross-compilation, eliminating %build-inputs & friends, (continued)
- [bug#49025] [[PATCH v2 core-updates] 05/37] net-base: Fix cross-compilation, eliminating %build-inputs & friends, Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 04/37] net-base: Make #:builder argument a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 07/37] tzdata: Don't bother with cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 10/37] libgpgerror: Maybe fix a cross-compilation bug., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 16/37] openssl: Remove trailing #t from phases., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 18/37] openssl: Use G-exp machinery for referring to outputs., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 19/37] openssl: Move documentation instead of copying and deleting it., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 21/37] openssl: Find bin/env when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 23/37] readline: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 25/37] bash: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 34/37] libelf: Use the cross-compiler when cross-compiling.,
Maxime Devos <=
- [bug#49025] [[PATCH v2 core-updates] 24/37] readline: Fix build error when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 30/37] glib: Verify the cross-compiled python is used in installed scripts., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 32/37] tk: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 33/37] tk: Do not use %build-inputs when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 31/37] glib: Look up "tzdata" in 'native-inputs', not 'inputs'., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 15/37] python: Fix reference to input when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 26/37] bash: Fix cross-compilation build error., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 28/37] fontconfig: Fix build error when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 11/37] libgpg-error: Fix cross-compilation error., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 37/37] meson: Support cross-compilation., Maxime Devos, 2021/06/18