[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <33050fcc-a4a0-af2e-6fba-dca248f5f23b@fb.com>
Date: Wed, 13 Jan 2021 09:14:47 -0800
From: Yonghong Song <yhs@...com>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>
CC: <linux-sparse@...r.kernel.org>, <netdev@...r.kernel.org>,
<bpf@...r.kernel.org>, <clang-built-linux@...glegroups.com>,
<linux-mips@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Xuefeng Li <lixuefeng@...ngson.cn>
Subject: Re: [PATCH 2/2] compiler.h: Include asm/rwonce.h under ARM64 and
ALPHA to fix build errors
On 1/13/21 2:57 AM, Tiezhu Yang wrote:
> When make M=samples/bpf on the Loongson 3A3000 platform which
> belongs to MIPS arch, there exists many similar build errors
> about 'asm/rwonce.h' file not found, so include it only under
> CONFIG_ARM64 and CONFIG_ALPHA due to it exists only in arm64
> and alpha arch.
>
> CLANG-bpf samples/bpf/xdpsock_kern.o
> In file included from samples/bpf/xdpsock_kern.c:2:
> In file included from ./include/linux/bpf.h:9:
> In file included from ./include/linux/workqueue.h:9:
> In file included from ./include/linux/timer.h:5:
> In file included from ./include/linux/list.h:9:
> In file included from ./include/linux/kernel.h:10:
> ./include/linux/compiler.h:246:10: fatal error: 'asm/rwonce.h' file not found
> ^~~~~~~~~~~~~~
> 1 error generated.
>
> $ find . -name rwonce.h
> ./include/asm-generic/rwonce.h
> ./arch/arm64/include/asm/rwonce.h
> ./arch/alpha/include/asm/rwonce.h
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
> include/linux/compiler.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index b8fe0c2..bdbe759 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -243,6 +243,12 @@ static inline void *offset_to_ptr(const int *off)
> */
> #define prevent_tail_call_optimization() mb()
>
> +#ifdef CONFIG_ARM64
> #include <asm/rwonce.h>
> +#endif
> +
> +#ifdef CONFIG_ALPHA
> +#include <asm/rwonce.h>
> +#endif
I do not think this fix is correct. x86 does not define its own
rwonce.h and still compiles fine.
As noted in the above, we have include/asm-generic/rwonce.h.
Once you do a proper build, you will have rwonce.h in arch
generated directory like
-bash-4.4$ find . -name rwonce.h
./include/asm-generic/rwonce.h
./arch/alpha/include/asm/rwonce.h
./arch/arm64/include/asm/rwonce.h
./arch/x86/include/generated/asm/rwonce.h
for mips, it should generated in
arch/mips/include/generated/asm/rwonce.h. Please double check why this
does not happen.
>
> #endif /* __LINUX_COMPILER_H */
>
Powered by blists - more mailing lists