summary refs log tree commit diff
path: root/gnu/packages/elf.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/elf.scm')
-rw-r--r--gnu/packages/elf.scm57
1 files changed, 35 insertions, 22 deletions
diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index aab912648b..d4f75c9726 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)
@@ -47,14 +49,14 @@
 (define-public elfutils
   (package
     (name "elfutils")
-    (version "0.182")
+    (version "0.183")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://sourceware.org/elfutils/ftp/"
                                   version "/elfutils-" version ".tar.bz2"))
               (sha256
                (base32
-                "0n48dcadjy0wiilddzav2zaxdi30qkkfp160gw5mycyz9s8hdi7c"))
+                "1igjfia9x8h6fmh9nbl8mpz0i24my5iixrji99qmi79hilh7qqy3"))
               (patches (search-patches "elfutils-tests-ptrace.patch"))))
     (build-system gnu-build-system)
 
@@ -70,6 +72,7 @@
      `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
                                               (assoc-ref %outputs "out")
                                               "/lib")
+                               "--disable-static"
                                ;; TODO: Enable the debuginfo server.  It
                                ;; increases the closure size significantly
                                ;; and presents bootstrapping problems, so
@@ -97,8 +100,8 @@
                (("run-backtrace-native.sh") ""))
              #t)))))
 
-    (native-inputs `(("m4" ,m4)))
-    (inputs `(("zlib" ,zlib)))
+    (native-inputs (list m4))
+    (inputs (list zlib))
     (home-page "https://sourceware.org/elfutils/")
     (synopsis "Collection of utilities and libraries to handle ELF files and
 DWARF data")
@@ -172,8 +175,8 @@ object or archive file), @command{eu-strip} (for discarding symbols),
        ("python-sphinx" ,python-sphinx)
        ("python" ,python)))             ;for tests
     (propagated-inputs
-     `(("elfutils" ,elfutils)           ;libabigail.la says -lelf
-       ("libxml2" ,libxml2)))           ;in Requires.private of libabigail.pc
+     (list elfutils ;libabigail.la says -lelf
+           libxml2))           ;in Requires.private of libabigail.pc
     (synopsis "Analyze application binary interfaces (ABIs)")
     (description
      "@dfn{ABIGAIL} stands for the Application Binary Interface Generic
@@ -204,22 +207,32 @@ 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")
-                             '()))))))))
+         ;; This old 'configure' script doesn't support cross-compilation
+         ;; well.  I.e., it fails to find the cross-compiler.  Also,
+         ;; the old `configure' script doesn't support variables passed as
+         ;; arguments.  A third problem is that config.sub is too old to
+         ;; recognise aarch64 and powerpc64le.
+         ;;
+         ;; Solve this by regenerating the configure script and letting
+         ;; autoreconf update 'config.sub'.  While 'config.sub' is updated
+         ;; anyway, update 'config.guess' as well.
+         (add-before 'bootstrap 'delete-configure
+           (lambda* (#:key native-inputs inputs #:allow-other-keys)
+             (delete-file "configure")
+             (delete-file "config.sub")
+             (delete-file "config.guess")
+             (for-each (lambda (file)
+                         (install-file
+                          (string-append
+                           (assoc-ref (or native-inputs inputs) "automake")
+                           "/share/automake-"
+                           ,(version-major+minor (package-version automake))
+                           "/" file) "."))
+                       '("config.sub" "config.guess")))))))
+    (native-inputs
+     (list autoconf
+           ;; For up-to-date 'config.guess' and 'config.sub'
+           automake))
     (home-page (string-append "https://web.archive.org/web/20181111033959/"
                               "http://www.mr511.de/software/english.html"))
     (synopsis "ELF object file access library")