TPG
(Tomasz Paweł Gajc)
August 7, 2019, 1:48pm
1
Hi,
looks like static libraries that are build with LTO causes errors when
something else is linking to that static libraries. See here
committed 08:25AM - 04 Jul 18 UTC
Currently optflags passes -flto to LLVM/clang which means clang emits Fat
LTO symbols so ar should handle it. According to this
b_lto=true does not work with static libraries · Issue #1646 · mesonbuild/meson · GitHub it seems like binutils's ar
is broken and does not handle LTO.
There are three options:
- ar wrapper script does not work well, so it still uses ar from binutils
instead of llvm-ar or gcc-ar
- autofoo scripts from build package prefers/hardcodes usage of ar from
binutils
- issue is outdated because ar wrapper got fixed (
committed 12:46PM - 18 May 19 UTC
)
Gabriel_C
(Gabriel C)
August 7, 2019, 3:05pm
2
Hi,
looks like static libraries that are build with LTO causes errors when something else is linking to that static libraries. See here Disable LTO for static libraries · OpenMandrivaAssociation/util-linux@85926d8 · GitHub
Currently optflags passes -flto to LLVM/clang which means clang emits Fat LTO symbols so ar should handle it. According to this b_lto=true does not work with static libraries · Issue #1646 · mesonbuild/meson · GitHub it seems like binutils's ar is broken and does not handle LTO.
There are three options:
- ar wrapper script does not work well, so it still uses ar from binutils instead of llvm-ar or gcc-ar
- autofoo scripts from build package prefers/hardcodes usage of ar from binutils
Don't know this one. If true that need fixing.
- issue is outdated because ar wrapper got fixed (Add crazy's wrapper script fixes · OpenMandrivaAssociation/binutils@70e0b69 · GitHub )
The real issue is:
Mixed static-libs won't work. Eg: lib1 build with GCC LTO and lib2
build with Clang LTO.
In this case, one has to be built without LTO to be able to link without errors.
I didn't test the latest Clang static LTO libs but I doubt something
changed there.