diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch new file mode 100644 index 00000000..661dbca4 --- /dev/null +++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch @@ -0,0 +1,40 @@ +From ce5d908bb1256ede680fbfd521f087060a567dca Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 3 Sep 2024 14:17:51 +0200 +Subject: [PATCH] CMakeLists.txt: allow to set BISON_FLAGS like -l + +Signed-off-by: Martin Jansa + +Upstream-Status: Pending +--- + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2b60fa26..89bead59 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,16 +100,20 @@ include_directories(SYSTEM ${LIBCEREAL_INCLUDE_DIRS}) + + find_package(BISON REQUIRED) + find_package(FLEX REQUIRED) ++ ++# avoid buildpaths in generated #line statements and allow to pass --file-prefix-map=OLD=NEW ++set(BISON_FLAGS "${BISON_FLAGS} -l") ++set(FLEX_FLAGS "${FLEX_FLAGS} -L") + # `parser_class_name` is deprecated and generates warnings in bison >= 3.3. + # But `api.parser.class` is not supported in bison < 3.3. So we must inject + # the %define based on the bison version here. + if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.3) +- set(BISON_FLAGS "-Dapi.parser.class={Parser}") ++ set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser}") + else() +- set(BISON_FLAGS "-Dparser_class_name={Parser}") ++ set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser}") + endif() + bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} VERBOSE) +-flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) ++flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc COMPILE_FLAGS ${FLEX_FLAGS}) + add_flex_bison_dependency(flex_lexer bison_parser) + add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) + target_compile_options(parser PRIVATE "-w") diff --git a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb index addd2c5b..4c888e74 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.21.2.bb @@ -21,6 +21,7 @@ PV .= "+git" SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ file://run-ptest \ file://0001-cmake-Bump-max-LLVM-version-to-19.patch \ + file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ " SRCREV = "b2e255870ba010d4a7e4852bffcf1c567b016fd0" @@ -45,6 +46,7 @@ EXTRA_OECMAKE = " \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_SYSTEM_BPF_BCC=ON \ -DENABLE_MAN=OFF \ + -DBISON_FLAGS='--file-prefix-map=${WORKDIR}=' \ " COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" @@ -53,3 +55,6 @@ COMPATIBLE_HOST:libc-musl = "null" INHIBIT_PACKAGE_STRIP_FILES += "\ ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ " + +WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" +ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}"