AOT: per-function ELF sections + link --gc-sections (#36198 part A) - #36238
Merged
Merged
Conversation
Tag each defined LLVM function with `.text.<symbol>` before object emit and pass --gc-sections/-s at link so duplicate helper-runtime bodies can be discarded once units are re-emitted. Also source bootstrap sidecar stamp helper before the VM driver fast path and sync spine coverage for AotGcSections.php. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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
lib/JIT/AotGcSections.php: tag each defined LLVM function with.text.<symbol>before object emit; pass--gc-sectionsand-s(unless debug symbols) inLinker::link(Build: every helper unit.o embeds the whole runtime prologue (462 duplicate symbols, ~530 KB per linked unit) and no -ffunction-sections/--gc-sections — 790 MB of objects in git (lib/AOT/HelperRuntimeCache.php, script/emit-helper-runtime-object.php, lib/AOT/Linker.php) #36198 part A).bootstrap-selfhost-vm-driver-execute-probe.shsourcingbootstrap-gen0-install-prelinked-driver.shbefore the fast-path sidecar stamp refresh (Self-host M5: CI gate — sidecar SHA stamp must match spine entry before merge #8703).require_onceforAotGcSections.php(8059/8059).Part B (shared
common.oruntime prologue) and helper-cache refresh remain follow-ups — committed prelinkedunit.ofiles still use monolithic.textuntil re-emitted.Test plan
Closes #36198 (part A — function sections + GC at link; part B deferred).
Made with Cursor