From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id mG6vElvqRGbfhQAAqHPOHw:P1 (envelope-from ) for ; Wed, 15 May 2024 19:01:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mG6vElvqRGbfhQAAqHPOHw (envelope-from ) for ; Wed, 15 May 2024 19:01:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=S5HkvqD0; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715792475; 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:dkim-signature; bh=saP5NNXJ+XzpRkPaysozWLBPOJh4YBQFWsZ8dBFdN7M=; b=l4rC2OWP+BZkJH6wweAnW3jQ/vrlnEkDtGr9ol68aylufBLJ3WWbL99ueJf1LnyQIm6xfi UXK9wolf8S6944dFtFzInuftv1JGBSWSby2Dnn3fGPd239QYhLN13oeF60ezwYDirOD+mD 3/XFCkA1lSlQ32ipqpAGiznMOTMQ8D13aNBqJsWZFWIRgv27qa4glYi+ex1CvbPVEe6vxM 2zOkJsLVb34zMIW2aOzgS/afgQ5UMCcrx7oyjmiJzHHH8dUCk3ulD/nc8XhKEnatlU9Bch 95TbcHx8hh3pSaf8UAO1QG3AW958kT6mdIu/4L0HTqp2EZ7a5sY7iS8ISvBv6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=S5HkvqD0; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715792475; a=rsa-sha256; cv=none; b=bNCqZMJRjnUQFHwfHn8+xLySNAkRj35D1KRfmLeHPP8wzl1YpYKNSMtTqBK3Ji/qPGmfWJ i/CXp07Gdqj0tWJJCc7lw2HV1ZgMGjs/H67MxY/08ewV0Fse4lwZul1HrswtHL9ZhohOkj 3sh9QX+lMML11ArqvdKCqV86gASJCWWIs9yCk5gW8mPqDT/E8WlzSu0IYDphW214QPyIwj scTql/wgEet/+MCFZ5mPZu0pjB2qMQ9tGuRGQnZoT+/tqnAIzv6bk9ps3Iogy27AslR43f ATIVBmxJ2VY/n7PtbiSmTYBuo87Dm7B7vAipNMufo4dxYZu352hhkeQekXlXrA== 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 1691C5157D for ; Wed, 15 May 2024 19:01:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7HzC-0001rS-5M; Wed, 15 May 2024 13:00:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7Hz5-0001os-O2 for guix-patches@gnu.org; Wed, 15 May 2024 13:00:09 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7Hz1-0007Fr-Pn for guix-patches@gnu.org; Wed, 15 May 2024 13:00:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7Hz3-0007C3-FL; Wed, 15 May 2024 13:00:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70962] [PATCH 08/14] gnu: Add dwarves. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: leo@famulari.name, me@tobias.gr, w@wmeyer.eu, guix-patches@gnu.org Resent-Date: Wed, 15 May 2024 17:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70962 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70962@debbugs.gnu.org Cc: Maxim Cournoyer , Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer X-Debbugs-Original-Xcc: Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer Received: via spool by 70962-submit@debbugs.gnu.org id=B70962.171579237027500 (code B ref 70962); Wed, 15 May 2024 17:00:05 +0000 Received: (at 70962) by debbugs.gnu.org; 15 May 2024 16:59:30 +0000 Received: from localhost ([127.0.0.1]:43167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyU-00079T-10 for submit@debbugs.gnu.org; Wed, 15 May 2024 12:59:30 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:43035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyO-00078W-Tc for 70962@debbugs.gnu.org; Wed, 15 May 2024 12:59:25 -0400 Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-792bd82402cso482116685a.0 for <70962@debbugs.gnu.org>; Wed, 15 May 2024 09:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715792297; x=1716397097; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=saP5NNXJ+XzpRkPaysozWLBPOJh4YBQFWsZ8dBFdN7M=; b=S5HkvqD0M2zUS2PQ6HRQX7jDtr79veKP0MIW9HRYeaHQ/hTY6xEbmBWDkcvcOrteCC +iNjjOMHmInMQLbfzwCGu4cenhhgfUxyCjwnfMtBCBREWBL4OTtvVXVVnP13AC5JfFNv gIiHzE8gK9wFJFWdUlZIRHzBbNrE7QRNvpbkreLpeL8sdXc0Qwevn6GnQRGliOkVjG+G 7OM2hyUiQZqakZg8qqeLty38QO5KSXxcHsfvYG5Y6wn9cMdhweoExMeYBAaL6bJijJ33 MqWCdBl7rrxCw3loSJi4cQA8lADK4mQu5cq9ic7vdlf2TWHv2v+RnIfAYi0ejebw4wWH WOBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715792297; x=1716397097; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=saP5NNXJ+XzpRkPaysozWLBPOJh4YBQFWsZ8dBFdN7M=; b=iafNBY6apB1oCKIpnWiKK80l8sn8IDjIp7ctEnupwgspfBXnuE4qqUGvEV5Ddd4tXV a5m+opLSUf98pjYS4e43elSwnq8NarsoVKGKGyNt/mnp6pkJEiVM6VAHe2Bh4tYlQkSA xJU2xCuGyLO588Wchoj8qCeFfx7tvMzEpvLD9LTgdJCTcqBL6/B/VsoPwhe2I1fMxnDN dsAdfXUD7PU3bokPCaB31uiyAmc0pEFM8sEaQc1IEXb8u3YkZcd6bYK8/5kSij2iS7dA mJPrAXRoBkkHGBoiesX6LmNNRWR5uRHQTDcE9ItIKnNlsaSrHs1A/gjDOkOi0afxU+2c 0bYw== X-Gm-Message-State: AOJu0Yyb0OCrplM91kJhnr+Kku+s3ox8APeQF/DnY5sz1rMyeO9Vy/si nNKl3jU9+UkeH4UjhagK1gZKWfNRsHzbsNanlUVATJZpRGj2RKlKl/b++g== X-Google-Smtp-Source: AGHT+IHo0tuMkPdaL9IcgkFE6WqnRhoBn79P5xAy1wLPGag3uwR0fM/S0eaeE1tTgAfKr583OrOTdQ== X-Received: by 2002:a05:6214:398c:b0:6a0:f637:667 with SMTP id 6a1803df08f44-6a33d607dc9mr169176426d6.12.1715792297062; Wed, 15 May 2024 09:58:17 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194871sm66068896d6.59.2024.05.15.09.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 09:58:16 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 15 May 2024 12:57:18 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> References: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> 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: 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 6.13 X-Spam-Score: 6.13 X-Migadu-Queue-Id: 1691C5157D X-Migadu-Scanner: mx13.migadu.com X-TUID: kKjoZ8k+0Zpa * gnu/packages/linux.scm (dwarves): New variable. Change-Id: Ib2452868eae76bea95060a70e568dfb6e84b2a75 --- gnu/local.mk | 1 + gnu/packages/linux.scm | 48 +++++++++++++++++++ .../dwarves-threading-reproducibility.patch | 23 +++++++++ 3 files changed, 72 insertions(+) create mode 100644 gnu/packages/patches/dwarves-threading-reproducibility.patch diff --git a/gnu/local.mk b/gnu/local.mk index 81960e1c9b..1531da2f87 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1123,6 +1123,7 @@ dist_patch_DATA = \ %D%/packages/patches/dune-istl-fix-solver-playground.patch \ %D%/packages/patches/durden-shadow-arcan.patch \ %D%/packages/patches/dvd+rw-tools-add-include.patch \ + %D%/packages/patches/dwarves-threading-reproducibility.patch \ %D%/packages/patches/dynaconf-unvendor-deps.patch \ %D%/packages/patches/dyninst-fix-glibc-compatibility.patch \ %D%/packages/patches/efivar-211.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index a51ce5c27a..5119e7f575 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2376,6 +2376,54 @@ (define-public dislocker partitions. Write functionality is also provided but check the README.") (license license:gpl2+))) +(define-public dwarves + (package + (name "dwarves") + (version "1.26") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/acmel/dwarves") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0xfq0r3whc3dk922ss8i5vwyfcqhgc95dy27mm69j5niy7i5kzrd")) + (patches + (search-patches "dwarves-threading-reproducibility.patch")))) + (build-system cmake-build-system) + (arguments (list #:configure-flags #~(list "-D__LIB=lib" + "-DLIBBPF_EMBEDDED=OFF") + #:tests? #f)) ;no test suite + (native-inputs (list pkg-config)) + (inputs (list libbpf)) + (home-page "https://github.com/acmel/dwarves") + (synopsis "Debugging information processing library and utilities") + (description "Dwarves is a set of tools that use the debugging information +inserted in ELF binaries by compilers such as GCC, used by well known +debuggers such as GDB. + +Utilities in the Dwarves suite include @command{pahole}, that can be used to +find alignment holes in structures and classes in languages such as C, C++, +but not limited to these. These tools can also be used to encode and read the +BTF type information format used with the kernel Linux @code{bpf} syscall. + +The @command{codiff} command can be used to compare the effects changes in +source code generate on the resulting binaries. + +The @command{pfunct} command can be used to find all sorts of information +about functions, inlines, decisions made by the compiler about inlining, etc. + +The @command{pahole} command can be used to use all this type information to +pretty print raw data according to command line directions. + +Headers can have its data format described from debugging info and offsets from +it can be used to further format a number of records. + +Finally, the @command{btfdiff} command can be used to compare the output of +pahole from BTF and DWARF, to make sure they produce the same results. ") + (license license:gpl2+))) + (define-public fbset (package (name "fbset") diff --git a/gnu/packages/patches/dwarves-threading-reproducibility.patch b/gnu/packages/patches/dwarves-threading-reproducibility.patch new file mode 100644 index 0000000000..8771ca6b0d --- /dev/null +++ b/gnu/packages/patches/dwarves-threading-reproducibility.patch @@ -0,0 +1,23 @@ +Retrieved from nixpkgs. + +This causes pahole to use '-j1' (single thread) when SOURCE_DATE_EPOCH +is set, to ensure it produces reproducible output. + +diff --git a/pahole.c b/pahole.c +index 6fc4ed6..a4e306f 100644 +--- a/pahole.c ++++ b/pahole.c +@@ -1687,8 +1687,11 @@ static error_t pahole__options_parser(int key, char *arg, + class_name = arg; break; + case 'j': + #if _ELFUTILS_PREREQ(0, 178) +- conf_load.nr_jobs = arg ? atoi(arg) : +- sysconf(_SC_NPROCESSORS_ONLN) * 1.1; ++ // Force single thread if reproducibility is desirable. ++ if (!getenv("SOURCE_DATE_EPOCH")) { ++ conf_load.nr_jobs = arg ? atoi(arg) : ++ sysconf(_SC_NPROCESSORS_ONLN) * 1.1; ++ } + #else + fputs("pahole: Multithreading requires elfutils >= 0.178. Continuing with a single thread...\n", stderr); + #endif -- 2.41.0