LDC LTO proper flags

Sergey kornburn at yandex.ru
Fri Oct 13 09:37:49 UTC 2023


Based on experience on Debian 
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960157) Docker 
image I found I was required to use 
"-flto-binary=/usr/lib/LLVMgold.so" in addition to "-flto=full".

Is it Debian specific issue or required for other distributions 
as well?

For example on Archlinux the liblphobos package provides two 
files:
- usr/lib/libdruntime-ldc-lto.a
- usr/lib/libphobos2-ldc-lto.a

So probably adding "-defaultlib=phobos2-ldc-lto,druntime-ldc-lto" 
will be fine.

But is "-flto-binary" is still required? What is it used for?

Can we please improve some information about proper flags usage 
for LTO enabled code in LDC?


More information about the digitalmars-d-ldc mailing list