summaryrefslogtreecommitdiffstats
path: root/ci/managers/test_compile.sh
blob: 094ba3e901468331beb538e5bc6ecf2da9dbf902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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