From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oK7WDELqgGC2bwAAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 05:15:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id Z1+TCELqgGBvPgAA1q6Kng (envelope-from ) for ; Thu, 22 Apr 2021 03:15:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6F00E253CB for ; Thu, 22 Apr 2021 05:15:13 +0200 (CEST) Received: from localhost ([::1]:58860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZPo8-0006pN-Di for larch@yhetil.org; Wed, 21 Apr 2021 23:15:12 -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-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619061314; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=1bPWxCepHr6kuDfcDyTLDJ2wweiFlqp5/FbTWQnCtW8=; b=ha5PhR5zqwwmx1OpsNIwiLQu45jIC/+4vKOjwhLHtkpla4nLFZd8w868wQL29vvG6q/RHQ 9NTwHpHtXvMQKXbtbu+CY9EymskpXKp7RUfvj1g4j+GPLsHKpwx/rt3KJKbtwabjp5WOti wYSNht3hN7F+5xW0qUlffqMsak0j4HFXu8YNp+uV091LjWs+2L10/aJ9jwhnnzhB3Dhbij kWkhb59gqphm5nLrIaI2PPp4oGPTk9da3Q5s3ZTSZqqD2OEiQdO92VqAGj0nak5cARbHkF LW8MEP7ZL6zzpFsVL548joUERwbtX9PIoe9C2/JCF15m2v2p+8tY+36cUZBIsg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619061314; a=rsa-sha256; cv=none; b=ds79yF8sRo9HGPT5rFRagR6Y3FirN1DHKB+UAx2c4FmNTmP370HNb5mTBfI6/1owss3YHb bRX5gwn0kYgTDrUcncfOcS1ZWlDfNEs6Fzsn4ihEa+jWloJNum2AsA/Ax2aLs6h0zGjLiK /GxkxhOrkk+ntWCRX2MVWJiy2z7+myvvMxjjmua1srtQk4Ywe4RQOGP5TPK4nUBCYjKMP8 clWt47bOCMW92VLuiDhcjR7wAM/trXDSfYpF6RAlMn8XxW8ZDHVD7j/aY29gC5UO4g0/Do fL3iSdQSwtGjGENJ9gHXvdKosRskysdDpEr9K5E6sIOcpX5l+Sq1Y61BdXFgJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dm9.info header.s=dm9.info header.b="ld8 MV79"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=dm9.info (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.16 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dm9.info header.s=dm9.info header.b="ld8 MV79"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=dm9.info (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 6F00E253CB X-Spam-Score: 0.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: qYgzqsYlP2cL --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline 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. --ZPt4rx8FFjLCG7dd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-guix-build-gremlin.scm-elf-dynamic-info-Correctly-se.patch" >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 --ZPt4rx8FFjLCG7dd--