Skip to content

debug: allow supported targets to retain DWARF - #108

Closed
cpunion wants to merge 1849 commits into
codex/xgo-main-2164-20260801from
codex/debug-artifact-policy-2164-20260801
Closed

cpunion wants to merge 1849 commits 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 3 times, most recently 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.

@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from c9c9171 to a16528c Compare August 9, 2026 19:21
cpunion and others added 21 commits September 23, 2026 19:35
Bumps [actions/github-script](https://github.com/actions/github-script) from 8 to 9.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v8...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from 664b553 to fb8eda4 Compare September 30, 2026 21:50
@cpunion

cpunion commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Superseded by xgo-dev#2269 in the four-contribution consolidation tracked by xgo-dev#2164. The useful artifact/session/embedded-debug changes have been ported to current main and validated in that contribution. Closing this historical fork PR only; its branch is retained, and the upstream contribution remains open for review and CI.

@cpunion cpunion closed this Sep 30, 2026
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.15789% with 438 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (codex/xgo-main-2164-20260801@b683316). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/build/coverage.go 0.94% 209 Missing ⚠️
internal/build/build.go 52.40% 99 Missing ⚠️
internal/build/artifact_report.go 2.66% 73 Missing ⚠️
internal/build/cgo_pragmas.go 9.61% 47 Missing ⚠️
internal/build/cgo.go 35.71% 9 Missing ⚠️
internal/build/clean.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##             codex/xgo-main-2164-20260801     #108   +/-   ##
===============================================================
  Coverage                                ?   43.67%           
===============================================================
  Files                                   ?      111           
  Lines                                   ?    17947           
  Branches                                ?        0           
===============================================================
  Hits                                    ?     7839           
  Misses                                  ?    10107           
  Partials                                ?        1           
Flag Coverage Δ
dev-lto-globaldce 43.48% <23.15%> (?)
llgo-tests 75.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants