Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/firefox/
Date: Sun, 11 Oct 2020 18:44:03
Message-Id: 1602441824.ce974137d6318c4ebc3321558be253842a72a5e4.whissi@gentoo
1 commit: ce974137d6318c4ebc3321558be253842a72a5e4
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 11 18:21:46 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 11 18:43:44 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce974137
7
8 www-client/firefox: fail if LLVM version used by clang and rust does not match
9
10 If LLVM version does not match, like seen with rust-1.47.0 which is based on
11 LLVM 11 but sys-devel/clang in Gentoo is still at version 10 because LLVM 11
12 is not yet released, linking will fail with errors like
13
14 ld.lld: error: Invalid summary version 9. Version should be in the range [1-8]
15
16 or
17
18 ld.lld: error: ../work/firefox_build/x86_64-unknown-linux-gnu/release/libgkrust.a(gkrust-6d42f0360e1be5e5.gkrust.3v9jvdvg-cgu.0.rcgu.o): Invalid record
19
20 Package-Manager: Portage-3.0.8, Repoman-3.0.1
21 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
22
23 www-client/firefox/firefox-78.3.1.ebuild | 19 +++++++++++++++++++
24 www-client/firefox/firefox-81.0.1-r1.ebuild | 19 +++++++++++++++++++
25 2 files changed, 38 insertions(+)
26
27 diff --git a/www-client/firefox/firefox-78.3.1.ebuild b/www-client/firefox/firefox-78.3.1.ebuild
28 index 99f7f8951b9..37b316bab97 100644
29 --- a/www-client/firefox/firefox-78.3.1.ebuild
30 +++ b/www-client/firefox/firefox-78.3.1.ebuild
31 @@ -393,6 +393,25 @@ pkg_setup() {
32
33 llvm_pkg_setup
34
35 + if use clang && use lto ; then
36 + local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
37 + [[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
38 + [[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
39 +
40 + local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
41 + [[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
42 + [[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
43 +
44 + if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
45 + eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
46 + eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
47 + eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
48 + eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
49 + eerror " - Build ${CATEGORY}/${PN} without USE=lto"
50 + die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
51 + fi
52 + fi
53 +
54 python-any-r1_pkg_setup
55
56 # Avoid PGO profiling problems due to enviroment leakage
57
58 diff --git a/www-client/firefox/firefox-81.0.1-r1.ebuild b/www-client/firefox/firefox-81.0.1-r1.ebuild
59 index 8ec1f4d60eb..65702e05e32 100644
60 --- a/www-client/firefox/firefox-81.0.1-r1.ebuild
61 +++ b/www-client/firefox/firefox-81.0.1-r1.ebuild
62 @@ -393,6 +393,25 @@ pkg_setup() {
63
64 llvm_pkg_setup
65
66 + if use clang && use lto ; then
67 + local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
68 + [[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
69 + [[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
70 +
71 + local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
72 + [[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
73 + [[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
74 +
75 + if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
76 + eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
77 + eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
78 + eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
79 + eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
80 + eerror " - Build ${CATEGORY}/${PN} without USE=lto"
81 + die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
82 + fi
83 + fi
84 +
85 python-any-r1_pkg_setup
86
87 # Avoid PGO profiling problems due to enviroment leakage