Netdev List
 help / color / mirror / Atom feed
From: Sirio Balmelli <sirio@b-ad.ch>
To: daniel@iogearbox.net
Cc: netdev@vger.kernel.org
Subject: [PATCH v3 2/3] selftests/bpf: Makefile: add include path
Date: Wed, 2 May 2018 13:05:10 +0200	[thread overview]
Message-ID: <20180502110505.7n567iqy6duuzjbs@vm4> (raw)

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 <https://wiki.ubuntu.com/MultiarchSpec>)
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 <sirio@b-ad.ch>
---
 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

             reply	other threads:[~2018-05-02 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 11:05 Sirio Balmelli [this message]
2018-05-02 15:43 ` [PATCH v3 2/3] selftests/bpf: Makefile: add include path Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180502110505.7n567iqy6duuzjbs@vm4 \
    --to=sirio@b-ad.ch \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox