Skip to content

deps: rebuild V8 without sandbox (enables zero-copy ArrayBuffer)#7

Open
yneves wants to merge 5 commits into
mainfrom
rebuild-v8-deps-no-sandbox
Open

deps: rebuild V8 without sandbox (enables zero-copy ArrayBuffer)#7
yneves wants to merge 5 commits into
mainfrom
rebuild-v8-deps-no-sandbox

Conversation

@yneves
Copy link
Copy Markdown
Collaborator

@yneves yneves commented May 19, 2026

Summary

  • Rebuilt V8 monolith for all 4 platforms with v8_enable_sandbox=false
  • Removed -DV8_ENABLE_SANDBOX from cgo.go
  • Added local dep modules under deps/{os}_{arch}/ with replace directives
  • SandboxEnabled() now returns false
  • NewArrayBufferExternal uses true zero-copy (no memcpy fallback)

Build sources

Platform Method
linux/amd64 CI (build-v8-deps workflow)
linux/arm64 CI (cross-compile x86→arm64, sysroot + custom libcxx)
darwin/arm64 CI (native)
darwin/amd64 Local (cross-compile arm64→x64, patched find_sdk.py + custom libcxx)

Test plan

  • All tests pass locally (go test ./...)
  • TestNewArrayBufferExternal_SharedMemory no longer skipped
  • TestNewArrayBufferExternal_JSWritesGoMemory no longer skipped
  • CI passes (unit tests on both OS)
  • Downstream compat (blindfox, er) still builds

yneves added 5 commits May 19, 2026 18:17
Rebuilt from V8 commit 5297e56d91816747d539abca52b578e5832135f0
with v8_enable_sandbox=false for all 4 platforms:
- linux/amd64 (CI)
- linux/arm64 (CI cross-compile with sysroot + custom libcxx)
- darwin/arm64 (CI)
- darwin/amd64 (local cross-compile from arm64)

Removes -DV8_ENABLE_SANDBOX from cgo.go so NewArrayBufferExternal
uses the true zero-copy path (no memcpy fallback).

Adds local dep modules under deps/{os}_{arch}/ with replace
directives in go.mod.
GNU ld on Ubuntu rejects llvm-ar's 64-bit symbol table format
when using -L/-l flags ('skipping incompatible'). Pass archives
as direct paths instead, which forces the linker to read them
regardless of symbol table format.
V8's clang enables ThinLTO by default in release builds, producing
LLVM bitcode objects that GNU ld cannot link. Add use_thin_lto=false
to both the CI workflow and local build script.
llvm-ar produces archives in a format GNU ld cannot read
('unknown architecture'). Use system ar for Linux targets
which produces compatible GNU-format archives.
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