Skip to content

Document that ontology-cross targets need a matching native host - #1462

Open
SafraNako wants to merge 1 commit into
ontio:masterfrom
SafraNako:docs/note-cross-compile-cgo-limitation
Open

SafraNako wants to merge 1 commit into
ontio:masterfrom
SafraNako:docs/note-cross-compile-cgo-limitation

Conversation

@SafraNako

Copy link
Copy Markdown

Follow-up to #1454, where I dug into why make ontology-linux fails on Go 1.22+ with undefined: WasmjitValidate / undefined: invokeJit — it's not a Go version regression, it's that cross-compiling drops wasmvm's cgo-based wasmjit integration silently (Go disables cgo by default whenever GOOS/GOARCH differ from the host). Native builds (including CI, which runs ontology-linux/ontology-darwin on matching ubuntu-latest/macos-latest runners) aren't affected.

Adds a short comment above the ontology-cross targets so the next person hitting this doesn't have to re-diagnose it from scratch.

🤖 Generated with Claude Code

Follow-up to ontio#1454. Cross-compiling ontology-linux from a non-Linux
host (or ontology-windows from non-Windows, etc.) silently disables
cgo, which drops wasmvm's wasmjit integration and fails with
'undefined: WasmjitValidate' / 'undefined: invokeJit' -- a confusing
error that looks like a missing symbol rather than a cgo/cross-compile
issue. Confirmed by reproducing it locally and by forcing
CGO_ENABLED=1, which then fails on missing Linux libc calls instead,
showing this is host-OS-dependent rather than a Go version issue.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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