From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id TcL6A6auWGLZiwAAgWs5BA (envelope-from ) for ; Fri, 15 Apr 2022 01:30:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UBGeN6WuWGJrswAAG6o9tA (envelope-from ) for ; Fri, 15 Apr 2022 01:30:45 +0200 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 9899E18DE8 for ; Fri, 15 Apr 2022 01:30:45 +0200 (CEST) Received: from localhost ([::1]:57776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nf8vE-00038d-6c for larch@yhetil.org; Thu, 14 Apr 2022 19:30:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nf8uZ-00038Q-TE for bug-guix@gnu.org; Thu, 14 Apr 2022 19:30:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nf8uZ-0004rj-Jo for bug-guix@gnu.org; Thu, 14 Apr 2022 19:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nf8uZ-0007OH-FZ for bug-guix@gnu.org; Thu, 14 Apr 2022 19:30:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54728: [PATCH 2/2] gnu: valgrind: fix ld.so symbols not found Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 14 Apr 2022 23:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54728 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 54728-submit@debbugs.gnu.org id=B54728.164997895428306 (code B ref 54728); Thu, 14 Apr 2022 23:30:03 +0000 Received: (at 54728) by debbugs.gnu.org; 14 Apr 2022 23:29:14 +0000 Received: from localhost ([127.0.0.1]:57600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf8tm-0007MU-1B for submit@debbugs.gnu.org; Thu, 14 Apr 2022 19:29:14 -0400 Received: from cyberdimension.org ([80.67.179.20]:60334 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf8tg-0007M4-QC for 54728@debbugs.gnu.org; Thu, 14 Apr 2022 19:29:09 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id 80faa889; Thu, 14 Apr 2022 23:24:52 +0000 (UTC) Received: from primarylaptop.localdomain (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 47db66d8; Thu, 14 Apr 2022 23:24:51 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Fri, 15 Apr 2022 01:30:12 +0200 Message-Id: <20220414233012.13243-2-GNUtoo@cyberdimension.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414233012.13243-1-GNUtoo@cyberdimension.org> References: <20220415012611.6edbf92c@primarylaptop.localdomain> <20220414233012.13243-1-GNUtoo@cyberdimension.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Denis 'GNUtoo' Carikli , 54728@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649979045; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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; bh=gxcHo8h8Y4RZ0qGo3syVeG0W1bV8el0iJq9+6DJLQRI=; b=BVNRdfwcpUFHNvfWAYvP08GU80HnpdQB1jyM8qOPEqjZIHDRr0Mosopr/QBDCUjYWZJzgd D/Lbv/GgqMc9d7OawXIpaBq+g9OUYGeY6fltmXj10zjTeQk2ctFAAy0YOhVtbbdyxG+Xap UV9hXuSdrsZZ0r08Rs6fq6MEWSxSAHUssMWd316gJx33KgpZu2ycC/gmLj4DqJ/7D+cYSb RfwJnmn1aomEmtZCh4LysExhAKtm43QTZUxcoIke+j9I1dY2m+mQ1cRJq/bzDhYXMlnXLf mhKeOoBaDWG+duwTI5NtVExnfymKseVzl8koYk5WGAx74dM8llUVOh9qC8s5lw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649979045; a=rsa-sha256; cv=none; b=LBqcGy+Gaumr+3Wa3PyXc+nKdTHyeBe+K2s71cO2TaFAja3EzDmQQA17wKx0FdF0pRGCde v1OxqpvtA9wdScQstNSlcckHfTxJQ4NwPNgfGlGjykxZEBa1hOP6L9rAUDIrFIT7e8bYGb MYT3areDCIO+PJYrnfVwGz8ONQ14yu9U3V/jJOlSeqerbUGPvH28hIFcm9JqVWbadAc1bn kvJ7sh1WynAHxnRKxkGco8YbaYJZKOyDG27+126ONidc4Ss8zAck0QsIlppW+4wB3bN+U0 1ow1TaQsdbRcW+SROfvBC+v12yiOkiVKDcTV2qnUkQYL0Elb2sNnQ7T5L+j2fw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.34 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9899E18DE8 X-Spam-Score: -2.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: aZg+Gm8h8kCB * gnu/packages/valgrind.scm (valgrind/interactive)[native-inputs]: Add libc:debug [arguments]: Add patch-default-debuginfo-path phase * gnu/packages/commencement.scm (glibc-final): Export variable. Signed-off-by: Denis 'GNUtoo' Carikli --- gnu/packages/commencement.scm | 2 +- gnu/packages/valgrind.scm | 66 +++++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e8b47fbeab..c2de02411c 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3381,7 +3381,7 @@ (define gettext-boot0 (("^PROGRAMS =.*$") "PROGRAMS =\n"))))))))) -(define glibc-final +(define-public glibc-final ;; The final glibc, which embeds the statically-linked Bash built above. ;; Use 'package/inherit' so we get the 'replacement' of 'glibc', if any. (package/inherit diff --git a/gnu/packages/valgrind.scm b/gnu/packages/valgrind.scm index 6648f17dfa..a09721071d 100644 --- a/gnu/packages/valgrind.scm +++ b/gnu/packages/valgrind.scm @@ -25,8 +25,10 @@ (define-module (gnu packages valgrind) #:use-module (guix build-system gnu) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix licenses) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages gdb) #:use-module (gnu packages perl)) @@ -91,12 +93,64 @@ (define-public valgrind (properties '((hidden? . #t))))) (define-public valgrind/interactive - (package/inherit - valgrind - (inputs - ;; GDB is needed to provide a sane default for `--db-command'. - `(("gdb" ,gdb))) - (properties '()))) + (package/inherit valgrind + (inputs + ;; GDB is needed to provide a sane default for `--db-command'. + `(("gdb" ,gdb) + ("libc:debug" ,(@@ (gnu packages commencement) glibc-final) "debug"))) + (arguments + (substitute-keyword-arguments (package-arguments valgrind) + ((#:phases those-phases #~%standard-phases) + #~(let* ((those-phases #$those-phases) + (unpack (assoc-ref those-phases 'unpack))) + (modify-phases those-phases + (add-before 'build 'patch-default-debuginfo-path + (lambda _ + ;; This helps Valgrind find the debug symbols of ld.so. + ;; Without it, Valgrind does not work in a Guix shell + ;; container and cannot be used as-is during packages tests + ;; phases + (substitute* ' + ("coregrind/m_debuginfo/readelf.c" + "docs/xml/manual-core-adv.xml" + "docs/xml/manual-core.xml") + (("/usr/lib/debug") + (string-append + (assoc-ref %build-inputs "libc:debug") + "/lib/debug"))) + ;; We also need to account for the bigger path in + ;; the malloc-ed variables + (substitute* ' + ("coregrind/m_debuginfo/readelf.c") + (("VG_\\(strlen\\)\\(buildid\\) \\+ 33") + (string-append + "VG_(strlen)(buildid) + " + (number->string + (+ (string-length + (string-append + (assoc-ref %build-inputs "libc:debug") + "/lib/debug")) + (string-length "/.build-id//.debug") + 1))))) + (substitute* ' + ("coregrind/m_debuginfo/readelf.c") + ((string-append + "VG_\\(strlen\\)\\(objdir\\) \\+ " + "VG_\\(strlen\\)\\(debugname\\) \\+ 64") + (string-append + "VG_(strlen)(objdir) + VG_(strlen)(debugname) + " + (number->string + (+ (string-length + (string-append + (assoc-ref + %build-inputs + "libc:debug") + "/lib/debug")) + (string-length + "/usr/lib/debug") + 1))))) + #t))))))) + (properties '()))) (define-public valgrind-3.18 (package -- 2.35.1