From patchwork Thu Apr 22 03:13:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dion Mendel X-Patchwork-Id: 28737 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EE07C27BC7C; Thu, 22 Apr 2021 04:15:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8D5FA27BC7B for ; Thu, 22 Apr 2021 04:15:16 +0100 (BST) Received: from localhost ([::1]:58860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZPoB-0006pN-Hs for patchwork@mira.cbaines.net; Wed, 21 Apr 2021 23:15:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZPn3-0006Dj-1E for guix-patches@gnu.org; Wed, 21 Apr 2021 23:14:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZPn0-0001Kh-Ht for guix-patches@gnu.org; Wed, 21 Apr 2021 23:14:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZPn0-00016N-Dl for guix-patches@gnu.org; Wed, 21 Apr 2021 23:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47921] [PATCH] build: Fix elf-dynamic-info-soname. Resent-From: Dion Mendel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Apr 2021 03:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47921 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47921@debbugs.gnu.org Received: via spool by 47921-submit@debbugs.gnu.org id=B47921.16190612404220 (code B ref 47921); Thu, 22 Apr 2021 03:14:02 +0000 Received: (at 47921) by debbugs.gnu.org; 22 Apr 2021 03:14:00 +0000 Received: from localhost ([127.0.0.1]:60272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZPmx-000160-OY for submit@debbugs.gnu.org; Wed, 21 Apr 2021 23:14:00 -0400 Received: from hedgehog.birch.relay.mailchannels.net ([23.83.209.81]:11414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZPmu-00015q-OH for 47921@debbugs.gnu.org; Wed, 21 Apr 2021 23:13:58 -0400 X-Sender-Id: dreamhost|x-authsender|smtp@dm9.info Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 491BC702B78 for <47921@debbugs.gnu.org>; Thu, 22 Apr 2021 03:13:55 +0000 (UTC) Received: from pdx1-sub0-mail-a31.g.dreamhost.com (100-105-161-122.trex.outbound.svc.cluster.local [100.105.161.122]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DAE547027F8 for <47921@debbugs.gnu.org>; Thu, 22 Apr 2021 03:13:54 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|smtp@dm9.info Received: from pdx1-sub0-mail-a31.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.105.161.122 (trex/6.2.1); Thu, 22 Apr 2021 03:13:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|smtp@dm9.info X-MailChannels-Auth-Id: dreamhost X-Absorbed-Absorbed: 66a2ab62597703e7_1619061235129_4086720310 X-MC-Loop-Signature: 1619061235129:938427322 X-MC-Ingress-Time: 1619061235129 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 8C42D86788 for <47921@debbugs.gnu.org>; Wed, 21 Apr 2021 20:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=dm9.info; h=date:from:to :subject:message-id:references:mime-version:content-type :in-reply-to; s=dm9.info; bh=YhARz76WFgqv/6u0IM+GGlrY+mo=; b=ld8 MV79An6XiPjN2iP1zGxSFlLg/+RQOp80X/iuk57YOTWpI6GWK/F1J5l/kHSYj3kD 5bWRtSyspHCRox2Q1z0Aj201KXHBv3LwtYISUzhN+WRoKTp5kvZI/gR3/h+fJc7L p4WXqO61J8yEH6AtNfTg3D31NH8HOmodAOErQlZg= Received: from mail.localdomain (61-245-140-70.3df58c.per.nbn.aussiebb.net [61.245.140.70]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: smtp@dm9.info) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 4E4F286787 for <47921@debbugs.gnu.org>; Wed, 21 Apr 2021 20:13:53 -0700 (PDT) Received: by mail.localdomain (Postfix, from userid 2001) id 4A95E4FFA6A; Thu, 22 Apr 2021 11:13:50 +0800 (AWST) Date: Thu, 22 Apr 2021 11:13:50 +0800 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Dion Mendel Message-ID: <20210422031350.GB2930@dm9.info> References: <20210420194429.GB29387@dm9.info> <76bb70d22fed27efd4a15308abdd9e95fb1aa929.camel@telenet.be> <20210421154612.GA956@dm9.info> <92c4f265369735c71c6f358cfee29fb7cc6a38d2.camel@telenet.be> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <92c4f265369735c71c6f358cfee29fb7cc6a38d2.camel@telenet.be> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Thanks for your explanations. It's cleared up my understanding. I've tried to retitled to target core-updates, but I'm not sure if it applied. I've updated the patch to include a unit test. I am currently testing by rebuilding as you suggest. ./pre-inst-env guix build hello Yes this is building the world so I will report back when it completes. >The record is . != elf-dynamic-info. Thank you. Yes I was confused regarding this. I've updated the commit changelog accordingly. From bfc69ea726e0f5c1955e629e92af377ffb90c2c5 Mon Sep 17 00:00:00 2001 From: Dion Mendel Date: Thu, 22 Apr 2021 10:32:35 +0800 Subject: [PATCH] * guix/build/gremlin.scm (elf-dynamic-info): Correctly set the value of soname in . --- 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