File tree Expand file tree Collapse file tree 6 files changed +12
-39
lines changed Expand file tree Collapse file tree 6 files changed +12
-39
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64")
68
68
endif ()
69
69
70
70
set (BPFOBJECT_BPFTOOL_EXE ${CMAKE_CURRENT_BINARY_DIR} /bpftool/bootstrap/bpftool )
71
- set (BPFOBJECT_VMLINUX_H ${CMAKE_CURRENT_SOURCE_DIR} /../../vmlinux/${ARCH}/vmlinux.h )
71
+ set (BPFOBJECT_VMLINUX_H ${CMAKE_CURRENT_SOURCE_DIR} /../../vmlinux.h/include /${ARCH}/vmlinux.h )
72
72
set (LIBBPF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} /libbpf )
73
73
set (LIBBPF_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR} /libbpf/libbpf.a )
74
74
find_package (BpfObject REQUIRED )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ ARCH ?= $(shell uname -m | sed 's/x86_64/x86/' \
16
16
| sed 's/mips.* /mips/' \
17
17
| sed 's/riscv64/riscv/' \
18
18
| sed 's/loongarch64/loongarch/')
19
- VMLINUX := ../../vmlinux/$(ARCH ) /vmlinux.h
19
+ VMLINUX := ../../vmlinux.h/include /$(ARCH ) /vmlinux.h
20
20
# Use our own libbpf API headers and Linux UAPI headers distributed with
21
21
# libbpf to avoid dependency on system-wide headers, which could be missing or
22
22
# outdated
Original file line number Diff line number Diff line change 26
26
set_symbols (" none" )
27
27
28
28
if is_arch (" arm64" , " arm64-v8a" ) then
29
- add_includedirs (" ../../vmlinux/arm64" )
29
+ add_includedirs (" ../../vmlinux.h/include /arm64" )
30
30
elseif is_arch (" arm.*" ) then
31
- add_includedirs (" ../../vmlinux/arm" )
31
+ add_includedirs (" ../../vmlinux.h/include /arm" )
32
32
elseif is_arch (" riscv32" , " riscv64" ) then
33
- add_includedirs (" ../../vmlinux/riscv" )
33
+ add_includedirs (" ../../vmlinux.h/include /riscv" )
34
34
elseif is_arch (" loongarch" ) then
35
- add_includedirs (" ../../vmlinux/loongarch" )
35
+ add_includedirs (" ../../vmlinux.h/include /loongarch" )
36
36
elseif is_arch (" ppc" , " powerpc" ) then
37
- add_includedirs (" ../../vmlinux/powerpc" )
37
+ add_includedirs (" ../../vmlinux.h/include /powerpc" )
38
38
elseif is_arch (" x86_64" , " i386" ) then
39
- add_includedirs (" ../../vmlinux/x86" )
39
+ add_includedirs (" ../../vmlinux.h/include /x86" )
40
40
else
41
- add_includedirs (" ../../vmlinux" )
41
+ add_includedirs (" ../../vmlinux.h/include " )
42
42
end
43
43
44
44
-- we can run `xmake f --require-bpftool=y` to pull bpftool from xmake-repo repository
Original file line number Diff line number Diff line change @@ -18,16 +18,7 @@ fn main() {
18
18
. source ( SRC )
19
19
. clang_args ( format ! (
20
20
"-I{}" ,
21
- Path :: new( "../../../vmlinux" )
22
- . join( match arch. as_ref( ) {
23
- "aarch64" => "arm64" ,
24
- "loongarch64" => "loongarch" ,
25
- "powerpc64" => "powerpc" ,
26
- "riscv64" => "riscv" ,
27
- "x86_64" => "x86" ,
28
- _ => & arch,
29
- } )
30
- . display( )
21
+ Path :: new( "../../../vmlinux.h/include" ) . join( arch) . display( )
31
22
) )
32
23
. build_and_generate ( out)
33
24
. expect ( "bpf compilation failed" ) ;
Original file line number Diff line number Diff line change @@ -18,16 +18,7 @@ fn main() {
18
18
. source ( SRC )
19
19
. clang_args ( format ! (
20
20
"-I{}" ,
21
- Path :: new( "../../../vmlinux" )
22
- . join( match arch. as_ref( ) {
23
- "aarch64" => "arm64" ,
24
- "loongarch64" => "loongarch" ,
25
- "powerpc64" => "powerpc" ,
26
- "riscv64" => "riscv" ,
27
- "x86_64" => "x86" ,
28
- _ => & arch,
29
- } )
30
- . display( )
21
+ Path :: new( "../../../vmlinux.h/include" ) . join( arch) . display( )
31
22
) )
32
23
. build_and_generate ( & out)
33
24
. expect ( "bpf compilation failed" ) ;
Original file line number Diff line number Diff line change @@ -18,16 +18,7 @@ fn main() {
18
18
. source ( SRC )
19
19
. clang_args ( format ! (
20
20
"-I{}" ,
21
- Path :: new( "../../../vmlinux" )
22
- . join( match arch. as_ref( ) {
23
- "aarch64" => "arm64" ,
24
- "loongarch64" => "loongarch" ,
25
- "powerpc64" => "powerpc" ,
26
- "riscv64" => "riscv" ,
27
- "x86_64" => "x86" ,
28
- _ => & arch,
29
- } )
30
- . display( )
21
+ Path :: new( "../../../vmlinux.h/include" ) . join( arch) . display( )
31
22
) )
32
23
. build_and_generate ( out)
33
24
. unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments