From 01afcaac0c0fe159a06bc52de87d6387ac8b2dff Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Thu, 17 Feb 2022 08:38:28 -0800 Subject: [PATCH] fix a llvm compilation error due to header file reshuffle MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit llvm upstream https://reviews.llvm.org/D119723 removed header file llvm/DebugInfo/DWARF/DWARFCompileUnit.h from llvm/DebugInfo/DWARF/DWARFContext.h and this caused bcc compilation failure: ... .../src/cc/bcc_debug.cc: In member function ‘void ebpf::SourceDebugger::dump()’: .../src/cc/bcc_debug.cc:186:69: error: no matching function for call to ‘llvm::DWARFContext::getLineTableForUnit(llvm::DWARFCompileUnit*&)’ const DWARFLineTable *LineTable = DwarfCtx->getLineTableForUnit(CU); ^ In file included from /home/yhs/work/bcc/src/cc/bcc_debug.cc:22: ... Similar to fix in https://reviews.llvm.org/D119723, let us explicitly add llvm/DebugInfo/DWARF/DWARFCompileUnit.h in the .cc file. Change-Id: I528537d1cccfbeffb95ff7bccf926bed8eb41a78 Origin: upstream, https://github.com/iovisor/bcc/commit/e4d899ce335e263999c2664c9770c53018fc6c51 Signed-off-by: Yonghong Song Signed-off-by: Łukasz Stelmach --- src/cc/bcc_debug.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cc/bcc_debug.cc b/src/cc/bcc_debug.cc index 77d681ac..a7a865f4 100644 --- a/src/cc/bcc_debug.cc +++ b/src/cc/bcc_debug.cc @@ -19,6 +19,9 @@ #include #include +#if LLVM_MAJOR_VERSION >= 15 +#include +#endif #include #include #include -- 2.34.1