summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-10-11 20:23:58 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-10-11 20:43:44 +0200
commit24b898c5ed4e1c7957ed2f1e7c612c52dfef1563 (patch)
treea684eab75ac7ec923f078758e2f5b863a40bf447 /mail-client
parentwww-client/firefox: fail if LLVM version used by clang and rust does not match (diff)
downloadgentoo-24b898c5ed4e1c7957ed2f1e7c612c52dfef1563.tar.gz
gentoo-24b898c5ed4e1c7957ed2f1e7c612c52dfef1563.tar.bz2
gentoo-24b898c5ed4e1c7957ed2f1e7c612c52dfef1563.zip
mail-client/thunderbird: fail if LLVM version used by clang and rust does not match
See same changes for www-client/firefox for details. Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'mail-client')
-rw-r--r--mail-client/thunderbird/thunderbird-78.3.2.ebuild19
1 files changed, 19 insertions, 0 deletions
diff --git a/mail-client/thunderbird/thunderbird-78.3.2.ebuild b/mail-client/thunderbird/thunderbird-78.3.2.ebuild
index 72378be0591e..23bfc4a04382 100644
--- a/mail-client/thunderbird/thunderbird-78.3.2.ebuild
+++ b/mail-client/thunderbird/thunderbird-78.3.2.ebuild
@@ -382,6 +382,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