diff mbox series

[bug#47921] Include correct commit message

Message ID 20210422032605.GA3138@dm9.info
State Accepted
Headers show
Series [bug#47921] Include correct commit message | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Dion Mendel April 22, 2021, 3:26 a.m. UTC
Correct changelog message.
diff mbox series

Patch

From c9df762924ac28bc7cab6c7c1f9acda0db378f7e Mon Sep 17 00:00:00 2001
From: Dion Mendel <guix@dm9.info>
Date: Thu, 22 Apr 2021 11:21:35 +0800
Subject: [PATCH] build: Fix elf-dynamic-info-soname.

* guix/build/gremlin.scm (elf-dynamic-info): Correctly set the value of soname in <elf-dynamic-info>.
---
 guix/build/gremlin.scm |  4 +++-
 tests/gremlin.scm      | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/guix/build/gremlin.scm b/guix/build/gremlin.scm
index e8ea66dfb3..4710502426 100644
--- a/guix/build/gremlin.scm
+++ b/guix/build/gremlin.scm
@@ -215,7 +215,9 @@  string table if the type is a string."
     (#f #f)
     ((? elf-segment? dynamic)
      (let ((entries (dynamic-entries elf dynamic)))
-       (%elf-dynamic-info (find (matching-entry DT_SONAME) entries)
+       (%elf-dynamic-info (and=> (find (matching-entry DT_SONAME)
+                                        entries)
+                                  dynamic-entry-value)
                           (filter-map (lambda (entry)
                                         (and (= (dynamic-entry-type entry)
                                                 DT_NEEDED)
diff --git a/tests/gremlin.scm b/tests/gremlin.scm
index b0bb7a8e49..50ad0d70f5 100644
--- a/tests/gremlin.scm
+++ b/tests/gremlin.scm
@@ -96,4 +96,22 @@ 
                 (close-pipe pipe)
                 str)))))))
 
+(unless c-compiler
+  (test-skip 1))
+(test-equal "elf-dynamic-info-soname"
+  "libfoo.so.2"
+  (call-with-temporary-directory
+   (lambda (directory)
+     (with-directory-excursion directory
+       (call-with-output-file "t.c"
+         (lambda (port)
+           (display "// empty file" port)))
+       (invoke c-compiler "t.c"
+               "-shared" "-Wl,-soname,libfoo.so.2")
+       (let* ((dyninfo (elf-dynamic-info
+                       (parse-elf (call-with-input-file "a.out"
+                                    get-bytevector-all))))
+              (soname  (elf-dynamic-info-soname dyninfo)))
+	 soname)))))
+
 (test-end "gremlin")
-- 
2.31.0