lkml.org 
[lkml]   [2021]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next] riscv, bpf: fix some compiler error
On Wed, 3 Nov 2021 at 08:26, tongtiangen <tongtiangen@huawei.com> wrote:
>

[...]

>
> Adding a function declaration in bpf_jit_comp64.c file cannot fix this compiler error:
>

AFAIK, there are two issues:

1. https://lore.kernel.org/llvm/202110290334.2zdMyRq4-lkp@intel.com/
2. https://lore.kernel.org/llvm/202111020610.9oy9Rr0G-lkp@intel.com/

1 is a warning when W=1 is enabled (missing prototype from -Wmissing-prototypes)
2 is an error, since the function is not defined when building CONFIG_ARCH_RV32I

You are trying to address both issues in this patch.

> ....
> when CONFIG_BPF_JIT and CONFIG_ARCH_64I is open, There is the following compiler error (W=1):
> error: no previous prototype for 'rv_bpf_fixup_exception'
> ....
>
> To fix this compiler error, you need to make a declaration in a header file, which is also
> the reason for introducing extable.h.
>

No, you don't need the header file. The forward declaration is
sufficient to get rid of the warning, and the adding CONFIG_ARCH_RV64I
fixes the RV32I build.


Björn

\
 
 \ /
  Last update: 2021-11-03 08:42    [W:0.052 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site