aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/oprofile
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-kernel/oprofile')
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch34
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile/0001-configure-Include-unistd.h-for-getpid-API.patch28
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile/0011-replace-__FILE__-with-__FILE_NAME__.patch47
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb14
4 files changed, 119 insertions, 4 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch
new file mode 100644
index 0000000000..930b90e289
--- /dev/null
+++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch
@@ -0,0 +1,34 @@
+From 5d879cb4f23c613e16b3f479ab09bbb5ff340201 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Feb 2023 17:02:41 -0800
+Subject: [PATCH] Replace std::bind2nd with generic lambda
+
+std::bind2nd is gone in c++17, therefore stop using it and replace it
+with generic lambda from c++14 onwards
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libutil++/growable_vector.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h
+index 350246a..9846e1e 100644
+--- a/libutil++/growable_vector.h
++++ b/libutil++/growable_vector.h
+@@ -93,9 +93,9 @@ public:
+
+ /// return true if all elements have the default constructed value
+ bool zero() const {
+- return std::find_if(container.begin(), container.end(),
+- std::bind2nd(std::not_equal_to<T>(), T()))
+- == container.end();
++ return std::find_if(begin(container), end(container),
++ [&](auto const& elem) {return elem != T();})
++ == end(container);
+ }
+
+ private:
+--
+2.39.1
+
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-configure-Include-unistd.h-for-getpid-API.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-configure-Include-unistd.h-for-getpid-API.patch
new file mode 100644
index 0000000000..0ac03bde50
--- /dev/null
+++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-configure-Include-unistd.h-for-getpid-API.patch
@@ -0,0 +1,28 @@
+From 46f0aadf80d5e28f587149b6e90c3ba005971f6e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Sep 2022 19:22:17 -0700
+Subject: [PATCH] configure: Include unistd.h for getpid API
+
+This fixes the check for perf events support in configure
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index e4f4024..3384628 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -119,6 +119,7 @@ if test "$kernel_may_have_perf_events_support" = "yes"; then
+ #include <asm/unistd.h>
+ #include <sys/types.h>
+ #include <string.h>
++ #include <unistd.h>
+ ]],
+ [[struct perf_event_attr attr;
+ pid_t pid;
+--
+2.37.3
+
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0011-replace-__FILE__-with-__FILE_NAME__.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0011-replace-__FILE__-with-__FILE_NAME__.patch
new file mode 100644
index 0000000000..902032969e
--- /dev/null
+++ b/meta-oe/recipes-kernel/oprofile/oprofile/0011-replace-__FILE__-with-__FILE_NAME__.patch
@@ -0,0 +1,47 @@
+From 640b116618b89eeddd61a91b793bb3c879adfe57 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 7 May 2024 19:56:59 -0700
+Subject: [PATCH] replace __FILE__ with __FILE_NAME__
+
+This helps build paths not beeing assumed during runtime
+since in cross-builds its possible that absolute paths during
+build will not match runtime paths
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libutil++/tests/file_manip_tests.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libutil++/tests/file_manip_tests.cpp b/libutil++/tests/file_manip_tests.cpp
+index dfe161b..3d960bc 100644
+--- a/libutil++/tests/file_manip_tests.cpp
++++ b/libutil++/tests/file_manip_tests.cpp
+@@ -138,9 +138,9 @@ static void is_directory_tests()
+ static input_output<pair<string, string>, bool>
+ expect_is_files_identical[] = {
+ #define MAKE_PAIR(a, b) make_pair(string(a), string(b))
+- { MAKE_PAIR(__FILE__, __FILE__), true },
+- { MAKE_PAIR(__FILE__, "not_existing"), false },
+- { MAKE_PAIR("not_exisiting", __FILE__), false },
++ { MAKE_PAIR(__FILE_NAME__, __FILE_NAME__), true },
++ { MAKE_PAIR(__FILE_NAME__, "not_existing"), false },
++ { MAKE_PAIR("not_exisiting", __FILE_NAME__), false },
+ { MAKE_PAIR("not_exisiting", "not_existing"), false },
+ { MAKE_PAIR("", ""), false }
+ #undef MAKE_PAIR
+@@ -163,8 +163,8 @@ void is_files_identical_tests(char const * prog_name)
+
+ static input_output<char const *, bool> expect_op_file_readable[] =
+ {
+- { __FILE__, true },
+- { "./" __FILE__, true },
++ { __FILE_NAME__, true },
++ { "./" __FILE_NAME__, true },
+ { ".", false },
+ { "/.", false },
+ { "./", false },
+--
+2.45.0
+
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb
index 23e7d3d5c3..45f70aa381 100644
--- a/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb
+++ b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb
@@ -30,6 +30,9 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
file://0008-include-linux-limits.h-for-MAX_INPUT.patch \
file://0009-Prevent-running-check-tests-on-host-if-cross-compili.patch \
file://0010-oprofile-Determine-the-root-home-directory-dynamical.patch \
+ file://0011-replace-__FILE__-with-__FILE_NAME__.patch \
+ file://0001-configure-Include-unistd.h-for-getpid-API.patch \
+ file://0001-Replace-std-bind2nd-with-generic-lambda.patch \
"
SRC_URI[sha256sum] = "7ba06f99d7c188389d20d1d5e53ee690c7733f87aa9af62bd664fa0ca235a412"
@@ -40,7 +43,7 @@ inherit autotools pkgconfig ptest
EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC="
do_configure () {
- cp ${WORKDIR}/acinclude.m4 ${S}/
+ cp ${UNPACKDIR}/acinclude.m4 ${S}/
autotools_do_configure
}
@@ -56,16 +59,18 @@ do_install_ptest() {
find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH}
done
- # needed by some libop tests
- cp -r events ${D}${PTEST_PATH}
-
+ install -d ${D}${PTEST_PATH}/../${BP}/events ${D}${PTEST_PATH}/../${BP}/libutil++/tests
# needed by libregex regex_test
cp libregex/stl.pat ${D}${PTEST_PATH}/libregex
cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests
# needed by litutil++ file_manip_tests
cp ${S}/libutil++/tests/file_manip_tests.cpp \
+ libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/../${BP}/libutil++/tests
+ cp ${S}/libutil++/tests/file_manip_tests.cpp \
libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests
+ # needed by some libop tests
+ cp -R --no-dereference --preserve=mode,links -v ${S}/events ${D}${PTEST_PATH}/../${BP}
}
RDEPENDS:${PN} = "binutils-symlinks"
@@ -73,3 +78,4 @@ RDEPENDS:${PN} = "binutils-symlinks"
FILES:${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
FILES:${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
FILES:${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
+FILES:${PN}-ptest += "${libdir}/${BPN}/${BP}"