summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-02-10 20:13:40 +0200
committerPaul Buetow <paul@buetow.org>2024-02-10 20:13:40 +0200
commit8ec79e38f30738701c1ca48f5cfa724b41f866f6 (patch)
tree1b2a910c73cad82e3813b623fecdd7bdfc15569c /build.sh
parent0a5b56cec0be16a6a8627ec8548b9e80a243af96 (diff)
add opids
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 4777061..8e49c9c 100755
--- a/build.sh
+++ b/build.sh
@@ -5,6 +5,10 @@ set -xeuf -o pipefail
declare -r LIBBPFGO="$(pwd)/../libbpfgo"
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
+echo 'package main' > opids.go
+echo >> opids.go
+sed -E 's/#define (.*) ([0-9]+)/const \1 = \2/' opids.h >> opids.go
+
clang -g -O2 -Wall -fpie -I../libbpfgo/selftest/common -target bpf -D__TARGET_ARCH_amd64 -I../libbpfgo/output -I../libbpfgo/selftest/common -c main.bpf.c -o main.bpf.o
export CC=clang