Commit 9b3c45be authored by ghpzin's avatar ghpzin Committed by Masum Reza
Browse files

oprofile: fix build with gcc14

- add patch similar to upstream commit
https://sourceforge.net/p/oprofile/oprofile/ci/b0acf9f0c0aac93bf6f3e196d7a52c9632ff4475
patch from commit does not work as is because tarball used for build
has `configure` inside and changes to `configure.ac` do not affect it
parent 0a23e921
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,12 @@ stdenv.mkDerivation rec {
    sha256 = "04m46ni0ryk4sqmzd6mahwzp7iwhwqzfbmfi42fki261sycnz83v";
  };

  patches = [
    # fix configurePhase with gcc14:
    # https://sourceforge.net/p/oprofile/oprofile/ci/b0acf9f0c0aac93bf6f3e196d7a52c9632ff4475/
    ./fix-autoconf-detection-of-perf_events.patch
  ];

  postPatch = ''
    substituteInPlace opjitconv/opjitconv.c \
      --replace "/bin/rm" "${buildPackages.coreutils}/bin/rm" \
+12 −0
Original line number Diff line number Diff line
diff --git a/configure b/configure
index cf36d5ea43..bb59613ef6 100755
--- a/configure
+++ b/configure
@@ -17215,6 +17215,7 @@
 		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <linux/perf_event.h>
+				#include <unistd.h>
 				#include <asm/unistd.h>
 				#include <sys/types.h>
 				#include <string.h>