Skip to content

Allow protoc override with PERFETTO_PROTOS_PROTOC env - #8

Open
kxxt wants to merge 1 commit into
a6f:masterfrom
kxxt:protoc
Open

kxxt wants to merge 1 commit into
a6f:masterfrom
kxxt:protoc

Conversation

@kxxt

@kxxt kxxt commented Jul 18, 2026

Copy link
Copy Markdown

https://github.com/stepancheg/rust-protoc-bin-vendored/ only supports limited (architecture, operating system) combinations.
The build of this crate fails for other platforms.

For example, protobuf does not publish binaries for riscv64 (protocolbuffers/protobuf#12266).

This PR allows overriding the protoc binary with PERFETTO_PROTOS_PROTOC env to enable the usage of this crate for such platforms.

felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Sep 7, 2026
perfetto_protos 0.51.1 unconditionally selects a vendored protoc and
panics with Error { os: "linux", arch: "riscv64" } because no bundled
binary supports this architecture.

Apply the upstream protoc override fix to the existing crate through a
local Cargo override. Set PERFETTO_PROTOS_PROTOC=/usr/bin/protoc to use
the existing protobuf dependency, keeping scxtop enabled.

Upstream: a6f/perfetto_protos#8

Use asm-generic/errno.h in BPF sources and the task-local-data header.
scx_p2dq fails with "bits/wordsize.h:22:3: error: unsupported ABI"
because glibc's errno.h requires __riscv_xlen, which Clang does not
define for the BPF target. Cover the same includes in the other
schedulers while leaving userspace headers unchanged.

Follow common.bpf.h and the upstream portability change:
sched-ext/scx#62

Set BPF_EXTRA_CFLAGS_PRE_INCL=-ffreestanding for BPF compilation and
interface bindgen. scx_beerland and scx_cosmos still hit "unsupported
ABI" through limits.h, which includes glibc headers in hosted mode.
Freestanding mode keeps Clang's integer limits, including ULLONG_MAX,
without pulling in the host libc. Userspace compilation is unchanged;
the errno.h substitution remains needed because that header does not
honor freestanding mode.

Replace LAVD's __builtin_memcmp with bpf_strncmp. Freestanding mode
disables libc-call simplification, leaving an external memcmp that
fails BPF linking with "failed to find BTF info for global/extern
symbol 'memcmp'". The BPF helper preserves the ten-byte ksoftirqd/
prefix comparison and is already used elsewhere in LAVD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant