diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 451e9fba..a66be298 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -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 diff --git a/examples/c/xmake.lua b/examples/c/xmake.lua index d2f92ee8..0be8fa17 100644 --- a/examples/c/xmake.lua +++ b/examples/c/xmake.lua @@ -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 @@ -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