[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49025] [PATCH v4 core-updates 34/36] libelf: Use the cross-compiler
From: |
Maxime Devos |
Subject: |
[bug#49025] [PATCH v4 core-updates 34/36] libelf: Use the cross-compiler when cross-compiling. |
Date: |
Sat, 19 Jun 2021 17:04:56 +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 v4 core-updates 12/36] libgcrypt: Fix cross-compilation build error., (continued)
- [bug#49025] [PATCH v4 core-updates 12/36] libgcrypt: Fix cross-compilation build error., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 15/36] python: Fix reference to input when cross-compiling., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 16/36] openssl: Remove trailing #t from phases., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 18/36] openssl: Use G-exp machinery for referring to outputs., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 20/36] openssl: Move all man pages to separate output, not only man3., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 09/36] libgpg-error: Prevent silent miscompilation some systems., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 21/36] openssl: Find bin/env when cross-compiling., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 35/36] cross-base: Fix cross-compiler for i686-linux-gnu., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 33/36] tk: Do not use %build-inputs when cross-compiling., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 26/36] bash: Fix cross-compilation build error., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 34/36] libelf: Use the cross-compiler when cross-compiling.,
Maxime Devos <=
- [bug#49025] [PATCH v4 core-updates 25/36] bash: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 32/36] tk: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/19
- [bug#49025] [PATCH v4 core-updates 23/36] readline: Make #:configure-flags a G-expression., Maxime Devos, 2021/06/19