this repo has no description
1(executables
2 (names tc bootstrap bootstrap_c kprobe minimal)
3 (libraries libbpf libbpf_maps))
4
5; Below is repetitive build rules to compile *.bpf.c eBPF C source code that runs in the kernel
6
7(rule
8 (mode
9 (promote (until-clean)))
10 (targets minimal.bpf.o)
11 (deps arch minimal.bpf.c)
12 (action
13 (system
14 "clang -g -O2 -target bpf -I/usr/include/%{architecture}-linux-gnu/ -c minimal.bpf.c -D__TARGET_ARCH_%{read:arch}")))
15
16(rule
17 (mode
18 (promote (until-clean)))
19 (targets kprobe.bpf.o)
20 (deps arch vmlinux.h kprobe.bpf.c)
21 (action
22 (system
23 "clang -g -O2 -target bpf -I/usr/include/%{architecture}-linux-gnu/ -c kprobe.bpf.c -D__TARGET_ARCH_%{read:arch}")))
24
25(rule
26 (mode
27 (promote (until-clean)))
28 (targets tc.bpf.o)
29 (deps arch vmlinux.h tc.bpf.c)
30 (action
31 (system
32 "clang -g -O2 -target bpf -I/usr/include/%{architecture}-linux-gnu/ -c tc.bpf.c -D__TARGET_ARCH_%{read:arch}")))
33
34(rule
35 (mode
36 (promote (until-clean)))
37 (targets bootstrap.bpf.o)
38 (deps arch vmlinux.h bootstrap.bpf.c bootstrap.h)
39 (action
40 (system
41 "clang -g -O2 -target bpf -I/usr/include/%{architecture}-linux-gnu/ -c bootstrap.bpf.c -D__TARGET_ARCH_%{read:arch}")))
42
43(rule
44 (mode
45 (promote (until-clean)))
46 (targets vmlinux.h arch)
47 (action
48 (progn
49 (with-stdout-to
50 vmlinux.h
51 (run /usr/sbin/bpftool btf dump file /sys/kernel/btf/vmlinux format c))
52 (with-stdout-to
53 arch
54 (bash
55 "uname -m | sed 's/x86_64/x86/' | sed 's/arm.*/arm/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/' | sed 's/riscv64/riscv/' | sed 's/loongarch64/loongarch/'")))))
56
57; /usr/include/%{architecture}-linux-gnu/ Find asm/types.h for eBPF code