On Tuesday, 6 October 2020 at 16:46:28 UTC, Severin Teona wrote:
Also, when I try to link the druntime with the application I want to write on the microcontroller, there are some link errors due to the file format.

This happens when you link manually, not through LDC. When running LDC with `-flto=full -O -v ...`, you'll see that it invokes gcc with extra flags, something like

-Wl,-plugin,/dlang/ldc-1.23.0/lib/LLVMgold-ldc.so -Wl,-plugin-opt=mcpu=x86-64 -Wl,-plugin-opt=O3 -Wl,-plugin-opt=-function-sections -Wl,-plugin-opt=-data-sections

so that the linker gets to know how to deal with bitcode objects via the LLVM plugin.

See http://johanengelen.github.io/ldc/2016/11/10/Link-Time-Optimization-LDC.html for more infos about LTO.

Reply via email to