xref: /third_party/libbpf/ci/managers/test_compile.sh
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/libbpf/ci/managers/
17c2aad20Sopenharmony_ci#!/bin/bash
27c2aad20Sopenharmony_ciset -euox pipefail
37c2aad20Sopenharmony_ci
47c2aad20Sopenharmony_ciEXTRA_CFLAGS=${EXTRA_CFLAGS:-}
57c2aad20Sopenharmony_ciEXTRA_LDFLAGS=${EXTRA_LDFLAGS:-}
67c2aad20Sopenharmony_ci
77c2aad20Sopenharmony_cicat << EOF > main.c
87c2aad20Sopenharmony_ci#include <bpf/libbpf.h>
97c2aad20Sopenharmony_ciint main() {
107c2aad20Sopenharmony_ci  return bpf_object__open(0) < 0;
117c2aad20Sopenharmony_ci}
127c2aad20Sopenharmony_ciEOF
137c2aad20Sopenharmony_ci
147c2aad20Sopenharmony_ci# static linking
157c2aad20Sopenharmony_ci${CC:-cc} ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o main -I./include/uapi -I./install/usr/include main.c ./build/libbpf.a -lelf -lz
16

Indexes created Thu Nov 07 10:32:03 CST 2024