From 67843259ad477affa54a9c30e31b75f7fc2762c3 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 25 Aug 2022 08:09:14 +0100 Subject: [PATCH] bpftrace: pull upstream fix for binutils-2.39 Without the change build fails on binutils-2.39 branch as: jit_disasm.c:105:17: error: too few arguments to function 'init_disassemble_info' 105 | init_disassemble_info(&info, stdout, | ^~~~~~~~~~~~~~~~~~~~~ --- pkgs/os-specific/linux/bpftrace/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/bpftrace/default.nix b/pkgs/os-specific/linux/bpftrace/default.nix index 6cc9e40bdbf..2772c587ca8 100644 --- a/pkgs/os-specific/linux/bpftrace/default.nix +++ b/pkgs/os-specific/linux/bpftrace/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub +{ lib, stdenv, fetchFromGitHub, fetchpatch , cmake, pkg-config, flex, bison , llvmPackages, elfutils , libbfd, libbpf, libopcodes, bcc @@ -36,6 +36,17 @@ stdenv.mkDerivation rec { sha256 = "sha256-9adZAKSn00W2yNwVDbVB1/O5Y+10c4EkVJGCHyd4Tgg="; }; + patches = [ + # Pull upstream fix for binutils-2.39: + # https://github.com/iovisor/bpftrace/pull/2328 + (fetchpatch { + name = "binutils-2.39.patch"; + url = "https://github.com/iovisor/bpftrace/commit/3be6e708d514d3378a4fe985ab907643ecbc77ee.patch"; + sha256 = "sha256-WWEh8ViGw8053nEG/29KeKEHV5ossWPtL/AAV/l+pnY="; + excludes = [ "CHANGELOG.md" ]; + }) + ]; + buildInputs = with llvmPackages; [ llvm libclang elfutils bcc