Closed kasper93 closed 3 months ago
kasper93 is either the primary contact or is in the CCs list of projects/mpv.
kasper93 has previously contributed to projects/mpv. The previous PR was #12019
By the way, have you considered using LLD with thin lto? It would be much faster, current build is quite resource heavy.
Hmmm...I guess we probably should be doing this (though I've vaguely heard that moLD is the best right now!). Linking is blackmagic to me. I'm confused though, why are you using gold but suggesting lld?
I'm confused though, why are you using gold but suggesting lld?
I use gold, because this is what is requested in default CFLAGS. I don't want to change default flags, this change is only to force Meson to do the correct thing.
I'm confused though, why are you using gold but suggesting lld?
I use gold, because this is what is requested in default CFLAGS. I don't want to change default flags, this change is only to force Meson to do the correct thing.
Ah introspector asks for this. :-(
We need full LTO for introspector though -- @kasper93 do you know if lld supports full lto?
do you know if lld supports full lto?
Yes, of course. In fact in both cases the actual LTO is handled by the same libLTO https://github.com/llvm/llvm-project/tree/main/llvm/lib/LTO For gold it is loaded as a LTO plugin. For LLD it is directly integrated inside the linker. But the main code is the same in both cases. I don't know what are the actual differences in cases like linking also with "non-lto" objects. Generally, nowadays LLD is good default option and since the builds are already bases heavily on LLVM it could be done for linking too. Though without thin lto, there would be no difference in performance actually.
Workarounds the issue where compile tests would fail with
-Werror=ignored-optimization-argument
because Meson doesn't allow linker flags inCFLAGS
orCXXFLAGS
.See: https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919
Thanks to @evverx for the idea: https://github.com/google/oss-fuzz/pull/7583#issuecomment-1104011067
This is a fragile workaround, but it looks like there isn't much else we can do.