Subject: bug#52943: Cannot build guix as part of guix system reconfigure after commit 224d437fb4 on aarch64

From: Chris Marusich <[email-masked]>
Date: Sat, 15 Jan 2022 17:00:33 -0800

Hi Pierre,

FYI, it looks like you included [email-masked] in the CC list of your
last email.  If you do that, I believe it will create a new bug report,
which may not be what you intended to do.

Pierre Langlois <[email-masked]> writes:

> I'm afraid I don't have any new insight if this is an issue or just
> working as intended. Given we have a limited bandwidth to address this
> thoroughly, would it make sense to apply a temporary work-around in the
> mean time? I'd be good for at least guix to build on aarch64 in the 1.4
> release.
>
> I have the attached patch in my tree for instance (along with an update
> of the guix package), and I've not noticed any issues on a rockpro64,
> running cgit, DHCP and dnsmasq. That's just anecdotal :-), but I'm also
> thinking if we unblock the guix package then the farm might catch other
> issues that could help getting to the bottom of this.
>
> WDYT?

I agree with you.  That said, I don't personally run any aarch64-linux
machines, and I don't plan to investigate the aarch64-linux issue
further right now.

Although I will defer to anyone who actually runs aarch64-linux and
knows better, at the moment to me it seems reasonable to commit a patch
like the one you've proposed in order to ensure that the "guix" package
builds successfully on that platform for the 1.4.0 release.  The fact
that you have successfully built and used various pieces of software on
aarch64-linux with this patch suggests that maybe the current behavior
is OK, after all.

I've made some rather trivial modifications to your patch, mainly to
make it conform to our required ChangeLog format.  If nobody has further
comments, I will commit the attached version to master in about 24
hours.

-- 
Chris

PGP: https://savannah.gnu.org/people/viewgpg.php?user_id=106836
From f502bab1e09276982acfd3ac0c151b241f7aa07d Mon Sep 17 00:00:00 2001
From: Pierre Langlois <[email-masked]>
Date: Wed, 22 Dec 2021 22:02:08 +0000
Subject: [PATCH] tests: Fix file-needed/recursive on aarch64-linux.

Fixes: <https://issues.guix.gnu.org/52943>.

* tests/gremlin.scm (file-needed/recursive)[ground-truth]: On aarch64-linux,
remove the dynamic linker from this list.
---
 tests/gremlin.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/gremlin.scm b/tests/gremlin.scm
index 9e0017337a..3dbb8d3643 100644
--- a/tests/gremlin.scm
+++ b/tests/gremlin.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2018, 2020, 2022 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2022 Chris Marusich <[email-masked]>
+;;; Copyright © 2022 Pierre Langlois <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,9 +21,11 @@
 (define-module (test-gremlin)
   #:use-module (guix elf)
   #:use-module (guix tests)
-  #:use-module ((guix utils) #:select (call-with-temporary-directory))
+  #:use-module ((guix utils) #:select (call-with-temporary-directory
+                                       target-aarch64?))
   #:use-module (guix build utils)
   #:use-module (guix build gremlin)
+  #:use-module (gnu packages bootstrap)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
@@ -99,7 +102,12 @@ (define ground-truth
                 (or (string-prefix? "linux-vdso.so" entry)
                     (string-prefix? "linux-vdso32.so" entry) ;32-bit powerpc
                     (string-prefix? "linux-vdso64.so" entry) ;64-bit powerpc
-                    (string-prefix? "linux-gate.so" entry))) ;i386
+                    (string-prefix? "linux-gate.so" entry)   ;i386
+                    ;; FIXME: ELF files on aarch64 do not always include a
+                    ;; NEEDED entry for the dynamic linker, and it is unclear
+                    ;; if that is OK.  See: https://issues.guix.gnu.org/52943
+                    (and (target-aarch64?)
+                         (string-contains entry (glibc-dynamic-linker)))))
               (read-ldd-output pipe)))
 
     (and (zero? (close-pipe pipe))

base-commit: 172bd0b5cde2609389fd16d18862b5b612c4b000
-- 
2.33.1