mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
llvm-runtimes/libcxx: pass -DCMAKE_CXX_COMPILER_WORKS=1 with no GCC
Since libc++ package is merged before llvm-runtimes/clang-stdlib-config during a LLVM version update, clang will attempt to use libstdc++ for the C++ compiler check, and will fail if it is missing. To mitigate this, pass -DCMAKE_CXX_COMPILER_WORKS=1 to cmake to skip the check if GCC is not installed on the system. libc++ still compiles as expected. [sam: Add -b to has_version.] Signed-off-by: Violet Purcell <vimproved@inventati.org> Part-of: https://github.com/gentoo/gentoo/pull/45422 Closes: https://github.com/gentoo/gentoo/pull/45422 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
committed by
Sam James
parent
227d631d98
commit
569deb0cac
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user