diff --git a/package/oprofile/0003-Fix-autoconf-detection-of-perf_events.patch b/package/oprofile/0003-Fix-autoconf-detection-of-perf_events.patch new file mode 100644 index 0000000000..759aba5c4b --- /dev/null +++ b/package/oprofile/0003-Fix-autoconf-detection-of-perf_events.patch @@ -0,0 +1,40 @@ +From b0acf9f0c0aac93bf6f3e196d7a52c9632ff4475 Mon Sep 17 00:00:00 2001 +From: Tony Jones +Date: Fri, 8 Nov 2024 13:13:30 -0800 +Subject: [PATCH] Fix autoconf detection of perf_events + +The autoconf check for the presence of perf_events api began failing +on recent openSUSE builds. + +checking kernel supports perf_events... conftest.c: In function 'main': +conftest.c:37:39: error: implicit declaration of function 'getpid' [-Wimplicit-function-declaration] + 37 | pid = getpid(); + | ^~~~~~ +conftest.c:38:33: error: implicit declaration of function 'syscall' [-Wimplicit-function-declaration] + 38 | syscall(__NR_perf_event_open, &attr, pid, 0, -1, 0); + | ^~~~~~~ +no +Error: Your kernel does not appear to have the necessary support to run oprofile. + +Upstream: https://sourceforge.net/p/oprofile/oprofile/ci/b0acf9f0c0aac93bf6f3e196d7a52c9632ff4475/ + +Signed-off-by: Bernd Kuhls +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index dc447f89..363bd440 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -116,6 +116,7 @@ if test "$kernel_may_have_perf_events_support" = "yes"; then + rm -f test-for-PERF_EVENT_OPEN + AC_LANG_CONFTEST( + [AC_LANG_PROGRAM([[#include ++ #include + #include + #include + #include +-- +2.47.3 + diff --git a/package/oprofile/oprofile.mk b/package/oprofile/oprofile.mk index 590e63b4ac..72cdc856c3 100644 --- a/package/oprofile/oprofile.mk +++ b/package/oprofile/oprofile.mk @@ -13,6 +13,7 @@ OPROFILE_CONF_OPTS = \ --disable-account-check \ --with-kernel=$(STAGING_DIR)/usr # 0002-fix-static-build-with-binutils-2.40.patch +# 0003-Fix-autoconf-detection-of-perf_events.patch OPROFILE_AUTORECONF = YES define OPROFILE_CREATE_MISSING_FILES