[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <95fb9bbb-5738-4c62-024b-f163e94aaadb@iogearbox.net>
Date: Mon, 30 Apr 2018 12:12:02 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Sirio Balmelli <sirio@...d.ch>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v2 1/2] selftests/bpf: Makefile: add includes to fix
broken test build
On 04/30/2018 09:17 AM, Sirio Balmelli wrote:
> Build fails with missing 'asm/bitsperlong.h'.
>
> Include this from tools/arch/[arch]/include/uapi
> using an architecture-specific include sourced from 'Module.symvers'
> (is this legitimate? another idea was to do a `uname -p` but what if
> caller was cross-compiling?)
To point to an arch specific include, the way this works under tools
can be seen e.g. in barrier.h, see tools/include/asm/barrier.h. This
will then pull in one of the tools/arch/*/include/asm/barrier.h. We
would need to do something similar for tools/arch/*/include/uapi/asm/bitsperlong.h
Then you also don't need the Module.symvers hack to derive the underlying
arch. See 720f228e8d31 ("bpf: fix broken BPF selftest build") for another,
similar example we had in the past.
> Once the arch-specific include is fixed, a lack of 'asm/byteorder.h'
> now rears its ugly head.
> The only sane (ie: will not pull in kernel headers) place I can find it
> is in $(ROOT)/usr/include - add this to the include.
Why it doesn't work adding a new file tools/include/uapi/asm/byteorder.h
that points to one present in tools/arch/*/include/uapi/asm/bitsperlong.h
or tools/include/uapi/asm-generic/bitsperlong.h otherwise?
> Note that $(ROOT)/usr/include is generated on kernel build, hence my
> assumption that 'Module.symvers' will also be present.
The problem with this approach is that you need to do 'make header_install'
in order to resolve this dependency, whereas tools infrastructure has no
such dependency. Here's some more background context on the tools infra
that perhaps helps why it's done this way:
https://www.spinics.net/lists/netdev/msg487309.html
Please see to add a tools/include/uapi/asm/byteorder.h to fix the issue.
Thanks a lot,
Daniel
Powered by blists - more mailing lists