diff options
2 files changed, 45 insertions, 0 deletions
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 0000000..661dbca --- /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 @@ | |||
| 1 | From ce5d908bb1256ede680fbfd521f087060a567dca Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <martin.jansa@gmail.com> | ||
| 3 | Date: Tue, 3 Sep 2024 14:17:51 +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 | CMakeLists.txt | 10 +++++++--- | ||
| 11 | 1 file changed, 7 insertions(+), 3 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 14 | index 2b60fa26..89bead59 100644 | ||
| 15 | --- a/CMakeLists.txt | ||
| 16 | +++ b/CMakeLists.txt | ||
| 17 | @@ -100,16 +100,20 @@ include_directories(SYSTEM ${LIBCEREAL_INCLUDE_DIRS}) | ||
| 18 | |||
| 19 | find_package(BISON REQUIRED) | ||
| 20 | find_package(FLEX REQUIRED) | ||
| 21 | + | ||
| 22 | +# avoid buildpaths in generated #line statements and allow to pass --file-prefix-map=OLD=NEW | ||
| 23 | +set(BISON_FLAGS "${BISON_FLAGS} -l") | ||
| 24 | +set(FLEX_FLAGS "${FLEX_FLAGS} -L") | ||
| 25 | # `parser_class_name` is deprecated and generates warnings in bison >= 3.3. | ||
| 26 | # But `api.parser.class` is not supported in bison < 3.3. So we must inject | ||
| 27 | # the %define based on the bison version here. | ||
| 28 | if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.3) | ||
| 29 | - set(BISON_FLAGS "-Dapi.parser.class={Parser}") | ||
| 30 | + set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser}") | ||
| 31 | else() | ||
| 32 | - set(BISON_FLAGS "-Dparser_class_name={Parser}") | ||
| 33 | + set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser}") | ||
| 34 | endif() | ||
| 35 | bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} VERBOSE) | ||
| 36 | -flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) | ||
| 37 | +flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc COMPILE_FLAGS ${FLEX_FLAGS}) | ||
| 38 | add_flex_bison_dependency(flex_lexer bison_parser) | ||
| 39 | add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) | ||
| 40 | 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 addd2c5..4c888e7 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" | |||
| 21 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ | 21 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ | 
| 22 | file://run-ptest \ | 22 | file://run-ptest \ | 
| 23 | file://0001-cmake-Bump-max-LLVM-version-to-19.patch \ | 23 | file://0001-cmake-Bump-max-LLVM-version-to-19.patch \ | 
| 24 | file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ | ||
| 24 | " | 25 | " | 
| 25 | SRCREV = "b2e255870ba010d4a7e4852bffcf1c567b016fd0" | 26 | SRCREV = "b2e255870ba010d4a7e4852bffcf1c567b016fd0" | 
| 26 | 27 | ||
| @@ -45,6 +46,7 @@ EXTRA_OECMAKE = " \ | |||
| 45 | -DCMAKE_BUILD_TYPE=Release \ | 46 | -DCMAKE_BUILD_TYPE=Release \ | 
| 46 | -DUSE_SYSTEM_BPF_BCC=ON \ | 47 | -DUSE_SYSTEM_BPF_BCC=ON \ | 
| 47 | -DENABLE_MAN=OFF \ | 48 | -DENABLE_MAN=OFF \ | 
| 49 | -DBISON_FLAGS='--file-prefix-map=${WORKDIR}=' \ | ||
| 48 | " | 50 | " | 
| 49 | 51 | ||
| 50 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" | 52 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" | 
| @@ -53,3 +55,6 @@ COMPATIBLE_HOST:libc-musl = "null" | |||
| 53 | INHIBIT_PACKAGE_STRIP_FILES += "\ | 55 | INHIBIT_PACKAGE_STRIP_FILES += "\ | 
| 54 | ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ | 56 | ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \ | 
| 55 | " | 57 | " | 
| 58 | |||
| 59 | WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" | ||
| 60 | ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}" | ||
