Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_PROTOCenv to enable the usage of this crate for such platforms.