From 3248e1ae0ddbb2f85aa42a6d67e5435b9ce1e88c Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 7 Aug 2023 13:30:09 -0400 Subject: [PATCH] integration-test: avoid reliance on kernel headers This should allow us to build on any system. --- test/integration-test/bpf/ext.bpf.c | 2 +- test/integration-test/bpf/main.bpf.c | 2 +- test/integration-test/bpf/multimap-btf.bpf.c | 2 +- test/integration-test/bpf/reloc.bpf.c | 2 +- test/integration-test/bpf/text_64_64_reloc.c | 2 +- test/integration-test/build.rs | 7 ++++++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/test/integration-test/bpf/ext.bpf.c b/test/integration-test/bpf/ext.bpf.c index 6ec95229..2996fcf7 100644 --- a/test/integration-test/bpf/ext.bpf.c +++ b/test/integration-test/bpf/ext.bpf.c @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include // clang-format on diff --git a/test/integration-test/bpf/main.bpf.c b/test/integration-test/bpf/main.bpf.c index f60e42a9..b9365622 100644 --- a/test/integration-test/bpf/main.bpf.c +++ b/test/integration-test/bpf/main.bpf.c @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include // clang-format on diff --git a/test/integration-test/bpf/multimap-btf.bpf.c b/test/integration-test/bpf/multimap-btf.bpf.c index 07fcc60f..2bd7978b 100644 --- a/test/integration-test/bpf/multimap-btf.bpf.c +++ b/test/integration-test/bpf/multimap-btf.bpf.c @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include // clang-format on diff --git a/test/integration-test/bpf/reloc.bpf.c b/test/integration-test/bpf/reloc.bpf.c index ea67ee2e..609e504b 100644 --- a/test/integration-test/bpf/reloc.bpf.c +++ b/test/integration-test/bpf/reloc.bpf.c @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include #include // clang-format on diff --git a/test/integration-test/bpf/text_64_64_reloc.c b/test/integration-test/bpf/text_64_64_reloc.c index cd273a35..067350cc 100644 --- a/test/integration-test/bpf/text_64_64_reloc.c +++ b/test/integration-test/bpf/text_64_64_reloc.c @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include // clang-format on diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index a17d64ad..c0c7a8cb 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -110,10 +110,15 @@ fn main() { target_arch.push(arch); }; + let libbpf_vmlinux_dir = libbpf_dir.join(".github/actions/build-selftests"); + let clang = || { let mut cmd = Command::new("clang"); - cmd.arg("-I") + cmd.arg("-nostdlibinc") + .arg("-I") .arg(&libbpf_headers_dir) + .arg("-I") + .arg(&libbpf_vmlinux_dir) .args(["-g", "-O2", "-target", target, "-c"]) .arg(&target_arch); cmd