[Interest] QMake, (static) libraries and LTCG (LTO) on Mac

Thiago Macieira thiago.macieira at intel.com
Mon Nov 13 19:45:37 CET 2017


On segunda-feira, 13 de novembro de 2017 03:24:46 PST René J. V. Bertin wrote:
> Thiago Macieira wrote:
> > it's a limitation of your environment. Static linking LTCG precompiled
> > code
> > requires a special linker. It's not very well supported everywhere.
> 
> Erm, this is on Mac, and I am using a much more recent linker editor than
> the one from the system. I've been able to build Qt itself with LTCG (I
> rebuilt Qt4 that way only a week or 2 ago) so while you're undoubtedly
> right in general I think this is not at cause here.

Right, it's not very well supported everywhere. Clang + Apple's ld is one of 
those environments where it's not.

I test LTCG frequently, but only with GCC and Linux. I know GCC + Binutils 
(gold and BFD) work properly for static linking, but I'm not sure about Clang 
+ LLVM. Please volunteer to make it work for Clang and macOS. Please see 
mkspecs/features/ltcg.prf.

(because qtbase's build involves creating one static library and using it, you 
don't need a static build to confirm that it works; just force ltcg in qtbase/
src)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list