Skip to content
Commit 167381f3 authored by Sirio Balmelli's avatar Sirio Balmelli Committed by Daniel Borkmann
Browse files

selftests/bpf: Makefile fix "missing" headers on build with -idirafter



Selftests fail to build on several distros/architectures because of
	missing headers files.

On a Ubuntu/x86_64 some missing headers are:
	asm/byteorder.h, asm/socket.h, asm/sockios.h

On a Debian/arm32 build already fails at sys/cdefs.h

In both cases, these already exist in /usr/include/<arch-specific-dir>,
but Clang does not include these when using '-target bpf' flag,
since it is no longer compiling against the host architecture.

The solution is to:

- run Clang without '-target bpf' and extract the include chain for the
current system

- add these to the bpf build with '-idirafter'

The choice of -idirafter is to catch this error without injecting
unexpected include behavior: if an arch-specific tree is built
for bpf in the future, this will be correctly found by Clang.

Signed-off-by: default avatarSirio Balmelli <sirio@b-ad.ch>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent ff4fb475
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment