Skip to content

bpf fails to build with clang-22 due to incompatible pointer type error #8275

@NHOrus

Description

@NHOrus

Error, build with Clang-22.1.0:

error: failed to run custom build command for `below v0.11.0 (/var/tmp/portage/sys-process/below-0.11.0-r1/work/below-0.11.0/below)`

Caused by:
  process didn't exit successfully: `/var/tmp/portage/sys-process/below-0.11.0-r1/work/below-0.11.0/target/release/build/below-2d797d197c68f8c5/build-script-build` (exit status: 101)
  --- stderr

  thread 'main' (4664) panicked at below/build.rs:32:37:
  called `Result::unwrap()` on an `Err` value: failed to build `./src/bpf/exitstat.bpf.c`

  Caused by:
      0: failed to compile `./src/bpf/exitstat.bpf.c`
      1: failed to compile /var/tmp/portage/sys-process/below-0.11.0-r1/temp/.tmpZqxH6H/exitstat.bpf.c from ./src/bpf/exitstat.bpf.c
      2: command `clang -I /var/tmp/portage/sys-process/below-0.11.0-r1/temp/.tmpMQP6UP/bpf/src -fno-stack-protector -D__TARGET_ARCH_x86 -g -O2 -target bpf -c ./src/bpf/exitstat.bpf.c -o /var/tmp/portage/sys-process/below-0.11.0-r1/temp/.tmpZqxH6H/exitstat.bpf.c` failed (exit status: 1)
      3: ./src/bpf/exitstat.bpf.c:140:39: error: incompatible pointer types initializing 'const struct mm_struct___pre62 *' with an expression of type 'const struct mm_struct *' [-Wincompatible-pointer-types]
           140 |       const struct mm_struct___pre62 *mms = mm;
               |                                       ^     ~~

Gentoo bug: https://bugs.gentoo.org/970763

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions