Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法编译kmesh #36

Closed
RicoloveFeng opened this issue Oct 30, 2023 · 2 comments
Closed

无法编译kmesh #36

RicoloveFeng opened this issue Oct 30, 2023 · 2 comments

Comments

@RicoloveFeng
Copy link

使用22.03 SP1进行测试,已经成功修改内核,但是运行./build.sh -b会出现如下错误:

BUILD   kmesh-daemon
# oncn.io/mesh/pkg/bpf
In file included from pkg/bpf/bpf_kmesh.go:23:
/root/kmesh/bpf/kmesh/include/kmesh_common.h:56:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '#pragma'
   56 | } outer_map SEC(".maps");
      | ^~~
/root/kmesh/bpf/kmesh/include/kmesh_common.h:56:1: error: expected identifier or '(' before '#pragma'
/root/kmesh/bpf/kmesh/include/kmesh_common.h:64:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '#pragma'
   64 | } inner_map SEC(".maps");
      | ^~~
/root/kmesh/bpf/kmesh/include/kmesh_common.h:64:1: error: expected identifier or '(' before '#pragma'
/root/kmesh/bpf/kmesh/include/kmesh_common.h: In function 'kmesh_get_ptr_val':
/root/kmesh/bpf/kmesh/include/kmesh_common.h:128:46: error: 'outer_map' undeclared (first use in this function)
  128 |  inner_map_instance = kmesh_map_lookup_elem(&outer_map, &idx);
      |                                              ^~~~~~~~~
/root/kmesh/bpf/kmesh/include/kmesh_common.h:128:46: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:42: all] Error 2

请问这是否是某个依赖的版本问题?应当如何修复?

@lec-bit
Copy link
Contributor

lec-bit commented Oct 30, 2023

这是一个已知的问题,是由于部分版本libbpf存在bug引起的,将下列补丁打入libbpf的源码,然后源码安装libbpf应该可以解决您的问题,
不知道您使用的是哪个版本的libbpf,建议在v0.8.1版本libbpf基础上打入补丁
libbpf/libbpf@b31ca3f

近期我们将会把这条信息添加到kmesh_kernel_complie.md文档的QA中,如果您有兴趣也可以帮忙刷新文档,参与社区贡献

@RicoloveFeng
Copy link
Author

这是一个已知的问题,是由于部分版本libbpf存在bug引起的,将下列补丁打入libbpf的源码,然后源码安装libbpf应该可以解决您的问题, 不知道您使用的是哪个版本的libbpf,建议在v0.8.1版本libbpf基础上打入补丁 libbpf/libbpf@b31ca3f

近期我们将会把这条信息添加到kmesh_kernel_complie.md文档的QA中,如果您有兴趣也可以帮忙刷新文档,参与社区贡献

感谢,问题解决了,现在已经成功编译完成。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants