Skip to content

cmd/compile: encode LLVM ABI0 in function names - #130

Merged
zhouguangyuan0718 merged 5 commits into
go1.27.masterfrom
codex/abi0-name-contract
Aug 13, 2026
Merged

cmd/compile: encode LLVM ABI0 in function names#130
zhouguangyuan0718 merged 5 commits into
go1.27.masterfrom
codex/abi0-name-contract

Conversation

@zhouguangyuan0718

@zhouguangyuan0718 zhouguangyuan0718 commented Aug 13, 2026

Copy link
Copy Markdown

Use the reserved <ABI0> suffix as the only LLVM storage-name
identity for ABI0 Go functions. ABIInternal function names remain
unchanged.

Remove goobj.symbol.name metadata emission from function, data, and
debug-info paths. Keep the LLVM calling convention as the lowering
contract while allowing GoObj to derive symbol ABI solely from the
function name.

Reject logical Go symbol names that already use the reserved suffix,
and update the cgo unsafe-argument codegen checks.

Update the pinned GoALLC LLVM payload to
goallc-llvm23.1.0-20260813T171727Z at
1d142acb4dab7262347b57ac341235913b210f40. Refresh the affected
plugin fixtures and ABI tests for native-Go small-leaf stack-check
elision and the PCDATA_StackMapIndex=-1 entry sentinel. No runtime
frontend support is included here.

Tested locally against the final LLVM source and plugin:

ctest --test-dir "$PLUGIN_BUILD" --output-on-failure -j 4
# 90/90 passed

GOALLC_LLVM_DIR="$PAYLOAD" ./bin/go test cmd/internal/testdir \
  -run '^TestLLVM/(abi-differential|alloca-statepoint|caller-state|getg-abi0-fail-closed|writebarrier-helpers|compile-only-regressions|writebarrier-ir)' \
  -count=1

./bin/go test -tags=llvm23,dynamicllvm cmd/compile/internal/ssa
./bin/go test cmd/llvmtoolexec

Keep ABIInternal LLVM names unchanged and append the reserved <ABI0> suffix to every ABI0 declaration and definition. Remove goobj.symbol.name metadata now that the LLVM GoObj writer derives ABI identity from names.
@zhouguangyuan0718
zhouguangyuan0718 force-pushed the codex/abi0-name-contract branch from 0c50e68 to 2a34094 Compare August 13, 2026 16:09
@zhouguangyuan0718
zhouguangyuan0718 force-pushed the codex/abi0-name-contract branch from def4d14 to 207442d Compare August 13, 2026 16:16
@zhouguangyuan0718
zhouguangyuan0718 merged commit 926473a into go1.27.master Aug 13, 2026
4 of 8 checks passed
@zhouguangyuan0718
zhouguangyuan0718 deleted the codex/abi0-name-contract branch August 13, 2026 18:45
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