https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123502

            Bug ID: 123502
           Summary: xdp-tools fails tests for bpf (bitwise operator &= on
                    pointer prohibited)
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
            Blocks: 121462
  Target Milestone: ---

Building xdp-tools w/ gcc's bpf target (*) run into a verifier failure :
```
$ cd xdp-monitor
$ make test
...
          0: R1=ctx() R10=fp0
          0: (79) r0 = *(u64 *)(r1 +8)
          func 'xdp_devmap_xmit' arg1 has btf_id 3027 type STRUCT 'net_device'
          1: R0=trusted_ptr_net_device() R1=ctx()
          1: (bf) r5 = r1                       ; R1=ctx() R5=ctx()
          2: (79) r2 = *(u64 *)(r5 +0)
          func 'xdp_devmap_xmit' arg0 has btf_id 3027 type STRUCT 'net_device'
          3: R2=trusted_ptr_net_device() R5=ctx()
          3: (79) r7 = *(u64 *)(r5 +32)         ; R5=ctx() R7=scalar()
          4: (81) r1 = *(s32 *)(r0 +0)          ; R0=trusted_ptr_net_device()
R1=scalar(smin=0xffffffff80000000,smax=0x7fffffff)
          5: (81) r6 = *(s32 *)(r2 +0)          ; R2=trusted_ptr_net_device()
R6=scalar(smin=0xffffffff80000000,smax=0x7fffffff)
          6: (b7) r0 = 0                        ; R0=0
          7: (79) r2 = *(u64 *)(r5 +24)         ; R2=scalar() R5=ctx()
          8: (bf) r3 = r10                      ; R3=fp0 R10=fp0
          9: (79) r5 = *(u64 *)(r5 +16)         ; R5=scalar()
          10: (07) r3 += -57                    ; R3=fp-57
          11: (18) r9 = 0xffff9f57ea870080      ;
R9=map_value(map=xdp_moni.rodata,ks=4,vs=260,off=128)
          13: (57) r3 &= -64
          R3 bitwise operator &= on pointer prohibited
          processed 13 insns (limit 1000000) max_states_per_insn 0 total_states
0 peak_states 0 mark_read 0
          -- END PROG LOAD LOG --
            libbpf: prog 'tp_xdp_devmap_xmit_multi': failed to load: -EACCES
            libbpf: failed to load object 'xdp_monitor'
            libbpf: failed to load BPF skeleton 'xdp_monitor': -EACCES
          Failed to xdp_monitor__load: Permission denied
            Duration            : 578638.3s
          Command './xdp-monitor -vv' exited with status 4
          Test test_monitor exited with return code: 4
make: *** [../lib/common.mk:132: test] Error 1
```

```
$ bpf-unknown-none-gcc -v
Using built-in specs.
COLLECT_GCC=bpf-unknown-none-gcc
COLLECT_LTO_WRAPPER=/usr/lib/bpf-toolchain/libexec/gcc/bpf-unknown-none/15/lto-wrapper
Target: bpf-unknown-none
Configured with:
/var/tmp/portage/sys-devel/bpf-toolchain-15.2.0_p2/work/gcc/configure
--build=x86_64-pc-linux-gnu --target=bpf-unknown-none --docdir=/.skip
--infodir=/.skip --mandir=/.skip MAKEINFO=: --prefix=/usr/lib/bpf-toolchain
--host=x86_64-pc-linux-gnu --disable-bootstrap --disable-cc1 --disable-cet
--disable-gcov --disable-gomp --disable-nls --disable-libcc1
--disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libvtv
--disable-shared --disable-werror --enable-languages=c
--with-gcc-major-version-only --with-system-zlib --without-isl --without-zstd
--disable-multilib CXX='x86_64-pc-linux-gnu-g++ -std=c++14'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 15.2.0 (GCC)
```

```
$ uname -a
Linux mop 6.18.3 #1 SMP PREEMPT_DYNAMIC Fri Jan  2 17:31:07 GMT 2026 x86_64 AMD
Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux
```

(*) I'll include how to build this separately.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121462
[Bug 121462] [meta-bug] BPF verifier issues

Reply via email to