From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sirio Balmelli Subject: [PATCH v3 2/3] selftests/bpf: Makefile: add include path Date: Wed, 2 May 2018 13:05:10 +0200 Message-ID: <20180502110505.7n567iqy6duuzjbs@vm4> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: netdev@vger.kernel.org To: daniel@iogearbox.net Return-path: Received: from mail-wr0-f195.google.com ([209.85.128.195]:46615 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbeEBLFM (ORCPT ); Wed, 2 May 2018 07:05:12 -0400 Received: by mail-wr0-f195.google.com with SMTP id o2-v6so10647127wrj.13 for ; Wed, 02 May 2018 04:05:11 -0700 (PDT) Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: On some systems selftests fail to build, missing the following headers: asm/byteorder.h asm/socket.h asm/swab.h In the specific case of Ubuntu, this is because the files are in '/usr/include/x86_64-linux-gnu' (see ) which is both architecture- and distro-specific. The solution is to add $(KERNEL)/usr/include to the Makefile, so the build references these from the current kernel build and not the running system. Signed-off-by: Sirio Balmelli --- tools/testing/selftests/bpf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 9d76218..1ec09c6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -84,7 +84,10 @@ else CPU ?= generic endif -CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \ +# we are in 'tools/testing/selftests/bpf' +KERNEL=../../../.. +TOOLS=../../.. +CLANG_FLAGS = -I. -I./include/uapi -I$(TOOLS)/include/uapi -I$(KERNEL)/usr/include \ -Wno-compare-distinct-pointer-types $(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline -- 2.7.4