summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ. Liu <[email protected]>2025-02-22 16:08:57 +0800
committerSam James <[email protected]>2025-02-22 17:45:36 +0000
commitc81a596be7fa480e369c0ce7464f92e45e332610 (patch)
treeb7e0dd29939a2886aafc0cae9734d1fe10f67cfa /dev-lang/rust/rust-1.80.1-r101.ebuild
parentnet-misc/socat: add 1.8.0.3 (diff)
downloadgentoo-c81a596be7fa480e369c0ce7464f92e45e332610.tar.gz
gentoo-c81a596be7fa480e369c0ce7464f92e45e332610.tar.bz2
gentoo-c81a596be7fa480e369c0ce7464f92e45e332610.zip
dev-lang/rust: fix experimental targets check
1. target in ALL_LLVM_TARGETS has prefix llvm_targets_, so the check in last commit failed always. 2. using associate array for the test of experimental target's existence 3. sed -i 's:LLVM_EXPERIMENTAL_TARGETS:RUST_EXPERIMENTAL_TARGETS:g' to fix warning on var name collide with ALL_LLVM_EXPERIMENTAL_TARGETS in llvm.org.eclass Fixes: ff8e2b548c258e60463b1df0224beda29c7aacec Signed-off-by: Z. Liu <[email protected]> Closes: https://github.com/gentoo/gentoo/pull/40698 Signed-off-by: Sam James <[email protected]>
Diffstat (limited to 'dev-lang/rust/rust-1.80.1-r101.ebuild')
-rw-r--r--dev-lang/rust/rust-1.80.1-r101.ebuild29
1 files changed, 15 insertions, 14 deletions
diff --git a/dev-lang/rust/rust-1.80.1-r101.ebuild b/dev-lang/rust/rust-1.80.1-r101.ebuild
index fb4c96456714..e535b914f811 100644
--- a/dev-lang/rust/rust-1.80.1-r101.ebuild
+++ b/dev-lang/rust/rust-1.80.1-r101.ebuild
@@ -39,8 +39,12 @@ ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai
ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
-_ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
-ALL_LLVM_EXPERIMENTAL_TARGETS=( )
+# https://github.com/rust-lang/llvm-project/blob/rustc-1.80.1/llvm/CMakeLists.txt
+_ALL_RUST_EXPERIMENTAL_TARGETS=( ARC CSKY DirectX M68k SPIRV Xtensa )
+declare -A ALL_RUST_EXPERIMENTAL_TARGETS
+for _x in "${_ALL_RUST_EXPERIMENTAL_TARGETS[@]}"; do
+ ALL_RUST_EXPERIMENTAL_TARGETS["llvm_targets_${_x}"]=0
+done
LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
SLOT="${PV}"
@@ -51,12 +55,9 @@ LLVM_DEPEND=()
# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
for _x in "${ALL_LLVM_TARGETS[@]}"; do
LLVM_DEPEND+=( " ${_x}? ( $(llvm_gen_dep "llvm-core/llvm:\${LLVM_SLOT}[${_x}]") )" )
- for _xx in "${_ALL_LLVM_EXPERIMENTAL_TARGETS[@]}"; do
- if [[ "${_xx}" == "${_x}" ]] ; then
- ALL_LLVM_EXPERIMENTAL_TARGETS+=( ${_x} )
- break
- fi
- done
+ if [[ -v ALL_RUST_EXPERIMENTAL_TARGETS["${_x}"] ]] ; then
+ ALL_RUST_EXPERIMENTAL_TARGETS["${_x}"]=1
+ fi
done
LLVM_DEPEND+=( " wasm? ( $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}') )" )
LLVM_DEPEND+=( " $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}')" )
@@ -267,13 +268,13 @@ src_configure() {
rust_build="$(rust_abi "${CBUILD}")"
rust_host="$(rust_abi "${CHOST}")"
- LLVM_EXPERIMENTAL_TARGETS=()
- for _x in "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}"; do
- if use llvm_targets_${_x} ; then
- LLVM_EXPERIMENTAL_TARGETS+=( ${_x} )
+ RUST_EXPERIMENTAL_TARGETS=()
+ for _x in "${!ALL_RUST_EXPERIMENTAL_TARGETS[@]}"; do
+ if [[ ${ALL_RUST_EXPERIMENTAL_TARGETS[${_x}]} == 1 ]] && use ${_x} ; then
+ RUST_EXPERIMENTAL_TARGETS+=( ${_x#llvm_targets_} )
fi
done
- LLVM_EXPERIMENTAL_TARGETS=${LLVM_EXPERIMENTAL_TARGETS[@]}
+ RUST_EXPERIMENTAL_TARGETS=${RUST_EXPERIMENTAL_TARGETS[@]}
local cm_btype="$(usex debug DEBUG RELEASE)"
cat <<- _EOF_ > "${S}"/config.toml
@@ -284,7 +285,7 @@ src_configure() {
assertions = $(toml_usex debug)
ninja = true
targets = "${LLVM_TARGETS// /;}"
- experimental-targets = "${LLVM_EXPERIMENTAL_TARGETS// /;}"
+ experimental-targets = "${RUST_EXPERIMENTAL_TARGETS// /;}"
link-shared = $(toml_usex system-llvm)
$(if is_libcxx_linked; then
# https://bugs.gentoo.org/732632