Skip to content

Build failure on Kali Rolling (kernel 6.19) due to -Werror in BPF compilation #5

@MisterHk

Description

@MisterHk

Hello,

First of all, thank you for creating GhostScan.
I spent quite some time testing and building the project on a modern Kali Linux rolling environment and wanted to report a compatibility issue that may affect other users as well.

Environment:

  • Distribution: Kali Linux Rolling

  • Kernel: 6.19.14+kali-amd64

  • Rust/Cargo: current rolling versions

  • Clang tested:

    • clang 21.1.8
    • clang 19.1.7
  • bpftool installed

  • libbpf-dev installed

  • all required autotools/build dependencies installed

The project initially failed due to missing build dependencies such as:

  • autoreconf
  • autopoint
  • bison
  • bpftool
  • libbpf headers

After resolving all dependencies, the remaining issue happens during eBPF compilation.

Current error:
clang fails compiling:
bpf/task_snapshot.bpf.c

Main errors:
vmlinux.h produces several forward declaration warnings/errors such as:

  • struct ns_tree;
  • struct freelist_tid;
  • union pipe_index;
  • struct freelist_counters;

The build currently treats these warnings as fatal because build.rs uses:
-Werror

File:
build.rs

Current flags:
.args(["-target", "bpf", "-O2", "-g", "-Wall", "-Werror"])

After removing "-Werror", the build progresses further.

This appears to be related to newer kernels/BTF generation and newer clang behavior on rolling distributions.

Suggestion:

  • consider removing -Werror for BPF compilation
    OR
  • conditionally disable specific warnings
    OR
  • document supported kernel/clang versions

This issue may affect:

  • Kali Rolling
  • bleeding-edge Debian
  • Arch Linux
  • newer LLVM/clang environments

I hope this report helps improve compatibility for modern Linux environments.

Thank you again for the project and for your work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions