Skip to content

Add PICO_PANIC_NO_STRINGS_ON_TARGET option #1770

Open
@korneliuszo

Description

@korneliuszo

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

Activity

peterharperuk

peterharperuk commented on Jul 23, 2024

@peterharperuk
Contributor

7kB?! Really?

kilograham

kilograham commented on Jul 23, 2024

@kilograham
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

korneliuszo commented on Jul 23, 2024

@korneliuszo
Author

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

korneliuszo

korneliuszo commented on Jul 23, 2024

@korneliuszo
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

kilograham commented on Jul 23, 2024

@kilograham
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

korneliuszo commented on Jul 23, 2024

@korneliuszo
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__

self-assigned this
on Jul 23, 2024
added this to the 1.6.0 milestone on Jul 23, 2024
modified the milestones: 1.6.0, 1.7.0 on Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @kilograham@korneliuszo@peterharperuk

      Issue actions

        Add PICO_PANIC_NO_STRINGS_ON_TARGET option · Issue #1770 · raspberrypi/pico-sdk