If latest llvm/clang packages are installed (12) then firefox will try to build using llvm / clang 12, however dev-lang/rust (with USE=system-llvm) limits itself to 11. This llvm version mismatch between clang and rust prevents building. Reproducible: Always
Please read the given error message and pick a solution. There is no automatic solution. At the moment it is a bit complicated because dev-lang/rust doesn't support LLVM:12... Mask >=sys-devel/lld-12 for now to force LLVM slot 11...
Is there a workaround? I tried to figure out how to point ld.lld to LLVM 11, to make the warning go away, but found no way to influence which version of lld is being executed. (In reply to Thomas Deutschmann from comment #1) > Please read the given error message and pick a solution. Sadly the recommendations given in the error message are not applicable: > * Rust is using LLVM version 11 but ld.lld version belongs to LLVM version 12. > * You will be unable to link www-client/firefox. To proceed you have the following options: > * - Manually switch rust version using 'eselect rust' to match used LLVM version There is only one Rust version available and it was liked with LLVM 11. > * - Switch to dev-lang/rust[system-llvm] which will guarantee matching version Rust is built with USE=system-llvm and the error appears regardless. > * - Build www-client/firefox without USE=lto I did not try this yet. > At the moment it is a bit complicated because dev-lang/rust doesn't support LLVM:12... Mask >=sys-devel/lld-12 for now to force LLVM slot 11... Is it possible to make Firefox depend on LLVM <=11 instead?
I would think it would make much more sense if firefox defaulted to using the same version of llvm/clang that rust is built with. I can't think of any situation where it would make sense to do otherwise.
(In reply to Dennis Schridde from comment #2) > Is there a workaround? I tried to figure out how to point ld.lld to LLVM > 11, to make the warning go away, but found no way to influence which version > of lld is being executed. No, the workaround is to downgrade entire sys-devel/lld package. > Rust is built with USE=system-llvm and the error appears regardless. Yes, the message > Switch to dev-lang/rust[system-llvm] which will guarantee matching version was written when we did not thought about that rust will ever fall behind LLVM upstream. We will probably adjust the message and add ", as long as dev-lang/rust will supported latest LLVM version". > Is it possible to make Firefox depend on LLVM <=11 instead? I really want to avoid this. Not everyone building firefox is affected by that problem and forcing people to LLVM <12 feels wrong. Keep in mind that the default ebuild will work out of the box. We also got some requests to allow building against LLVM 12 already...
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4343b18757c41a58c0c40e95891d5582ec714dc7 commit 4343b18757c41a58c0c40e95891d5582ec714dc7 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2021-04-19 21:33:14 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2021-04-19 21:34:37 +0000 www-client/firefox: drop LLVM:12 support to aid smooth upgrading USE=lto requires that LLVM version used by rust matches used LLVM version. However, dev-lang/rust-1.51 does not support latest LLVM version (12) so there is currently no way to automatically enforce all depedencies. This seems to be too challenging for average Gentoo users so we are dropping LLVM:12 support for now to aid smooth upgrading. Bug: https://bugs.gentoo.org/784215 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> www-client/firefox/firefox-78.10.0.ebuild | 10 +--------- www-client/firefox/firefox-88.0.ebuild | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-)
*** Bug 784269 has been marked as a duplicate of this bug. ***
I did get this to work using rust-1.52.0_beta, but it was a rather bumpy ride, and then firefox required patching to get rid of the RUSTC_BOOTSTRAP=1 errors. # equery list llvm rust firefox * Searching for llvm ... [IP-] [ ~] sys-devel/llvm-12.0.0:12 * Searching for rust ... [I-O] [ ] dev-lang/rust-1.52.0_beta:beta/1.52.0_beta * Searching for firefox ... [I-O] [ ] www-client/firefox-88.0:0/88
From the stable rust-1.52.0 release notes : Cargo build scripts are now forbidden from setting RUSTC_BOOTSTRAP. I needed to patch firefox and spidermonkey a little bit because of this, but they are currently working for me.