diff options
Diffstat (limited to 'ci/managers/test_compile.sh')
-rwxr-xr-x | ci/managers/test_compile.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ci/managers/test_compile.sh b/ci/managers/test_compile.sh new file mode 100755 index 0000000..094ba3e --- /dev/null +++ b/ci/managers/test_compile.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euox pipefail + +EXTRA_CFLAGS=${EXTRA_CFLAGS:-} +EXTRA_LDFLAGS=${EXTRA_LDFLAGS:-} + +cat << EOF > main.c +#include <bpf/libbpf.h> +int main() { + return bpf_object__open(0) < 0; +} +EOF + +# static linking +${CC:-cc} ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o main -I./include/uapi -I./install/usr/include main.c ./build/libbpf.a -lelf -lz |