Link Time Optimization Bitcode File Format

Severin Teona teona.severin9 at gmail.com
Tue Oct 6 16:46:28 UTC 2020


Hi all,

I am trying to build the druntime with the 'ldc-build-runtime' 
tool for microcontrollers (using the arm-none-eabi-gcc compiler) 
and therefore the size of the druntime should be as little as 
possible. One solution I had was to use Link Time Optimization 
(LTO) to reduce the size.

The problem now is the fact that when I compile the druntime with 
-flto=full or -flto=thin (as arguments for LDC2), the resulted 
object files (and also a big part of the runtime as it is a 
static library) have a different file format - LLVM IR bitcode - 
than I need, which is ELF 32-bit. 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.
I also tried using a different archiver - llvm-ar - but I had no 
luck.

Could you give me some advice about how should I fix this?

Thank you!


More information about the Digitalmars-d-learn mailing list