[Based on #2143 #2145 #2157] build: match cmd/link DWARF defaults#2142
Draft
cpunion wants to merge 16 commits into
Draft
[Based on #2143 #2145 #2157] build: match cmd/link DWARF defaults#2142cpunion wants to merge 16 commits into
cpunion wants to merge 16 commits into
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
cpunion
force-pushed
the
codex/dwarf-default-go-compatible
branch
from
July 22, 2026 08:00
4141240 to
f227cd8
Compare
cpunion
force-pushed
the
codex/dwarf-default-go-compatible
branch
3 times, most recently
from
July 22, 2026 17:01
abf8473 to
703cae6
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
cpunion
force-pushed
the
codex/dwarf-default-go-compatible
branch
from
July 23, 2026 05:08
adf396b to
9aef2de
Compare
This was referenced Jul 23, 2026
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.
Based on #2143, #2145, and #2157.
Problem
LLGo currently omits DWARF from linked binaries unless the caller explicitly passes
-w=false. That is the opposite ofcmd/link: linked Go binaries preserve DWARF by default, while-wremoves it and-simplies-wunless an explicit-w=falseoverrides that implication.Changing the default exercises the normal optimized DWARF path. The prerequisite PRs keep that pipeline valid, ignore storage-free Python frontend variables, and preserve precise runtime line sites on Darwin.
The default also exposed existing full-LTO verifier failures in functions with deferred calls. Defer execution blocks are emitted after the frontend instruction walk, so cleanup calls could be generated without
!dbg. Range-over-func adds a second case: a defer can be registered in a synthetic yield function but emitted in its outer owner, where retaining the yield function lexical scope creates invalid cross-subprogram metadata.Generating DWARF for the normal macOS package matrix also makes shard 0 exceed its previous 30-minute job budget. The first complete run reached later standard-library packages with no test failure before GitHub canceled the job at the hard timeout.
Changes
-simply-w, while preserving an explicit-s -w=falseoverridecmd/linkDarwin C-shared default: omit DWARF unless explicitly overriddenModeGenconservative because it has no final linker stageOmitDWARFByDefaultpolicy fieldDeferTo, preserve line and column but reanchor the location to the outer ownerDISubprogramThe defer fixes stay inside defer lowering; they do not attach fallback locations to unrelated calls. The cltest helper does not change production defaults or mutate the caller configuration.
This PR does not implement native symbol-table stripping for
-s, change pclntab mode selection, or add native LLDB Go-language support. The latter remains proposed in #2154.Verification
adf396b6e: 40 checks passed, zero failed or pending; the conditional release job was skippedDev LTO GlobalDCE, Ubuntu/macOS platform coverage, all primary and compatibility shards, docs, targets, caches, and artifact tests passedbbe3f3a..adf396b6e): 45/45 coverable changed production-Go lines hit (100%)cl/cltestpackage./ssasuite with 91.9% package coverage;deferDebugLocation,deferDebugLocationFor, andsetDeferDebugLocationeach report 100%mkdirdemopasses with-lto=full -globaldcegit diff --check upstream/main...HEADUbuntu validation was limited to 2 CPUs, 15 GiB memory, and 512 PIDs.