summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-10-11 20:21:46 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-10-11 20:43:44 +0200
commitce974137d6318c4ebc3321558be253842a72a5e4 (patch)
treee000bdd5770d2fa56c3fb9cf3b3f08f5cdd5464d /www-client/firefox
parentdev-haskell/hxt-charproperties: bump up to 9.4.0.0 (diff)
downloadgentoo-ce974137d6318c4ebc3321558be253842a72a5e4.tar.gz
gentoo-ce974137d6318c4ebc3321558be253842a72a5e4.tar.bz2
gentoo-ce974137d6318c4ebc3321558be253842a72a5e4.zip
www-client/firefox: fail if LLVM version used by clang and rust does not match
If LLVM version does not match, like seen with rust-1.47.0 which is based on LLVM 11 but sys-devel/clang in Gentoo is still at version 10 because LLVM 11 is not yet released, linking will fail with errors like ld.lld: error: Invalid summary version 9. Version should be in the range [1-8] or ld.lld: error: ../work/firefox_build/x86_64-unknown-linux-gnu/release/libgkrust.a(gkrust-6d42f0360e1be5e5.gkrust.3v9jvdvg-cgu.0.rcgu.o): Invalid record Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'www-client/firefox')
-rw-r--r--www-client/firefox/firefox-78.3.1.ebuild19
-rw-r--r--www-client/firefox/firefox-81.0.1-r1.ebuild19
2 files changed, 38 insertions, 0 deletions
diff --git a/www-client/firefox/firefox-78.3.1.ebuild b/www-client/firefox/firefox-78.3.1.ebuild
index 99f7f8951b98..37b316bab979 100644
--- a/www-client/firefox/firefox-78.3.1.ebuild
+++ b/www-client/firefox/firefox-78.3.1.ebuild
@@ -393,6 +393,25 @@ pkg_setup() {
llvm_pkg_setup
+ if use clang && use lto ; then
+ local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
+ [[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
+ [[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
+
+ local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
+ [[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
+ [[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
+
+ if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
+ eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
+ eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
+ eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
+ eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
+ eerror " - Build ${CATEGORY}/${PN} without USE=lto"
+ die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
+ fi
+ fi
+
python-any-r1_pkg_setup
# Avoid PGO profiling problems due to enviroment leakage
diff --git a/www-client/firefox/firefox-81.0.1-r1.ebuild b/www-client/firefox/firefox-81.0.1-r1.ebuild
index 8ec1f4d60eb0..65702e05e323 100644
--- a/www-client/firefox/firefox-81.0.1-r1.ebuild
+++ b/www-client/firefox/firefox-81.0.1-r1.ebuild
@@ -393,6 +393,25 @@ pkg_setup() {
llvm_pkg_setup
+ if use clang && use lto ; then
+ local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
+ [[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
+ [[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
+
+ local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
+ [[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
+ [[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
+
+ if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
+ eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
+ eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
+ eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
+ eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
+ eerror " - Build ${CATEGORY}/${PN} without USE=lto"
+ die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
+ fi
+ fi
+
python-any-r1_pkg_setup
# Avoid PGO profiling problems due to enviroment leakage