Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PICO_PANIC_NO_STRINGS_ON_TARGET option #1770

Open
korneliuszo opened this issue Jul 23, 2024 · 6 comments
Open

Add PICO_PANIC_NO_STRINGS_ON_TARGET option #1770

korneliuszo opened this issue Jul 23, 2024 · 6 comments
Assignees
Milestone

Comments

@korneliuszo
Copy link

It allows in my code to remove 7kB of rodata.
It's more critical on copy_to_ram configuration

@peterharperuk
Copy link
Contributor

7kB?! Really?

@kilograham
Copy link
Contributor

Firstly, presumably, this only affects debug builds (release builds are probably already smaller)

Secondly, i think setting PICO_PANIC_FUNCTION= (i.e. empty) will do this already

@korneliuszo
Copy link
Author

@peterharperuk
7kB on basic www with picow-http
@kilograham
I have
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
configured

@korneliuszo
Copy link
Author

PICO_PANIC_FUNCTION ... I suspect doesn't help as it is different compilation unit (header function prototype) so it needs provide string to call even nop function

@kilograham
Copy link
Contributor

PICO_PANIC_FUNCTION ... I suspect doesn't help as it is different compilation unit (header function prototype) so it needs provide string to call even nop function

I don't know what you mean here

Add PICO_PANIC_FUNCTION= to your target_compile_definitions in CMake

@korneliuszo
Copy link
Author

I've made benchmarks

[no panic flags]$ arm-none-eabi-nm picopocket-sw.elf | grep __end__
20027e30 N __end__
[PICO_PANIC_FUNCTION=]$ arm-none-eabi-nm picopocket-sw.elf | grep __end__
20027da0 N __end__
[PICO_PANIC_NO_STRINGS_ON_TARGET]$ arm-none-eabi-nm picopocket-sw.elf | grep __end__
20025f60 N __end__

@kilograham kilograham self-assigned this Jul 23, 2024
@kilograham kilograham added this to the 1.6.0 milestone Jul 23, 2024
@kilograham kilograham modified the milestones: 1.6.0, 1.7.0 Jul 31, 2024
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

No branches or pull requests

3 participants