[SAoC] "Druntime for Microcontrollers" project thread

Denis Feklushkin feklushkin.denis at gmail.com
Fri Oct 2 03:53:47 UTC 2020


On Wednesday, 30 September 2020 at 17:55:48 UTC, IGotD- wrote:
> On Wednesday, 30 September 2020 at 17:40:45 UTC, IGotD- wrote:
>>
>> Stupid me, I forgot to compile the druntime with 
>> --function-sections as well, forget what I said for the moment.
>
> Ok, back from stupidity. With --function-sections and 
> --data-sections now with the phobos and runtime properly 
> compiled with those options, I was able to reduce the size. One 
> binary from about 700KB to 400KB, another binary from about 
> 500KB to about 320Kb.
>
> Still not microcontroller size but a slight improvement.

Also it is necessary to determine what do we mean "size of the 
binary".

Not make sense size of resulting ELF file, matters only sections 
what will be actually uploaded into MCU and used RAM.

$ ls -l firmware.elf
-rwxr-xr-x 1 denizzz denizzz 3180060 Oct  2 10:51 firmware.elf
$ size firmware.elf
    text	   data	    bss	    dec	    hex	filename
  924140	  45764	   4796	 974700	  edf6c	firmware.elf



More information about the Digitalmars-d mailing list