all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 70962@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Leo Famulari <leo@famulari.name>,
	Tobias Geerinckx-Rice <me@tobias.gr>, Wilko Meyer <w@wmeyer.eu>
Subject: [bug#70962] [PATCH 08/14] gnu: Add dwarves.
Date: Wed, 15 May 2024 12:57:18 -0400	[thread overview]
Message-ID: <da7c12a106cad1c90bfc5cbc60e944683437d533.1715791830.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com>

* 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





  parent reply	other threads:[~2024-05-15 17:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 16:51 [bug#70962] [PATCH 01/14] gnu: grpc: Modernize Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 02/14] gnu: grpc: Propagate abseil-cpp-cxxstd11 Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 03/14] gnu: Add valijson Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 04/14] gnu: libbpf: Use gexps Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 05/14] gnu: libbpf: Update to 1.4.1 Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 06/14] gnu: Add falcosecurity-libs Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 07/14] gnu: Add sysdig Maxim Cournoyer
2024-05-15 16:57 ` Maxim Cournoyer [this message]
2024-05-15 16:57 ` [bug#70962] [PATCH 09/14] gnu: make-linux-libre*: Set KBUILD_BUILD_VERSION for reproducibility Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 10/14] gnu: make-linux-libre*: Run install targets in parallel Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 11/14] gnu: linux: Turn %default-extra-linux-options into a procedure Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 12/14] gnu: linux-libre: Enable BTF debug info Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 13/14] gnu: linux-libre: Enable Zstd compression of kernel modules Maxim Cournoyer
2024-05-15 16:57 ` [bug#70962] [PATCH 14/14] gnu: linux-libre-with-bpf: Deprecate in favor of linux-libre Maxim Cournoyer
2024-05-15 17:20 ` [bug#70964] [PATCH 00/14] Add BTF support to kernel, sysdig and dependents, zstd-compressed modules Maxim Cournoyer
2024-05-15 18:30   ` [bug#70962] " Maxim Cournoyer
2024-05-30  2:05   ` bug#70962: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da7c12a106cad1c90bfc5cbc60e944683437d533.1715791830.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=70962@debbugs.gnu.org \
    --cc=leo@famulari.name \
    --cc=me@tobias.gr \
    --cc=w@wmeyer.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.