From aeaa15a942ad9987ab2fe77bc20bd2ed47703dc0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 6 Mar 2023 13:33:28 -0800 Subject: bcc: Fix tests build with clang16 Signed-off-by: Khem Raj --- .../bcc/bcc/0001-tests-cc-Use-c-14-standard.patch | 34 ++++++++++++++++++++++ .../recipes-devtools/bcc/bcc_0.26.0.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch (limited to 'dynamic-layers') diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch new file mode 100644 index 0000000..48754f6 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tests-cc-Use-c-14-standard.patch @@ -0,0 +1,34 @@ +From 9f45e12ad4689ca2c41844b77c6d789d21509a13 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 6 Mar 2023 13:26:11 -0800 +Subject: [PATCH] tests/cc: Use c++14 standard + +default c++ standard was bumped to c++17 when using clang16+ compiler +via 907b89cc9, however, tests which use check tool is not yet ported +to work with c++17 standard, therefore use c++14 on tests + +Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/4506] +Signed-off-by: Khem Raj +Cc: Hengqi Chen +--- + tests/cc/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt +index bc870b07..b45f2369 100644 +--- a/tests/cc/CMakeLists.txt ++++ b/tests/cc/CMakeLists.txt +@@ -23,6 +23,10 @@ add_compile_options(-DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -fPIC") + ++if(${LLVM_PACKAGE_VERSION} VERSION_EQUAL 16 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 16) ++set(CMAKE_CXX_STANDARD 14) ++endif() ++ + if(ENABLE_USDT) + set(TEST_LIBBCC_SOURCES + test_libbcc.cc +-- +2.39.2 + diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.26.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.26.0.bb index 180b0f7..9bd6b4f 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.26.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.26.0.bb @@ -28,6 +28,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ file://0001-tools-trace.py-Fix-failing-to-exit.patch \ file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ + file://0001-tests-cc-Use-c-14-standard.patch \ file://run-ptest \ file://ptest_wrapper.sh \ " -- cgit v1.2.3-54-g00ecf