[Based on #2090] runtime: support Go 1.26 in C libraries#2098
Open
cpunion wants to merge 17 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
12 tasks
cpunion
force-pushed
the
codex/go126-c-library-runtime-hooks
branch
2 times, most recently
from
July 19, 2026 13:38
75c7b56 to
4b2d5d1
Compare
This was referenced Jul 19, 2026
cpunion
marked this pull request as draft
July 19, 2026 15:23
cpunion
force-pushed
the
codex/go126-c-library-runtime-hooks
branch
from
July 19, 2026 17:04
bab45a2 to
dc28e83
Compare
cpunion
force-pushed
the
codex/go126-c-library-runtime-hooks
branch
from
July 20, 2026 01:05
037745f to
de1b304
Compare
cpunion
marked this pull request as ready for review
July 20, 2026 01:46
cpunion
marked this pull request as draft
July 20, 2026 01:49
cpunion
force-pushed
the
codex/go126-c-library-runtime-hooks
branch
from
July 20, 2026 03:03
de1b304 to
048bea5
Compare
cpunion
marked this pull request as ready for review
July 20, 2026 03:25
Store each immutable Func as one atomic pointer and validate the queried PC from the Func itself. This prevents concurrent cache replacement from combining a PC and function from different writers. Apply the same publication rule to the prebuilt function cache and stress multiple PCs during concurrent first use.
Give each package-backed locality block an owner-local TLS cache so hot accesses are O(1) regardless of the number of touched packages. Keep the block list only for GC reachability and teardown. Require locality variables to be unexported and reject go:linkname aliases. Add codegen, lifecycle, and 2/4/8-package performance coverage.
Provide the synctest, Darwin CPU, Linux gettimeofday, and all-thread syscall hooks required by Go 1.26 standard-library code in c-shared and c-archive builds. Extend the export demo so C consumers link and execute fmt, goroutine, syscall, funcinfo, and explicit DWARF paths in both library modes.
cpunion
force-pushed
the
codex/go126-c-library-runtime-hooks
branch
from
July 20, 2026 06:00
048bea5 to
e4cc229
Compare
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.
Problem
Go 1.26 standard-library code retained by
c-sharedandc-archiveneeds runtime hooks LLGo did not provide. This caused unresolved symbols on Darwin. On Linux, the generated shared-library constructor was lowered to legacy.ctors, so it did not initialize the runtime or reflection ABI tables before C first called an exported Go function; the export demo then crashed infmt.Sprintf.Fix
c-sharedconstructor in.init_array; keep platform constructor lowering forc-archiveand Darwinfmt.Sprintf, goroutines, funcinfo, platform syscall paths, and explicit DWARF lookup from real C consumersThis PR is based on #2090 (and transitively #2079). The broader 176-package standard-library coverage remains in a separate follow-up.
Validation
c-sharedandc-archivebuild, C link, execution, funcinfo, and DWARF checks passinternal/build: 73.7% statement coveragecmd/internal/test: 72.8% statement coverageCloses #2096