Open berolinux opened 2 years ago
The trigger seems to be linking clang 15 LTO code to a static libzstd.a built with clang 14 (the problem goes away when rebuilding libzstd.a with clang 15 or using a shared libzstd.so). Probably not an important problem, but the error message could certainly be more meaningful.
I can reproduce the issue. It happens when I try to use PGO and LTO together with LLVM 15.0.7.
@berolinux Did you find a generic workaround for the problem? I am not using libzsdtd.a
I'm also seeing this compiling a Rust project.
module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
The project is open source if you want to investigate. https://gitlab.com/kevincox/ricochetrobots
This can be reproduced by removing the -Clto=false
and running nix-build -A native
. Right now I am using nixpkgs 18324978d632ffc55ef1d928e81630c620f4f447 as a base.
And I just got the same error during optimization Vector with PGO: https://github.com/Kobzol/cargo-pgo/issues/32#issuecomment-1694445787
@kevincox try to enable ThinLTO to your project (with lto = "thin"
in your Cargo.toml file). It helped me to avoid the bug with LTO ("fat") + PGO in Vector. Will be interesting to see your results with the same workaround.
In Vector right now I use the following options:
[profile.release]
debug = false
codegen-units = 1
lto = "thin"
PGO build is done with cargo-pgo
.
This still occurred for me with thin LTO configured as you described.
it's a pity :(
Never mind, ThinLTO does not help me too (I've just made a silly mistake). For now, the only way to avoid the bug is to completely disable LTO (with lto = "off"
).
Same here (ld.lld: 18.0.1, clang: 18.0.1, opt: 18.1.8).
What's the preferred / recommended mitigation for this bug?
When (approximately) this bug will be fixed?
Trying to build Qt 6.4.0-beta4 with clang/lld 15-rc3 and LTO enabled results in
clang 14.0.6 works as expected. Sorry, no small test case yet