summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-10-01 14:09:04 +0200
committerMichał Górny <mgorny@gentoo.org>2019-10-01 14:22:28 +0200
commit460260affe1c3ac55992d94581672a49abdb2fcf (patch)
tree27e1052a70549a9b893de38dc4d15558ec1341a1 /sys-devel
parentprofiles/desc/llvm_targets.desc: RISCV & WASM are no longer exp (diff)
downloadgentoo-460260affe1c3ac55992d94581672a49abdb2fcf.tar.gz
gentoo-460260affe1c3ac55992d94581672a49abdb2fcf.tar.bz2
gentoo-460260affe1c3ac55992d94581672a49abdb2fcf.zip
sys-devel/llvm: Add target obsolescence check
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/llvm-10.0.0.9999.ebuild35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys-devel/llvm/llvm-10.0.0.9999.ebuild b/sys-devel/llvm/llvm-10.0.0.9999.ebuild
index a58ed35b5419..6bfea01a7391 100644
--- a/sys-devel/llvm/llvm-10.0.0.9999.ebuild
+++ b/sys-devel/llvm/llvm-10.0.0.9999.ebuild
@@ -90,6 +90,38 @@ python_check_deps() {
has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
+check_live_ebuild() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+ # reorder
+ all_targets=( "${prod_targets[@]}" "${exp_targets[@]}" )
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ ewarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ ewarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ ewarn "Expected: ${exp_targets[*]}"
+ ewarn
+ fi
+
+ if [[ ${all_targets[*]} != ${ALL_LLVM_TARGETS[*]#llvm_targets_} ]]; then
+ ewarn "ALL_LLVM_TARGETS is outdated!"
+ ewarn " Have: ${ALL_LLVM_TARGETS[*]#llvm_targets_}"
+ ewarn "Expected: ${all_targets[*]}"
+ fi
+}
+
src_prepare() {
# Fix llvm-config for shared linking and sane flags
# https://bugs.gentoo.org/show_bug.cgi?id=565358
@@ -100,6 +132,9 @@ src_prepare() {
# User patches + QA
cmake-utils_src_prepare
+
+ # Verify that the live ebuild is up-to-date
+ check_live_ebuild
}
# Is LLVM being linked against libc++?