From 7980d949ceaa72e76ed02a335ec1f94459ee5e31 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 14 Jun 2021 14:06:39 -0700 Subject: bcc: Fix build with llvm >= 13 toString implementation has changed in LLVM Signed-off-by: Khem Raj --- ...APInt-APSInt-toString-std-string-variants.patch | 42 ++++++++++++++++++++++ .../recipes-devtools/bcc/bcc_0.20.0.bb | 1 + 2 files changed, 43 insertions(+) create mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Remove-APInt-APSInt-toString-std-string-variants.patch (limited to 'dynamic-layers/openembedded-layer/recipes-devtools') diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Remove-APInt-APSInt-toString-std-string-variants.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Remove-APInt-APSInt-toString-std-string-variants.patch new file mode 100644 index 0000000..c41e2e2 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Remove-APInt-APSInt-toString-std-string-variants.patch @@ -0,0 +1,42 @@ +From 3a402d393a02cca4ccbf46e1c9eadb31e33d9753 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 14 Jun 2021 12:49:43 -0700 +Subject: [PATCH] Remove APInt/APSInt toString() std::string variants + +clang 13+ has removed this in favour of a pair of llvm::toString +() helpers inside StringExtras.h to improve compile speed by avoiding +hits on header + +Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/3488] +Signed-off-by: Khem Raj +--- + src/cc/json_map_decl_visitor.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/cc/json_map_decl_visitor.cc b/src/cc/json_map_decl_visitor.cc +index eff4d067..53896199 100644 +--- a/src/cc/json_map_decl_visitor.cc ++++ b/src/cc/json_map_decl_visitor.cc +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "common.h" + #include "table_desc.h" + +@@ -79,7 +80,11 @@ void BMapDeclVisitor::genJSONForField(FieldDecl *F) { + result_ += "["; + TraverseDecl(F); + if (const ConstantArrayType *T = dyn_cast(F->getType())) ++#if LLVM_MAJOR_VERSION >= 13 ++ result_ += ", [" + toString(T->getSize(), 10, false) + "]"; ++#else + result_ += ", [" + T->getSize().toString(10, false) + "]"; ++#endif + if (F->isBitField()) + result_ += ", " + to_string(F->getBitWidthValue(C)); + result_ += "], "; +-- +2.32.0 + diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb index 4352db4..325a6ee 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.20.0.bb @@ -22,6 +22,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc \ file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ file://0001-tools-trace.py-Fix-failing-to-exit.patch \ file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ + file://0001-Remove-APInt-APSInt-toString-std-string-variants.patch \ " SRCREV = "b2a76fa63f19036fbc9b3a705fbfa6358992ae22" -- cgit v1.2.3-54-g00ecf