Ai
8 Star 0 Fork 28

src-anolis-os/bcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bcc-0.25.0-Fix-a-llvm-compilation-error.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-12-05 14:13 +08:00 . update to bcc-0.25.0-5.src.rpm
From f04aaed5402f847ea0127de7ca573d39c57da891 Mon Sep 17 00:00:00 2001
From: Yonghong Song <yhs@fb.com>
Date: Sat, 26 Nov 2022 17:41:33 -0800
Subject: [PATCH] Fix a llvm compilation error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With latest llvm16, I got the following compilation error:
/.../src/cc/bpf_module.cc: In member function ‘void ebpf::BPFModule::dump_ir(llvm::Module&)’:
/.../src/cc/bpf_module.cc:259:15: error: ‘PrintModulePass’ was not declared in this scope
MPM.addPass(PrintModulePass(errs()));
^~~~~~~~~~~~~~~
...
The error is due to the llvm patch https://reviews.llvm.org/D138081.
Fix the issue by adjust corresponding header file locaiton
as in the above llvm patch.
Signed-off-by: Yonghong Song <yhs@fb.com>
---
src/cc/bpf_module.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
index 490fffe8..0f4a4f58 100644
--- a/src/cc/bpf_module.cc
+++ b/src/cc/bpf_module.cc
@@ -20,7 +20,11 @@
#include <llvm-c/Transforms/IPO.h>
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
+#if LLVM_MAJOR_VERSION >= 16
+#include <llvm/IRPrinter/IRPrintingPasses.h>
+#else
#include <llvm/IR/IRPrintingPasses.h>
+#endif
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
--
2.40.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/bcc.git
git@gitee.com:src-anolis-os/bcc.git
src-anolis-os
bcc
bcc
a8

搜索帮助