Re: [PATCH bpf-next] bpf: fix build when CONFIG_DEBUG_INFO_BTF[_MODULES] is undefined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 23, 2024 at 6:52 AM Alan Maguire <alan.maguire@xxxxxxxxxx> wrote:
>
> Kernel test robot reports that kernel build fails with
> resilient split BTF changes.
>
> Examining the associated config and code we see that
> btf_relocate_id() is defined under CONFIG_DEBUG_INFO_BTF_MODULES.
> Moving it outside the #ifdef solves the issue.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202406221742.d2srFLVI-lkp@xxxxxxxxx/
> Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
> ---
>  kernel/bpf/btf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 8e12cb80ba73..4ff11779699e 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -6185,8 +6185,6 @@ struct btf *btf_parse_vmlinux(void)
>         return btf;
>  }
>
> -#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
> -
>  /* If .BTF_ids section was created with distilled base BTF, both base and
>   * split BTF ids will need to be mapped to actual base/split ids for
>   * BTF now that it has been relocated.
> @@ -6198,6 +6196,8 @@ static __u32 btf_relocate_id(const struct btf *btf, __u32 id)
>         return btf->base_id_map[id];
>  }
>
> +#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
> +

It doesn't fix it all. The 32 build is still failing:

../kernel/bpf/btf.c: In function ‘btf_populate_kfunc_set’:
-../kernel/bpf/btf.c:8251:36: error: implicit declaration of function
‘btf_relocate_id’; did you mean ‘btf_relocate’?
[-Wimplicit-function-declaration]
- 8251 |                 set->pairs[i].id = btf_relocate_id(btf,
set->pairs[i].id);
-      |                                    ^~~~~~~~~~~~~~~
-      |                                    btf_relocate
-

See build_32, build_clang, build_allmod failures in CI:
https://patchwork.kernel.org/project/netdevbpf/patch/20240623135224.27981-1-alan.maguire@xxxxxxxxxx/





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux