diff options
author | Archana Polampalli <archana.polampalli@windriver.com> | 2025-06-11 12:00:29 +0530 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-06-20 13:00:12 -0700 |
commit | eea5ec23155cfd47781599fdc9a92c21e4caffc8 (patch) | |
tree | 6f8fb6a744a6c5400c9fba1b6196a02fbfba276e | |
parent | 525625cb266c8a6ea9a4ddedabf935c825d38510 (diff) | |
download | meta-clang-scarthgap.tar.gz |
bpftrace: fix buildpaths QA issuesscarthgap
* Avoid line statements from bison to fix:
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/src/debug/bpftrace/0.21.2+git/parser.tab.cc in package bpftrace-src contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/src/debug/bpftrace/0.21.2+git/location.hh in package bpftrace-src contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/src/debug/bpftrace/0.21.2+git/parser.tab.hh in package bpftrace-src contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/src/debug/bpftrace/0.21.2+git/lex.yy.cc in package bpftrace-src contains reference to TMPDIR [buildpaths]
* there are still few more buildpaths issues with ptest enabled:
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/src/debug/bpftrace/0.21.2+git/tests/data/dwarf_data.h in package bpftrace-src contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/.debug/bpftrace_test in package bpftrace-dbg contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/bpftrace_test in package bpftrace-ptest contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/testlibs/cmake_install.cmake in package bpftrace-ptest contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/testlibs/CTestTestfile.cmake in package bpftrace-ptest contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/testprogs/cmake_install.cmake in package bpftrace-ptest contains reference to TMPDIR [buildpaths]
WARNING: bpftrace-0.21.2+git-r0 do_package_qa: QA Issue: File /usr/lib/bpftrace/ptest/tests/testprogs/CTestTestfile.cmake in package bpftrace-ptest contains reference to TMPDIR [buildpaths]
* lower buildpaths from ERROR_QA to WARN_QA when ptest is enabled
fixing .cmake files might be simple, but the embedded path to dwarf_data.h
in bpftrace_test will be more complicated, so will leave it to
someone actually using bpftrace (and its ptest).
bpftrace/0.21.2+git/package $ grep -R styhead .
./usr/lib/bpftrace/ptest/tests/testlibs/cmake_install.cmake:# Install script for directory: ${WORKDIR}/git/tests/testlibs
./usr/lib/bpftrace/ptest/tests/testlibs/cmake_install.cmake: set(CMAKE_OBJDUMP "${WORKDIR}/recipe-sysroot-native/usr/bin/aarch64-webos-linux/aarch64-webos-linux-objdump")
./usr/lib/bpftrace/ptest/tests/testlibs/CTestTestfile.cmake:# Source directory: ${WORKDIR}/git/tests/testlibs
./usr/lib/bpftrace/ptest/tests/testlibs/CTestTestfile.cmake:# Build directory: ${WORKDIR}/build/tests/testlibs
grep: ./usr/lib/bpftrace/ptest/tests/.debug/bpftrace_test: binary file matches
grep: ./usr/lib/bpftrace/ptest/tests/bpftrace_test: binary file matches
./usr/lib/bpftrace/ptest/tests/testprogs/cmake_install.cmake:# Install script for directory: ${WORKDIR}/git/tests/testprogs
./usr/lib/bpftrace/ptest/tests/testprogs/cmake_install.cmake: set(CMAKE_OBJDUMP "${WORKDIR}/recipe-sysroot-native/usr/bin/aarch64-webos-linux/aarch64-webos-linux-objdump")
./usr/lib/bpftrace/ptest/tests/testprogs/CTestTestfile.cmake:# Source directory: ${WORKDIR}/git/tests/testprogs
./usr/lib/bpftrace/ptest/tests/testprogs/CTestTestfile.cmake:# Build directory: ${WORKDIR}/build/tests/testprogs
./usr/src/debug/bpftrace/0.21.2+git/tests/data/dwarf_data.h:constexpr inline const char *dwarf_data_cxx_path = "${WORKDIR}/build/tests/data/data_source_cxx";
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
2 files changed, 50 insertions, 0 deletions
diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch new file mode 100644 index 0000000..0364d90 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 814d20901a71fd4d98a5a67789d69ef7e9a2169c Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <martin.jansa@gmail.com> | ||
3 | Date: Tue, 3 Sep 2024 13:47:48 +0200 | ||
4 | Subject: [PATCH] CMakeLists.txt: allow to set BISON_FLAGS like -l | ||
5 | |||
6 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
11 | --- | ||
12 | CMakeLists.txt | 10 +++++++--- | ||
13 | 1 file changed, 7 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
16 | index 7d0433d..6b3d445 100644 | ||
17 | --- a/CMakeLists.txt | ||
18 | +++ b/CMakeLists.txt | ||
19 | @@ -91,16 +91,20 @@ include_directories(SYSTEM ${LIBCEREAL_INCLUDE_DIRS}) | ||
20 | |||
21 | find_package(BISON REQUIRED) | ||
22 | find_package(FLEX REQUIRED) | ||
23 | + | ||
24 | +# avoid buildpaths in generated #line statements and allow to pass --file-prefix-map=OLD=NEW | ||
25 | +set(BISON_FLAGS "${BISON_FLAGS} -l") | ||
26 | +set(FLEX_FLAGS "${FLEX_FLAGS} -L") | ||
27 | # `parser_class_name` is deprecated and generates warnings in bison >= 3.3. | ||
28 | # But `api.parser.class` is not supported in bison < 3.3. So we must inject | ||
29 | # the %define based on the bison version here. | ||
30 | if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.3) | ||
31 | - set(BISON_FLAGS "-Dapi.parser.class={Parser}") | ||
32 | + set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser}") | ||
33 | else() | ||
34 | - set(BISON_FLAGS "-Dparser_class_name={Parser}") | ||
35 | + set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser}") | ||
36 | endif() | ||
37 | bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} VERBOSE) | ||
38 | -flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) | ||
39 | +flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc COMPILE_FLAGS ${FLEX_FLAGS}) | ||
40 | add_flex_bison_dependency(flex_lexer bison_parser) | ||
41 | add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) | ||
42 | target_compile_options(parser PRIVATE "-w") | ||
43 | -- | ||
44 | 2.40.0 | ||
45 | |||
diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.20.1.bb b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.20.1.bb index 355f427..f0c29f4 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.20.1.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.20.1.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ | |||
25 | file://0004-cmake-Bump-max-LLVM-version-to-18.patch \ | 25 | file://0004-cmake-Bump-max-LLVM-version-to-18.patch \ |
26 | file://0001-use-64bit-alignment-for-map-counter-atomic-add.patch \ | 26 | file://0001-use-64bit-alignment-for-map-counter-atomic-add.patch \ |
27 | file://run-ptest \ | 27 | file://run-ptest \ |
28 | file://0001-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ | ||
28 | " | 29 | " |
29 | SRCREV = "fe6362b4e2c1b9d0833c7d3f308c1d4006b54723" | 30 | SRCREV = "fe6362b4e2c1b9d0833c7d3f308c1d4006b54723" |
30 | 31 | ||
@@ -55,6 +56,7 @@ EXTRA_OECMAKE = " \ | |||
55 | -DCMAKE_BUILD_TYPE=Release \ | 56 | -DCMAKE_BUILD_TYPE=Release \ |
56 | -DUSE_SYSTEM_BPF_BCC=ON \ | 57 | -DUSE_SYSTEM_BPF_BCC=ON \ |
57 | -DENABLE_MAN=OFF \ | 58 | -DENABLE_MAN=OFF \ |
59 | -DBISON_FLAGS='--file-prefix-map=${WORKDIR}=' \ | ||
58 | " | 60 | " |
59 | 61 | ||
60 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" | 62 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" |
@@ -63,3 +65,6 @@ COMPATIBLE_HOST:libc-musl = "null" | |||
63 | INHIBIT_PACKAGE_STRIP_FILES += "\ | 65 | INHIBIT_PACKAGE_STRIP_FILES += "\ |
64 | ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ | 66 | ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ |
65 | " | 67 | " |
68 | |||
69 | WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" | ||
70 | ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}" | ||