Skip to content

debug: allow supported targets to retain DWARF - #108

Open
cpunion wants to merge 1 commit into
codex/xgo-main-2164-20260801from
codex/debug-artifact-policy-2164-20260801
Open

debug: allow supported targets to retain DWARF#108
cpunion wants to merge 1 commit into
codex/xgo-main-2164-20260801from
codex/debug-artifact-policy-2164-20260801

Conversation

@cpunion

@cpunion cpunion commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Part of xgo-dev#2164.

Fixed targets previously set AlwaysOmit and passed -S unconditionally, so -ldflags=-w=false could not produce a debug ELF. Once retention is enabled, direct ld.lld targets also must not receive the clang-only -gdwarf-4 link option.

This change:

  • models DWARF retention and preserve/omit linker flags as target capabilities;
  • lets supported ELF and Wasm linkers retain DWARF while preserving the current default omission policy;
  • keeps clang-driver and direct-linker arguments separate;
  • verifies a Cortex-M debug ELF contains DWARF and produces exactly the same flashed .bin bytes as its stripped control.

Validation:

  • macOS: internal/crosscompile and relevant internal/build tests; full internal/build suite passed with the pre-existing hanging TestRunPrintfWithStdioNobuf excluded (76.2% package coverage, changed policy functions 100%);
  • Linux/amd64: relevant internal/crosscompile and internal/build tests passed;
  • end-to-end cortex-m-qemu build: explicit -w=false retains .debug_info, current default omits it.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

2d13fd37a1e2 | workflow run | long-term charts

Program measurements

Platform Workload File size vs main Build vs main Run vs main
Linux cprintf 18544 B +0.0% 358.828 ms -13.0% (better) 1.375 ms -11.4% (better)
Linux fmtprintf 2217608 B +0.2% (worse) 3.156 s -18.2% (better) 2.721 ms -17.2% (better)
Linux println 71504 B -1.6% (better) 348.829 ms -12.8% (better) 1.725 ms +3.1% (worse)
macOS cprintf 84672 B +0.0% 308.578 ms -25.5% (better) 2.328 ms -35.1% (better)
macOS fmtprintf 2361520 B +0.7% (worse) 2.500 s -36.5% (better) 16.514 ms -29.3% (better)
macOS println 125712 B -1.0% (better) 305.466 ms -26.3% (better) 3.201 ms -55.9% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 12.310 ns/op -8.7% (better)
Linux BenchmarkMergeCompilerFlags 144.900 ns/op -6.2% (better)
Linux BenchmarkMergeLinkerFlags 94.850 ns/op -6.4% (better)
Linux BenchmarkChannelBuffered 36.390 ns/op +4.7% (worse)
Linux BenchmarkChannelHandoff 25081 ns/op -21.7% (better)
Linux BenchmarkDefer 47.440 ns/op -15.8% (better)
Linux BenchmarkDirectCall 1.758 ns/op +12.5% (worse)
Linux BenchmarkGlobalRead 1.760 ns/op +12.8% (worse)
Linux BenchmarkGlobalWrite 2.806 ns/op +12.5% (worse)
Linux BenchmarkGoroutine 30399 ns/op -59.8% (better)
Linux BenchmarkInterfaceCall 8.794 ns/op +12.8% (worse)
Linux BenchmarkRuntimeGetG 1.760 ns/op -66.8% (better)
macOS BenchmarkLookupPCRandom 10.630 ns/op -14.5% (better)
macOS BenchmarkMergeCompilerFlags 95.970 ns/op -22.9% (better)
macOS BenchmarkMergeLinkerFlags 71.860 ns/op +3.6% (worse)
macOS BenchmarkChannelBuffered 23.150 ns/op -16.5% (better)
macOS BenchmarkChannelHandoff 7915 ns/op +12.9% (worse)
macOS BenchmarkDefer 29.540 ns/op -21.1% (better)
macOS BenchmarkDirectCall 1.084 ns/op -25.4% (better)
macOS BenchmarkGlobalRead 0.943 ns/op -22.1% (better)
macOS BenchmarkGlobalWrite 0.973 ns/op -34.5% (better)
macOS BenchmarkGoroutine 39159 ns/op +23.7% (worse)
macOS BenchmarkInterfaceCall 4.341 ns/op -19.6% (better)
macOS BenchmarkRuntimeGetG 2.312 ns/op -10.3% (better)

Compared only with the latest matching platform in the main series.

Warning

  • Persistent publishing is unavailable because no data token is configured.

@cpunion
cpunion changed the base branch from main to codex/xgo-main-2164-20260801 August 1, 2026 16:08
@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch 2 times, most recently from 2d13fd3 to 5b3dbe4 Compare August 2, 2026 07:05
@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from 5b3dbe4 to c9c9171 Compare August 3, 2026 00:44
@cpunion

cpunion commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Rebased the root commit onto current xgo-dev/main (4e1aa4f); new head is c9c9171. Root-level targeted tests pass. Staged upstream as draft PR xgo-dev#2269: xgo-dev#2269. Dependent PRs remain untouched until this root layer is reviewed.

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