Skip to content

nrf: Use -O1 for debug builds#618

Merged
microbuilder merged 1 commit into
adafruit:masterfrom
arturo182:nrf_debug_optim
Feb 12, 2018
Merged

nrf: Use -O1 for debug builds#618
microbuilder merged 1 commit into
adafruit:masterfrom
arturo182:nrf_debug_optim

Conversation

@arturo182
Copy link
Copy Markdown
Collaborator

While O0 is great for debugging, the produced binary doesn't fit on the
feather52 anymore.

While O0 is great for debugging, the produced binary doesn't fit on the
feather52 anymore.
Copy link
Copy Markdown

@microbuilder microbuilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I haven't used GDB on nRF52 CP yet, but good catch!

@microbuilder microbuilder merged commit 4f32732 into adafruit:master Feb 12, 2018
@arturo182 arturo182 deleted the nrf_debug_optim branch February 12, 2018 22:19
@dhalbert
Copy link
Copy Markdown
Collaborator

We use -Os for both debug and regular builds on the M0/M4. gdb seems fine with this. We also use -flto, which saves a lot of space. And we set -DNDEBUG even on the debug builds. It appears to me to mostly just turn off some assertions.

@arturo182
Copy link
Copy Markdown
Collaborator Author

gdb is fine with -Os, but some variables might get optimized out, so I'd prefer to use the least compression possible while still being able to build and flash. It's a good balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants