[SAoC] "Druntime for Microcontrollers" project thread

IGotD- nise at nise.com
Tue Oct 6 16:25:39 UTC 2020


On Tuesday, 6 October 2020 at 15:58:04 UTC, Severin Teona wrote:
>
> Hello, thanks a lot for the tips. I have tried compiling the 
> runtime with both flags (--function-sections and 
> --data-sections in --dFlags) and also with --gc-sections (as an 
> argument for the linker), but I must be probably doing 
> something wrong because the size of the output is the same.
>

It should work. I use the GNU linker "ld". The LLVM linker 
"llvm-ld" should also accept the argument but I haven't tested 
it. I use the GNU linker because the LLVM linker is a bit 
immature for my purpose.

> The binary you are talking about is the one after you link the 
> druntime with the application you want to write on the 
> microcontroller? Or just the static runtime and phobos?
>

That is the size of the .elf files for the executable in my 
custom system, so application + druntime/phobos. All the 
debugging information was stripped. It is not an exact match of 
code+data but close enough to give you a rough idea of the size.



More information about the Digitalmars-d mailing list