summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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