Skip to content

Move -g3 from build_flags to build_src_flags#826

Open
zackees wants to merge 1 commit intoPlummersSoftwareLLC:mainfrom
zackees:fix/move-g3-to-build-src-flags
Open

Move -g3 from build_flags to build_src_flags#826
zackees wants to merge 1 commit intoPlummersSoftwareLLC:mainfrom
zackees:fix/move-g3-to-build-src-flags

Conversation

@zackees
Copy link

@zackees zackees commented Mar 9, 2026

Summary

  • Removes -g3 from [base] build_flags so the ESP32 core and all libraries no longer compile with maximum debug info
  • Adds -g3 to build_src_flags so sketch sources still get full macro debug info for debugging
  • This significantly speeds up compilation and reduces object file bloat for release builds

Fixes #825

Test plan

  • Verify pio run -e demo compiles successfully
  • Confirm sketch .o files still contain DWARF macro info (readelf --debug-dump=macro)
  • Confirm library/core .o files no longer contain macro debug info

🤖 Generated with Claude Code

-g3 in build_flags applies maximum debug info (including all macro
definitions) to every translation unit — the ESP32 Arduino core, all
libraries, and the sketch. This significantly slows compilation and
bloats object files for no benefit in release builds.

Move it to build_src_flags so only sketch sources get full debug info,
while core and library compilation stays fast.

Fixes PlummersSoftwareLLC#825

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

-g3 in global build_flags significantly slows compilation and bloats object files

1 participant