[riot-notifications] [RIOT-OS/RIOT] toolchain/cflags: enable dwarf compression (save 50% HDD) (#12150)

Juan I Carrano notifications at github.com
Mon Sep 2 14:47:31 CEST 2019

### Contribution description

Use the `-gz` option to compress ELF sections containing DWARF information.

**This saves around 50% of disk space, without any side effects.**

See https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Debugging-Options.html#Debugging-Options for more infomation on this option.

Some platforms have an outdated toolchain that does not support `-gz` sothe flag is blacklisted there. Even then, the results are quite impressive.

It would be super-awesome if the AVR, MSP and ESP toolchains could be updated to a version with support for this feature. AFAIK those versions are out there, it is just that we are not using them.

### Testing procedure

I used @cladmi's [`buildtest` branch](https://github.com/cladmi/RIOT/tree/wip/du/buildtest) with this change and compiled the `examples/default` application:

$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" make -C examples/default buildtest-indocker

The size was obtained with:

$ find output -name "*.bin.bindirsize" -type f -exec tail  -n1 '{}' \; | cut -f 1 | awk '{s+=$1} END {printf "%.0f", s}'


- Vanilla: 10328112 KB (**~10GB**).
- with -gz: 4982788 KB (**~5GB**).

### Issues/PRs references

This was inspired by #8496.
See #10195 for another 50% savings (TODO: combine the two and see if we get 75% savings)
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * toolchain/cflags: enable dwarf compression.

-- File Changes --

    M cpu/esp32/Makefile.include (1)
    M cpu/esp8266/Makefile.include (1)
    M makefiles/arch/atmega.inc.mk (1)
    M makefiles/arch/mips.inc.mk (1)
    M makefiles/arch/msp430.inc.mk (1)
    M makefiles/cflags.inc.mk (5)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190902/086e84e2/attachment-0001.htm>

More information about the notifications mailing list