diff --git a/llvm-runtimes/libcxx/libcxx-20.1.8-r1.ebuild b/llvm-runtimes/libcxx/libcxx-20.1.8-r1.ebuild index e0e4478f8d0d2..40f9d39127684 100644 --- a/llvm-runtimes/libcxx/libcxx-20.1.8-r1.ebuild +++ b/llvm-runtimes/libcxx/libcxx-20.1.8-r1.ebuild @@ -145,6 +145,12 @@ multilib_src_configure() { # this is broken with standalone builds, and also meaningless -DLIBCXXABI_USE_LLVM_UNWINDER=OFF ) + if ! has_version -b sys-devel/gcc; then + # Since this package is merged before llvm-runtimes/clang-stdlib-config, + # clang will attempt to use libstdc++ for the C++ compiler check, and will + # fail if it is missing. + mycmakeargs+=( -DCMAKE_CXX_COMPILER_WORKS=1 ) + fi if is_crosspkg; then # Needed to target built libc headers local -x CFLAGS="${CFLAGS} -isystem ${ESYSROOT}/usr/${CTARGET}/usr/include" diff --git a/llvm-runtimes/libcxx/libcxx-22.1.0_rc1.ebuild b/llvm-runtimes/libcxx/libcxx-22.1.0_rc1.ebuild index 7d224001ae1b6..670bccda0c24a 100644 --- a/llvm-runtimes/libcxx/libcxx-22.1.0_rc1.ebuild +++ b/llvm-runtimes/libcxx/libcxx-22.1.0_rc1.ebuild @@ -144,6 +144,12 @@ multilib_src_configure() { # this is broken with standalone builds, and also meaningless -DLIBCXXABI_USE_LLVM_UNWINDER=OFF ) + if ! has_version -b sys-devel/gcc; then + # Since this package is merged before llvm-runtimes/clang-stdlib-config, + # clang will attempt to use libstdc++ for the C++ compiler check, and will + # fail if it is missing. + mycmakeargs+=( -DCMAKE_CXX_COMPILER_WORKS=1 ) + fi if is_crosspkg; then # Needed to target built libc headers local -x CFLAGS="${CFLAGS} -isystem ${ESYSROOT}/usr/${CTARGET}/usr/include"