summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorLéo Gaspard <leo@gaspard.io>2018-04-27 23:52:50 +0200
committerLéo Gaspard <leo@gaspard.io>2018-04-28 00:10:40 +0200
commit4317f7ab26942b4fad23f616932a1df1611bd44b (patch)
tree330039da7448c93cd8865cb2bcc07d9694de12b5 /pkgs/development/tools
parentbe0b3e3cd0d784333c151d1c7cc7e45b6af189ed (diff)
downloadnixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar.gz
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar.bz2
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar.lz
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar.xz
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.tar.zst
nixlib-4317f7ab26942b4fad23f616932a1df1611bd44b.zip
kcov: fix build on aarch64
Apparently, without this patch `NT_PRSTATUS` is not found. So the patch
adds the include apparently necessary. `NT_PRSTATUS` is also defined in
`<linux/ptrace.h>`, which would likely have been a better name, were it
not in the `linux/` directory, which is a priori not stable.

The need to do that is kind of weird (the change was introduced in [1],
and fedora apparently didn't need this additional import), but I'll try
to upstream it.

[1] https://github.com/SimonKagstrom/kcov/pull/239
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/analysis/kcov/aarch64_nt_prstatus.patch12
-rw-r--r--pkgs/development/tools/analysis/kcov/default.nix2
2 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/development/tools/analysis/kcov/aarch64_nt_prstatus.patch b/pkgs/development/tools/analysis/kcov/aarch64_nt_prstatus.patch
new file mode 100644
index 000000000000..d5c3662e9abf
--- /dev/null
+++ b/pkgs/development/tools/analysis/kcov/aarch64_nt_prstatus.patch
@@ -0,0 +1,12 @@
+diff --git a/src/engines/ptrace.cc b/src/engines/ptrace.cc
+index 59b615f..e02cddf 100644
+--- a/src/engines/ptrace.cc
++++ b/src/engines/ptrace.cc
+@@ -21,6 +21,7 @@
+ 
+ #if defined(__aarch64__)
+ #  include <sys/uio.h>
++#  include <elf.h>
+ #endif
+ 
+ #include <map>
diff --git a/pkgs/development/tools/analysis/kcov/default.nix b/pkgs/development/tools/analysis/kcov/default.nix
index ce391b938cae..7d75d9a34e1a 100644
--- a/pkgs/development/tools/analysis/kcov/default.nix
+++ b/pkgs/development/tools/analysis/kcov/default.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib curl elfutils python libiberty libopcodes ];
 
+  patches = [ ./aarch64_nt_prstatus.patch ];
+
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {