summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2022-05-26 14:44:04 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2022-05-26 14:44:43 -0700
commit3bdbb08f39ee8ad706760eca5138470e88722510 (patch)
tree3e11e35d05a350a1b5f3378b20a3524071b14955 /dev-lang
parentdev-util/pkgcheck: add 0.10.11 (diff)
downloadgentoo-3bdbb08f39ee8ad706760eca5138470e88722510.tar.gz
gentoo-3bdbb08f39ee8ad706760eca5138470e88722510.tar.bz2
gentoo-3bdbb08f39ee8ad706760eca5138470e88722510.zip
dev-lang/rust: attempt to support libcxx in 1.61.0-r1
Bug: https://bugs.gentoo.org/732632 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/rust/rust-1.61.0-r1.ebuild13
1 files changed, 12 insertions, 1 deletions
diff --git a/dev-lang/rust/rust-1.61.0-r1.ebuild b/dev-lang/rust/rust-1.61.0-r1.ebuild
index 2e877f2f2bdd..250c7e2f1db2 100644
--- a/dev-lang/rust/rust-1.61.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.61.0-r1.ebuild
@@ -259,7 +259,7 @@ src_prepare() {
}
src_configure() {
- local rust_target="" rust_targets="" arch_cflags
+ local rust_target="" rust_targets="" arch_cflags use_libcxx="false"
# Collect rust target names to compile standard libs for all ABIs.
for v in $(multilib_get_enabled_abi_pairs); do
@@ -308,6 +308,14 @@ src_configure() {
rust_target="$(rust_abi)"
+ # https://bugs.gentoo.org/732632
+ if tc-is-clang; then
+ local clang_slot="$(clang-major-version)"
+ if { has_version "sys-devel/clang:${clang_slot}[default-libcxx]" || is-flagq -stdlib=libc++; }; then
+ use_libcxx="true"
+ fi
+ fi
+
cat <<- _EOF_ > "${S}"/config.toml
changelog-seen = 2
[llvm]
@@ -319,6 +327,7 @@ src_configure() {
targets = "${LLVM_TARGETS// /;}"
experimental-targets = ""
link-shared = $(toml_usex system-llvm)
+ use-libcxx = ${use_libcxx}
$(case "${rust_target}" in
i586-*-linux-*)
# https://github.com/rust-lang/rust/issues/93059
@@ -326,6 +335,8 @@ src_configure() {
echo 'cxxflags = "-fcf-protection=none"'
echo 'ldflags = "-fcf-protection=none"'
;;
+ *)
+ ;;
esac)
[build]
build-stage = 2