summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWen Yang <wen.yang@linux.dev>2025-07-01 01:22:24 +0800
committerKhem Raj <raj.khem@gmail.com>2025-07-01 08:11:11 -0700
commit005603e4b2753414fb2c520fa6a22938534c2b8d (patch)
tree89b601c1d7460bb6a09a33f5924f86be64c2b862
parentb29ce87bb40a964a45f16585ed04c969ed576863 (diff)
downloadmeta-openembedded-005603e4b2753414fb2c520fa6a22938534c2b8d.tar.gz
pstack: add recipe
This recipe provides pstack for C/C++, Go, Rust, and Python. Signed-off-by: Wen Yang <wen.yang@linux.dev> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/pstack/files/0001-tests-fix-the-issue-of-cross-compilation-failure.patch28
-rw-r--r--meta-oe/recipes-devtools/pstack/pstack.inc39
-rw-r--r--meta-oe/recipes-devtools/pstack/pstack_2.10.bb33
-rw-r--r--meta-oe/recipes-devtools/pstack/pstack_git.bb8
4 files changed, 108 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/pstack/files/0001-tests-fix-the-issue-of-cross-compilation-failure.patch b/meta-oe/recipes-devtools/pstack/files/0001-tests-fix-the-issue-of-cross-compilation-failure.patch
new file mode 100644
index 0000000000..2b54750e7a
--- /dev/null
+++ b/meta-oe/recipes-devtools/pstack/files/0001-tests-fix-the-issue-of-cross-compilation-failure.patch
@@ -0,0 +1,28 @@
1From a8c3996d3f8d9b8f3a2888b7062c1139263c5aba Mon Sep 17 00:00:00 2001
2From: Wen Yang <yellowriver2010@hotmail.com>
3Date: Mon, 23 Jun 2025 02:06:53 +0800
4Subject: [PATCH] tests: fix the issue of cross compilation failure
5
6By replacing objcopy with MAKE_OBJCOPY, pstack could support both
7native and cross compilation.
8
9Upstream-Status: Backport [https://github.com/peadar/pstack/pull/38]
10---
11 tests/CMakeLists.txt | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
15index 71a62a7..bf11a04 100644
16--- a/tests/CMakeLists.txt
17+++ b/tests/CMakeLists.txt
18@@ -38,7 +38,7 @@ SET_TARGET_PROPERTIES(noreturn PROPERTIES COMPILE_FLAGS "-O2 -g")
19
20 add_custom_command(
21 OUTPUT basic-no-unwind-gen
22- COMMAND objcopy --strip-debug --remove-section .eh_frame basic basic-no-unwind
23+ COMMAND ${CMAKE_OBJCOPY} --strip-debug --remove-section .eh_frame basic basic-no-unwind
24 VERBATIM )
25
26 add_custom_target(basic-no-unwind ALL DEPENDS basic basic-no-unwind-gen)
27--
282.25.1
diff --git a/meta-oe/recipes-devtools/pstack/pstack.inc b/meta-oe/recipes-devtools/pstack/pstack.inc
new file mode 100644
index 0000000000..9831a74d1a
--- /dev/null
+++ b/meta-oe/recipes-devtools/pstack/pstack.inc
@@ -0,0 +1,39 @@
1SUMMARY = "A utility to print stack traces of running processes"
2DESCRIPTION = "A from-scratch implementation of pstack using DWARF debugging and unwind information. \
3Works for C/C++, Go, Rust, and Python. A traditional pstack command can generally print a backtrace \
4of each thread in a running program, and sometimes from a core file. This version of pstack uses its \
5own self contained ELF and DWARF parsing library, libdwelf to parse the DWARF debug and unwind \
6information, to get a stack trace."
7HOMEPAGE = "https://github.com/peadar/pstack"
8SECTION = "devel"
9LICENSE = "BSD-2-Clause"
10LIC_FILES_CHKSUM = "file://LICENSE;md5=671019a96ba80415b696240ed2ca5e80"
11
12inherit cmake
13
14S = "${UNPACKDIR}/${BPN}-${PV}"
15DEPENDS += "zlib xz libunwind elfutils"
16
17RDEPENDS:${PN} += "elfutils"
18
19do_install() {
20 install -d ${D}${bindir}
21 install -m 0755 ${B}/pstack ${D}${bindir}/pstack
22
23 install -d ${D}${libdir}
24 install -m 0755 ${B}/libprocman.so.${PV} ${D}${libdir}/libprocman.so.${PV}
25 ln -sf libprocman.so.${PV} ${D}${libdir}/libprocman.so
26 install -m 0755 ${B}/libdwelf.so.${PV} ${D}${libdir}/libdwelf.so.${PV}
27 ln -sf libdwelf.so.${PV} ${D}${libdir}/libdwelf.so
28}
29
30PACKAGES = "${PN}"
31FILES:${PN} = "${bindir}/pstack"
32FILES:${PN} += "${libdir}/libprocman.so.${PV}"
33FILES:${PN} += "${libdir}/libdwelf.so.${PV}"
34
35PACKAGES += "${PN}-dbg"
36FILES:${PN}-dbg += "${base_bindir}/.debug ${base_sbindir}/.debug ${bindir}/.debug ${sbindir}/.debug"
37
38PACKAGES += "${PN}-dev"
39FILES:${PN}-dev += "${base_libdir}/*.so"
diff --git a/meta-oe/recipes-devtools/pstack/pstack_2.10.bb b/meta-oe/recipes-devtools/pstack/pstack_2.10.bb
new file mode 100644
index 0000000000..cebc13d36c
--- /dev/null
+++ b/meta-oe/recipes-devtools/pstack/pstack_2.10.bb
@@ -0,0 +1,33 @@
1SUMMARY = "A from-scratch implementation of pstack using DWARF debugging \
2and unwind information. Works for C/C++, Go, Rust, and Python."
3
4HOMEPAGE = "https://github.com/peadar/pstack"
5SECTION = "devel/pstack"
6
7LICENSE = "BSD-2-Clause"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=ea061f8731d5e6a5761dfad951ef5f5f"
9
10DEPENDS = "tcl virtual/libx11 libxt zip-native"
11
12SRC_URI = "git://github.com/peadar/pstack;branch=master;tag=v${PV};protocol=https"
13SRCREV = "a310df637d74917a1d3570c540bf3aef899d7e63"
14
15S = "${WORKDIR}/${BPN}${PV}"
16
17PACKAGES =+ "${PN}-lib"
18
19SOLIBS = ".so"
20FILES_SOLIBSDEV = ""
21
22# isn't getting picked up by shlibs code
23RDEPENDS:${PN} += "tk-lib"
24RDEPENDS:${PN}:class-native = ""
25
26BBCLASSEXTEND = "native nativesdk"
27
28inherit binconfig
29
30SYSROOT_DIRS += "${bindir_crossscripts}"
31
32# Fix some paths that might be used by Tcl extensions
33BINCONFIG_GLOB = "*Config.sh"
diff --git a/meta-oe/recipes-devtools/pstack/pstack_git.bb b/meta-oe/recipes-devtools/pstack/pstack_git.bb
new file mode 100644
index 0000000000..cc6721f9e3
--- /dev/null
+++ b/meta-oe/recipes-devtools/pstack/pstack_git.bb
@@ -0,0 +1,8 @@
1require pstack.inc
2
3SRCREV = "1e1734be3adb6d9c81b57c5cc3d0c8fbc43bdee3"
4PV = "2.11"
5
6SRC_URI = "git://github.com/peadar/pstack.git;branch=master;protocol=https \
7 file://0001-tests-fix-the-issue-of-cross-compilation-failure.patch \
8 "