async-profiler: fix darwin build

authored by Uri Baghin and committed by Jonathan Ringer 51e20564 2af2325c

+32
+27
pkgs/development/tools/async-profiler/0001-Fix-darwin-build.patch
···
··· 1 + From e54c17899118ea940c36bc17a48d8ff759243f16 Mon Sep 17 00:00:00 2001 2 + From: Uri Baghin <uri@canva.com> 3 + Date: Sat, 8 May 2021 09:49:18 +1000 4 + Subject: [PATCH] Fix darwin build. 5 + 6 + --- 7 + src/itimer.cpp | 4 ++-- 8 + 1 file changed, 2 insertions(+), 2 deletions(-) 9 + 10 + diff --git a/src/itimer.cpp b/src/itimer.cpp 11 + index 08c46d1..52628ef 100644 12 + --- a/src/itimer.cpp 13 + +++ b/src/itimer.cpp 14 + @@ -52,8 +52,8 @@ Error ITimer::start(Arguments& args) { 15 + 16 + OS::installSignalHandler(SIGPROF, signalHandler); 17 + 18 + - long sec = _interval / 1000000000; 19 + - long usec = (_interval % 1000000000) / 1000; 20 + + time_t sec = _interval / 1000000000; 21 + + suseconds_t usec = (_interval % 1000000000) / 1000; 22 + struct itimerval tv = {{sec, usec}, {sec, usec}}; 23 + 24 + if (setitimer(ITIMER_PROF, &tv, NULL) != 0) { 25 + -- 26 + 2.31.1 27 +
+5
pkgs/development/tools/async-profiler/default.nix
··· 22 runHook postInstall 23 ''; 24 25 fixupPhase = '' 26 substituteInPlace $out/bin/async-profiler \ 27 --replace 'JATTACH=$SCRIPT_DIR/build/jattach' \
··· 22 runHook postInstall 23 ''; 24 25 + patches = [ 26 + # https://github.com/jvm-profiling-tools/async-profiler/pull/428 27 + ./0001-Fix-darwin-build.patch 28 + ]; 29 + 30 fixupPhase = '' 31 substituteInPlace $out/bin/async-profiler \ 32 --replace 'JATTACH=$SCRIPT_DIR/build/jattach' \