Add a test step to produce a minimal binary using libbpf.

This patch adds a test step to link a minimal program to libbpf library produced,
making sure that the library works.
This commit is contained in:
Yucong Sun
2021-08-04 12:38:18 -07:00
committed by Andrii Nakryiko
parent 70ad3e8314
commit 6bf8babb33
3 changed files with 19 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -euox pipefail
CFLAGS=${CFLAGS:-}
cat << EOF > main.c
#include <bpf/libbpf.h>
int main() {
return bpf_object__open(0) < 0;
}
EOF
# static linking
${CC:-cc} ${CFLAGS} -o main -I./install/usr/include main.c ./build/libbpf.a -lelf -lz