Skip to content

Commit 8ca2914

Browse files
waruqianakryiko
authored andcommitted
fix map linkage error for bpftool 7.2.0
Signed-off-by: ruki <waruqi@gmail.com>
1 parent 7abee1e commit 8ca2914

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/build-android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
&& sudo apt-get -y clean
2929
- name: Build xmake android examples/c
3030
run: |
31-
cd examples/c && xmake f -p android -a ${{ matrix.arch }} -y && xmake -y
31+
cd examples/c && xmake f -p android -a ${{ matrix.arch }} --require-bpftool=y -y && xmake -y

examples/c/xmake.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if xmake.version():satisfies(">=2.5.7 <=2.5.9") then
99
end
1010

1111
option("system-libbpf", {showmenu = true, default = false, description = "Use system-installed libbpf"})
12-
option("require-bpftool", {showmenu = true, default = true, description = "Require bpftool package"})
12+
option("require-bpftool", {showmenu = true, default = false, description = "Require bpftool package"})
1313

1414
add_requires("elfutils", "zlib")
1515
if is_plat("android") then
@@ -21,6 +21,10 @@ else
2121
add_requires("linux-headers")
2222
end
2323

24+
-- fix error: libbpf: map 'my_pid_map': unsupported map linkage static. for bpftool >= 7.2.0
25+
-- we cannot add `"-fvisibility=hidden"` when compiling *.bpf.c
26+
set_symbols("none")
27+
2428
if is_arch("arm64", "arm64-v8a") then
2529
add_includedirs("../../vmlinux/arm64")
2630
elseif is_arch("arm.*") then

0 commit comments

Comments
 (0)