summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-10-10 22:46:03 +0200
committerMichał Górny <mgorny@gentoo.org>2022-10-10 22:52:39 +0200
commite968fbf5f2132f5ca82b5889f08bec6c2fb65082 (patch)
tree6dc8301f0b62a11fb4815a5a4ab907a63e092126
parentsys-libs/libcxxabi: Use tc-get-c-rtlib (diff)
downloadgentoo-e968fbf5f2132f5ca82b5889f08bec6c2fb65082.tar.gz
gentoo-e968fbf5f2132f5ca82b5889f08bec6c2fb65082.tar.bz2
gentoo-e968fbf5f2132f5ca82b5889f08bec6c2fb65082.zip
sys-libs/libcxx: Use tc-get-c-rtlib
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--sys-libs/libcxx/libcxx-13.0.1.ebuild12
-rw-r--r--sys-libs/libcxx/libcxx-14.0.6.ebuild12
-rw-r--r--sys-libs/libcxx/libcxx-15.0.2.ebuild14
-rw-r--r--sys-libs/libcxx/libcxx-15.0.3.9999.ebuild14
-rw-r--r--sys-libs/libcxx/libcxx-16.0.0.9999.ebuild14
-rw-r--r--sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild14
-rw-r--r--sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild14
7 files changed, 28 insertions, 66 deletions
diff --git a/sys-libs/libcxx/libcxx-13.0.1.ebuild b/sys-libs/libcxx/libcxx-13.0.1.ebuild
index f7db45b21571..3021d859b872 100644
--- a/sys-libs/libcxx/libcxx-13.0.1.ebuild
+++ b/sys-libs/libcxx/libcxx-13.0.1.ebuild
@@ -89,14 +89,10 @@ multilib_src_configure() {
extra_libs+=( -lunwind )
# if we're using libunwind and clang with compiler-rt, we want
# to link to compiler-rt instead of -lgcc_s
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_gcc_s=OFF
- want_compiler_rt=ON
- extra_libs+=( "${compiler_rt}" )
- fi
+ if [[ $(tc-get-c-rtlib) == compiler-rt ]]; then
+ want_gcc_s=OFF
+ want_compiler_rt=ON
+ extra_libs+=( "${compiler_rt}" )
fi
elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
# clang-based darwin prefix disables libunwind useflag during
diff --git a/sys-libs/libcxx/libcxx-14.0.6.ebuild b/sys-libs/libcxx/libcxx-14.0.6.ebuild
index 47501e5ea293..063546f816be 100644
--- a/sys-libs/libcxx/libcxx-14.0.6.ebuild
+++ b/sys-libs/libcxx/libcxx-14.0.6.ebuild
@@ -97,14 +97,10 @@ multilib_src_configure() {
extra_libs+=( -lunwind )
# if we're using libunwind and clang with compiler-rt, we want
# to link to compiler-rt instead of -lgcc_s
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_gcc_s=OFF
- want_compiler_rt=ON
- extra_libs+=( "${compiler_rt}" )
- fi
+ if [[ $(tc-get-c-rtlib) == compiler-rt ]]; then
+ want_gcc_s=OFF
+ want_compiler_rt=ON
+ extra_libs+=( "${compiler_rt}" )
fi
elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
# clang-based darwin prefix disables libunwind useflag during
diff --git a/sys-libs/libcxx/libcxx-15.0.2.ebuild b/sys-libs/libcxx/libcxx-15.0.2.ebuild
index 79e6aec88593..275d229a612a 100644
--- a/sys-libs/libcxx/libcxx-15.0.2.ebuild
+++ b/sys-libs/libcxx/libcxx-15.0.2.ebuild
@@ -95,15 +95,9 @@ multilib_src_configure() {
strip-unsupported-flags
fi
- # link against compiler-rt instead of libgcc if this is what clang does
- local want_compiler_rt=OFF
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_compiler_rt=ON
- fi
- fi
+ # link to compiler-rt
+ local use_compiler_rt=OFF
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
# bootstrap: cmake is unhappy if compiler can't link to stdlib
local nolib_flags=( -nodefaultlibs -lc )
@@ -131,7 +125,7 @@ multilib_src_configure() {
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
)
if use test; then
diff --git a/sys-libs/libcxx/libcxx-15.0.3.9999.ebuild b/sys-libs/libcxx/libcxx-15.0.3.9999.ebuild
index c28920c09043..6bcf1a20c831 100644
--- a/sys-libs/libcxx/libcxx-15.0.3.9999.ebuild
+++ b/sys-libs/libcxx/libcxx-15.0.3.9999.ebuild
@@ -94,15 +94,9 @@ multilib_src_configure() {
strip-unsupported-flags
fi
- # link against compiler-rt instead of libgcc if this is what clang does
- local want_compiler_rt=OFF
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_compiler_rt=ON
- fi
- fi
+ # link to compiler-rt
+ local use_compiler_rt=OFF
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
# bootstrap: cmake is unhappy if compiler can't link to stdlib
local nolib_flags=( -nodefaultlibs -lc )
@@ -130,7 +124,7 @@ multilib_src_configure() {
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
)
if use test; then
diff --git a/sys-libs/libcxx/libcxx-16.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-16.0.0.9999.ebuild
index c28920c09043..6bcf1a20c831 100644
--- a/sys-libs/libcxx/libcxx-16.0.0.9999.ebuild
+++ b/sys-libs/libcxx/libcxx-16.0.0.9999.ebuild
@@ -94,15 +94,9 @@ multilib_src_configure() {
strip-unsupported-flags
fi
- # link against compiler-rt instead of libgcc if this is what clang does
- local want_compiler_rt=OFF
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_compiler_rt=ON
- fi
- fi
+ # link to compiler-rt
+ local use_compiler_rt=OFF
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
# bootstrap: cmake is unhappy if compiler can't link to stdlib
local nolib_flags=( -nodefaultlibs -lc )
@@ -130,7 +124,7 @@ multilib_src_configure() {
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
)
if use test; then
diff --git a/sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild b/sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild
index c28920c09043..6bcf1a20c831 100644
--- a/sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild
+++ b/sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild
@@ -94,15 +94,9 @@ multilib_src_configure() {
strip-unsupported-flags
fi
- # link against compiler-rt instead of libgcc if this is what clang does
- local want_compiler_rt=OFF
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_compiler_rt=ON
- fi
- fi
+ # link to compiler-rt
+ local use_compiler_rt=OFF
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
# bootstrap: cmake is unhappy if compiler can't link to stdlib
local nolib_flags=( -nodefaultlibs -lc )
@@ -130,7 +124,7 @@ multilib_src_configure() {
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
)
if use test; then
diff --git a/sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild b/sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild
index c28920c09043..6bcf1a20c831 100644
--- a/sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild
+++ b/sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild
@@ -94,15 +94,9 @@ multilib_src_configure() {
strip-unsupported-flags
fi
- # link against compiler-rt instead of libgcc if this is what clang does
- local want_compiler_rt=OFF
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_compiler_rt=ON
- fi
- fi
+ # link to compiler-rt
+ local use_compiler_rt=OFF
+ [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
# bootstrap: cmake is unhappy if compiler can't link to stdlib
local nolib_flags=( -nodefaultlibs -lc )
@@ -130,7 +124,7 @@ multilib_src_configure() {
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
-DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
+ -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
)
if use test; then