diff options
| -rw-r--r-- | meta-oe/recipes-devtools/pahole/files/0001-CMakeList.txt-make-python-optional.patch | 44 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/pahole/pahole_1.22.bb | 30 |
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/pahole/files/0001-CMakeList.txt-make-python-optional.patch b/meta-oe/recipes-devtools/pahole/files/0001-CMakeList.txt-make-python-optional.patch new file mode 100644 index 0000000000..d64cba109f --- /dev/null +++ b/meta-oe/recipes-devtools/pahole/files/0001-CMakeList.txt-make-python-optional.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From f6ca8c930d0fbd2491b3cc77169e32806a14e5e9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Matteo Croce <mcroce@microsoft.com> | ||
| 3 | Date: Mon, 30 Aug 2021 16:25:56 +0200 | ||
| 4 | Subject: [PATCH] CMakeList.txt: make python optional | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=88431099950ab3e8bc1645353508d7978a6cad35] | ||
| 7 | |||
| 8 | ostra-cg, which requires python, is installed in the destination dir. | ||
| 9 | Make it optional for embedded distributions which doesn't have the | ||
| 10 | python interpreter available. | ||
| 11 | |||
| 12 | Signed-off-by: Matteo Croce <mcroce@microsoft.com> | ||
| 13 | --- | ||
| 14 | CMakeLists.txt | 7 +++++-- | ||
| 15 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 18 | index 4140574..8523bce 100644 | ||
| 19 | --- a/CMakeLists.txt | ||
| 20 | +++ b/CMakeLists.txt | ||
| 21 | @@ -61,6 +61,7 @@ find_package(DWARF REQUIRED) | ||
| 22 | find_package(ZLIB REQUIRED) | ||
| 23 | find_package(argp REQUIRED) | ||
| 24 | find_package(obstack REQUIRED) | ||
| 25 | +find_package(Python3 QUIET) | ||
| 26 | |||
| 27 | # make sure git submodule(s) are checked out | ||
| 28 | find_package(Git QUIET) | ||
| 29 | @@ -185,8 +186,10 @@ install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h | ||
| 30 | elfcreator.h elf_symtab.h hash.h libctf.h | ||
| 31 | DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/) | ||
| 32 | install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/) | ||
| 33 | -install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
| 34 | +if(Python3_FOUND) | ||
| 35 | + install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
| 36 | + install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python) | ||
| 37 | +endif() | ||
| 38 | install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
| 39 | -install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python) | ||
| 40 | install(FILES lib/Makefile lib/ctracer_relay.c lib/ctracer_relay.h lib/linux.blacklist.cu | ||
| 41 | DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime) | ||
| 42 | -- | ||
| 43 | 2.31.1 | ||
| 44 | |||
diff --git a/meta-oe/recipes-devtools/pahole/pahole_1.22.bb b/meta-oe/recipes-devtools/pahole/pahole_1.22.bb new file mode 100644 index 0000000000..b9fd81fe4f --- /dev/null +++ b/meta-oe/recipes-devtools/pahole/pahole_1.22.bb | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | SUMMARY = "Shows and manipulates data structure layout" | ||
| 2 | |||
| 3 | LICENSE = "GPLv2" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
| 5 | |||
| 6 | DEPENDS = "elfutils zlib libbpf" | ||
| 7 | |||
| 8 | COMPATIBLE_HOST = "(x86_64|i.86|aarch64).*-linux" | ||
| 9 | |||
| 10 | SRCREV = "f02af2553ea58ae1186226af0d0ec835a248358f" | ||
| 11 | SRC_URI = "git://git.kernel.org/pub/scm/devel/pahole/pahole.git \ | ||
| 12 | file://0001-CMakeList.txt-make-python-optional.patch" | ||
| 13 | |||
| 14 | S = "${WORKDIR}/git" | ||
| 15 | |||
| 16 | inherit cmake | ||
| 17 | |||
| 18 | PACKAGECONFIG[python3] = ",,python3-core,python3-core" | ||
| 19 | |||
| 20 | EXTRA_OECMAKE = "-D__LIB=lib -DCMAKE_BUILD_TYPE=Release -DLIBBPF_EMBEDDED=OFF" | ||
| 21 | |||
| 22 | FILES:${PN} = "${bindir}/pahole \ | ||
| 23 | ${libdir}/libdwarves.so* \ | ||
| 24 | ${libdir}/libdwarves_reorganize.so*" | ||
| 25 | |||
| 26 | PACKAGES += "${PN}-extra" | ||
| 27 | FILES:${PN}-extra = "${datadir} ${bindir} ${libdir}/libdwarves_emit.so*" | ||
| 28 | RDEPENDS:${PN}-extra += "bash" | ||
| 29 | |||
| 30 | BBCLASSEXTEND = "native nativesdk" | ||
