commit:     3bdbb08f39ee8ad706760eca5138470e88722510
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 21:44:04 2022 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu May 26 21:44:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bdbb08f

dev-lang/rust: attempt to support libcxx in 1.61.0-r1

Bug: https://bugs.gentoo.org/732632
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-lang/rust/rust-1.61.0-r1.ebuild | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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

Reply via email to