Re: [bpf-next] selftests/bpf fails to compile

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

 



On Tue, 11 Mar 2025 at 15:12, Venkat Rao Bagalkote
<venkat88@xxxxxxxxxxxxx> wrote:
>
>
> On 10/03/25 2:15 pm, Alexei Starovoitov wrote:
> > On Mon, Mar 10, 2025 at 8:32 AM Venkat Rao Bagalkote
> > <venkat88@xxxxxxxxxxxxx> wrote:
> >> Greetings!!!
> >>
> >> selftests/bpf fails to compile with below error on bpf-next repo with
> >> commit head: f28214603dc6c09b3b5e67b1ebd5ca83ad943ce3
> >>
> >> Repo link:
> >> https://web.git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
> >>
> >> Reverting below commit resolves the issue.
> >>
> >> Commit ID: 48b3be8d7f82bea6affe6b9f11ee67380b55ede8
> > ...
> >
> >> If you happen to fix the issue, please add below tag.
> >>
> >> Reported-by: Venkat Rao Bagalkote <venkat88@xxxxxxxxxxxxx>
> > Not quite. The issue is likely that your llvm is too old.
> > Please upgrade.
>
>
> Thanks for the feedback.
>
> I did try the compilation on fedora41, with linux-mainline kernel and
> /sefltests/bpf compiled successfully. But on the same set-up
> /selftests/bpf failed to compile on bpf-next kernel.
>
>
> OS: Fedora Linux 41 (Server Edition)
> LLVM: llvm-19.1.7-3.fc41.ppc64le

After staring at the error log in disbelief, I guess I have the answer.
https://elixir.bootlin.com/linux/v6.13.6/source/arch/powerpc/include/asm/qspinlock_types.h#L8

PowerPC overrides the type such that lock->val is no longer atomic_t.
All of the bpf_atomic.h helpers assume it's atomic_t, hence they try
to do lock->val.counter which obviously fails with val is u32 instead
of a struct.

The "fix" would probably be to replace the usage of struct qspinlock
with our own definition copying the asm-generic qspinlock type.

I can send a patch later today in the evening, unless you beat me to it.

Thanks


>
> gcc version 14.2.1 20250110 (Red Hat 14.2.1-7) (GCC)
>
> Passing repo:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> Failing repo:
> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
>
> Regards,
>
> Venkat.
>
> >





[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