Netdev List
 help / color / mirror / Atom feed
* [PATCH v3 2/3] selftests/bpf: Makefile: add include path
@ 2018-05-02 11:05 Sirio Balmelli
  2018-05-02 15:43 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: Sirio Balmelli @ 2018-05-02 11:05 UTC (permalink / raw)
  To: daniel; +Cc: netdev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 2/3] selftests/bpf: Makefile: add include path
  2018-05-02 11:05 [PATCH v3 2/3] selftests/bpf: Makefile: add include path Sirio Balmelli
@ 2018-05-02 15:43 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2018-05-02 15:43 UTC (permalink / raw)
  To: Sirio Balmelli; +Cc: netdev

On 05/02/2018 01:05 PM, Sirio Balmelli wrote:
> 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

First patch in the series looks good to me, thanks Sirio! Problem with this
one is still as described earlier in: http://patchwork.ozlabs.org/patch/906505/

This will break people's setup and build bots since they expect headers to be
available from tools infra and not -I<kernel-root>/usr/include/ via headers_install,
so adding the latter is not possible (unless Arnaldo agrees to rework the whole tools
include infra in a better way). This means the only other option we have is to pull
them into tools/ instead, even if this results in a lot of duplication, but whether
we like it or not that is the way the tools/include stuff was designed along with
perf, meaning unless there's a fundamental rework, we will have to stick to it.

Thanks,
Daniel

>  $(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-02 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-02 11:05 [PATCH v3 2/3] selftests/bpf: Makefile: add include path Sirio Balmelli
2018-05-02 15:43 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox