public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [selftests/bpf QUESTION] What is the proper way to fix the build error
Date: Fri, 17 Oct 2025 08:21:44 -0700	[thread overview]
Message-ID: <40982e43-84c5-481b-9a9a-0b678ef7e6e7@linux.dev> (raw)
In-Reply-To: <5ca1d6a6-5e5a-3485-d3cd-f9439612d1f3@loongson.cn>



On 10/17/25 3:05 AM, Tiezhu Yang wrote:
> Hi,
>
> When compiling tools/testing/selftests/bpf, there is a build error:
>
>   CLNG-BPF [test_progs] verifier_global_ptr_args.bpf.o
> progs/verifier_global_ptr_args.c:228:5: error: redefinition of 'off' 
> as different kind of symbol
>   228 | u32 off;
>       |     ^
> /home/fedora/newfixbpf.git/tools/testing/selftests/bpf/tools/include/vmlinux.h:21409:2: 
> note: previous definition is here
>  21409 |         off = 0,
>        |         ^
> 1 error generated.
>
> tools/testing/selftests/bpf/tools/include/vmlinux.h:21409
>
> enum i40e_ptp_gpio_pin_state {
>         end = -2,
>         invalid = -1,
>         off = 0,
>         in_A = 1,
>         in_B = 2,
>         out_A = 3,
>         out_B = 4,
> };
>
> The previous definition of "off" is in
> drivers/net/ethernet/intel/i40e/i40e_ptp.c:
>
> enum i40e_ptp_gpio_pin_state {
>     end = -2,
>     invalid,
>     off,
>     in_A,
>     in_B,
>     out_A,
>     out_B,
> };
>
> CONFIG_I40E is set in the defconfig file to build i40e_ptp.c after the
> commit 032676ff8217 (LoongArch: Update Loongson-3 default config file)
> in 6.18-rc1.
>
> What is the proper way to fix the build error?
> (1) just disable CONFIG_I40E (CONFIG_I40E=n), then no "off" in vmlinux.h
> (2) set it as a module (CONFIG_I40E=m), then no "off" in vmlinux.h
> (3) modify the variable name "off" in verifier_global_ptr_args.c

I would recommend to rename 'off' in verifier_global_ptr_args.c to 'offset'.

>
> Thanks,
> Tiezhu
>
>


  reply	other threads:[~2025-10-17 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 10:05 [selftests/bpf QUESTION] What is the proper way to fix the build error Tiezhu Yang
2025-10-17 15:21 ` Yonghong Song [this message]
2025-10-17 15:54   ` [PATCH] selftests/bpf: Fix redefinition of 'off' as different kind of symbol Brahmajit Das
2025-10-17 16:41     ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40982e43-84c5-481b-9a9a-0b678ef7e6e7@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox