From e968fbf5f2132f5ca82b5889f08bec6c2fb65082 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 10 Oct 2022 22:46:03 +0200 Subject: sys-libs/libcxx: Use tc-get-c-rtlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- sys-libs/libcxx/libcxx-13.0.1.ebuild | 12 ++++-------- sys-libs/libcxx/libcxx-14.0.6.ebuild | 12 ++++-------- sys-libs/libcxx/libcxx-15.0.2.ebuild | 14 ++++---------- sys-libs/libcxx/libcxx-15.0.3.9999.ebuild | 14 ++++---------- sys-libs/libcxx/libcxx-16.0.0.9999.ebuild | 14 ++++---------- sys-libs/libcxx/libcxx-16.0.0_pre20221006.ebuild | 14 ++++---------- sys-libs/libcxx/libcxx-16.0.0_pre20221010.ebuild | 14 ++++---------- 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 -- cgit v1.2.3-65-gdbad