Skip to content

Commit

Permalink
fix map linkage error for bpftool 7.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: ruki <[email protected]>
  • Loading branch information
waruqi authored and anakryiko committed Nov 2, 2023
1 parent 7abee1e commit 8ca2914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
&& sudo apt-get -y clean
- name: Build xmake android examples/c
run: |
cd examples/c && xmake f -p android -a ${{ matrix.arch }} -y && xmake -y
cd examples/c && xmake f -p android -a ${{ matrix.arch }} --require-bpftool=y -y && xmake -y
6 changes: 5 additions & 1 deletion examples/c/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if xmake.version():satisfies(">=2.5.7 <=2.5.9") then
end

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

add_requires("elfutils", "zlib")
if is_plat("android") then
Expand All @@ -21,6 +21,10 @@ else
add_requires("linux-headers")
end

-- fix error: libbpf: map 'my_pid_map': unsupported map linkage static. for bpftool >= 7.2.0
-- we cannot add `"-fvisibility=hidden"` when compiling *.bpf.c
set_symbols("none")

if is_arch("arm64", "arm64-v8a") then
add_includedirs("../../vmlinux/arm64")
elseif is_arch("arm.*") then
Expand Down

0 comments on commit 8ca2914

Please sign in to comment.