Link Time Optimization Bitcode File Format

kinke noone at
Tue Oct 6 18:17:03 UTC 2020

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-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 for more infos about LTO.

More information about the Digitalmars-d-learn mailing list