1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/arch
Juan Carrano 63c475cd4d toolchain/cflags: enable dwarf compression.
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 so
the flag is blacklisted there. Even then, the results are quite impressive.

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}'
```

Results:

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

This was inspired by #8496.
2019-09-02 14:43:26 +02:00
..
atmega.inc.mk toolchain/cflags: enable dwarf compression. 2019-09-02 14:43:26 +02:00
cortexm.inc.mk makefiles: do not locally export compilation variables 2019-08-29 10:35:36 +02:00
mips.inc.mk toolchain/cflags: enable dwarf compression. 2019-09-02 14:43:26 +02:00
msp430.inc.mk toolchain/cflags: enable dwarf compression. 2019-09-02 14:43:26 +02:00
riscv.inc.mk makefiles: do not locally export compilation variables 2019-08-29 10:35:36 +02:00