seccomp: add ppc64le (POWER) support#219
Open
Scottcjn wants to merge 3 commits into
Open
Conversation
Claude Code on IBM POWER8 (ppc64le) runs fine on v2.1.112 with a locally
built Node.js, but sandbox mode hard-disables unix-socket blocking because
sandbox-runtime ships apply-seccomp only for x64 and arm64. This adds
ppc64le as a third supported architecture.
Changes:
- `vendor/seccomp-src/seccomp-unix-block.c`: accept `powerpc64le` as the
optional arch argument (alongside existing `x86_64` / `aarch64`), mapping
to `SCMP_ARCH_PPC64LE`. libseccomp >= 2.3 supports this natively.
- `vendor/seccomp/build.ts`:
* `nodeArchToDir` maps Node.js `process.arch === 'ppc64'` to the `ppc64le`
output directory (Node reports `ppc64` on ppc64le Linux — the filter we
produce is LE-only, so the directory name is explicit about that).
* BPF generation loop now emits a third `powerpc64le.bpf`.
* The generated `unix-block-bpf.h` gains a `#elif defined(__powerpc64__)
&& defined(_CALL_ELF) && _CALL_ELF == 2` branch. The `_CALL_ELF == 2`
check pins us to the ELFv2 (little-endian) ABI that mainstream Linux
distributions use on POWER today (Ubuntu, Debian, RHEL for Power).
A big-endian POWER target would need its own BPF — out of scope here.
- `vendor/seccomp/ppc64le/apply-seccomp`: pre-built binary (847 KB,
statically linked, stripped). Built natively on an IBM POWER S824
(Ubuntu 20.04 LTS, GCC 9.4, libseccomp 2.5.4) using the updated
build.ts pipeline.
Build environment to reproduce:
sudo apt install libseccomp-dev # or build from source with gperf
cd vendor/seccomp-src
gcc -static -O2 -Wall -Wextra -o /tmp/seccomp-unix-block \
seccomp-unix-block.c -lseccomp
/tmp/seccomp-unix-block /tmp/ppc64le.bpf powerpc64le
# ... generate unix-block-bpf.h ...
gcc -static -O2 -Wall -Wextra -I /tmp -o vendor/seccomp/ppc64le/apply-seccomp \
vendor/seccomp-src/apply-seccomp.c -lseccomp
strip vendor/seccomp/ppc64le/apply-seccomp
Tested on an IBM Power S824 (dual 8-core POWER8, 128 SMT threads, 512 GB
RAM, Ubuntu 20.04). The static binary runs under Node.js v22 built from
source. Pairs with a small cli.js arch-resolver addition on the
@anthropic-ai/claude-code side to actually route to this binary — will
file that separately once this lands, since claude-code is a different
repo.
Size comparison:
vendor/seccomp/x64/apply-seccomp = 751 KB (existing)
vendor/seccomp/arm64/apply-seccomp = <existing arm64 size>
vendor/seccomp/ppc64le/apply-seccomp = 847 KB (new, this PR)
Slightly larger than x64 because ppc64le libseccomp.a drags in a bit more
arch-table data; still well under 1 MB.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Friendly first ping — adds |
Co-authored-by: Grouchly <ubuntclaw@Grouchly.tailbdd0ba.ts.net>
* Add Dependabot configuration * Add RTC payout wallet metadata --------- Co-authored-by: dazer1234 <dazer1234@users.noreply.github.com>
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.
Summary
Adds
ppc64le(IBM POWER) as a third supported architecture forapply-seccomp, alongside the existingx86_64andaarch64. Enables sandbox mode for Claude Code / any ASRT consumer running on POWER8/POWER9/POWER10 Linux.Why
Claude Code on IBM POWER8 (
@anthropic-ai/claude-code@2.1.112) runs cleanly via a locally built Node.js, but sandbox mode emits this on every invocation:Installing
@anthropic-ai/sandbox-runtimedoesn't fix it either, becausevendor/seccomp/only ships x64 + arm64 binaries. POWER8 is a legitimate production Linux target (IBM Cloud Power VS, financial/HPC shops, Debian ports, RHEL for Power, Ubuntu for Power) and recent AI tooling adoption is real —vllmadded ppc64le CPU backend support in vllm-project/vllm#37586.What changed
vendor/seccomp-src/seccomp-unix-block.cAccepts
powerpc64leas a third value for the optional arch argument, mapping toSCMP_ARCH_PPC64LE(supported by libseccomp ≥ 2.3). Enables cross-compilation of the BPF filter from any host.vendor/seccomp/build.tsnodeArchToDirmaps Node'sprocess.arch === 'ppc64'to theppc64leoutput directory. (Node reportsppc64on ppc64le Linux — the filter we produce is LE-only, so the directory name is explicit about that, following the ripgrep-vendor convention that usesppc64le-linux.)x86_64,aarch64,powerpc64le).unix-block-bpf.hgains a#elif defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2branch. The_CALL_ELF == 2check pins to the ELFv2 (little-endian) ABI that mainstream Linux on POWER uses today — big-endianppc64would need its own BPF and is out of scope here.vendor/seccomp/ppc64le/apply-seccompPre-built binary (847 KB, statically linked, stripped). Built natively on an IBM Power S824 (Ubuntu 20.04 LTS, GCC 9.4, libseccomp 2.5.4) using the updated
build.tspipeline.Testing
Built and tested on real hardware:
process.arch === 'ppc64')Verified the binary runs:
Verified sandbox mode in Claude Code picks up the new binary once the cli.js arch resolver is extended (
process.arch === 'ppc64' ? 'ppc64le' : nulladded to the existing x64/arm64 chain). That cli.js change is a separate repo (anthropics/claude-codeis a different package) and will be filed there once this lands.Size sanity
Slightly larger than x64 because ppc64le
libseccomp.apulls in a bit more arch-table data. Well under 1 MB.To reproduce the build
Or just run
tsx vendor/seccomp/build.tson a POWER8 host with the new build.ts.Follow-up
anthropic-ai/claude-code(separate PR, not this repo) — happy to file once this lands and there's an upstream home for the ppc64le binary.#elif defined(__powerpc64__) && !defined(_CALL_ELF)branch. Out of scope unless someone has the hardware to test.Thanks for shipping ASRT as Apache-2.0 — it made this port trivial.