commit:     ee101122758dccf703da7776465116d6cef6fc8f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 20:40:03 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 20:52:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee101122

sys-libs/llvm-libunwind: Use tc-get-c-rtlib

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/llvm-libunwind/llvm-libunwind-13.0.1-r1.ebuild        | 10 ++--------
 sys-libs/llvm-libunwind/llvm-libunwind-14.0.6-r1.ebuild        | 10 ++--------
 sys-libs/llvm-libunwind/llvm-libunwind-15.0.2.ebuild           | 10 ++--------
 sys-libs/llvm-libunwind/llvm-libunwind-15.0.3.9999.ebuild      | 10 ++--------
 sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild      | 10 ++--------
 .../llvm-libunwind/llvm-libunwind-16.0.0_pre20221006.ebuild    | 10 ++--------
 .../llvm-libunwind/llvm-libunwind-16.0.0_pre20221010.ebuild    | 10 ++--------
 7 files changed, 14 insertions(+), 56 deletions(-)

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1-r1.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1-r1.ebuild
index 1de0765ec1bf..76693df7bef7 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1-r1.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1-r1.ebuild
@@ -38,7 +38,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -47,13 +46,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DLLVM_LIBDIR_SUFFIX=${libdir#lib}

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-14.0.6-r1.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-14.0.6-r1.ebuild
index 3596ed724fe0..336f5fc86bf1 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-14.0.6-r1.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-14.0.6-r1.ebuild
@@ -42,7 +42,6 @@ python_check_deps() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -51,13 +50,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DPython3_EXECUTABLE="${PYTHON}"

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.2.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.2.ebuild
index cf301e306fd9..d32002debae2 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.2.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.2.ebuild
@@ -51,7 +51,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -66,13 +65,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.3.9999.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.3.9999.ebuild
index b53a48502232..2f98df4d5ed6 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.3.9999.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.3.9999.ebuild
@@ -50,7 +50,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -65,13 +64,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild
index b53a48502232..2f98df4d5ed6 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0.9999.ebuild
@@ -50,7 +50,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -65,13 +64,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221006.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221006.ebuild
index 1d7329494c4c..7128dcaa091f 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221006.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221006.ebuild
@@ -50,7 +50,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -65,13 +64,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221010.ebuild 
b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221010.ebuild
index 1d7329494c4c..7128dcaa091f 100644
--- a/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221010.ebuild
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-16.0.0_pre20221010.ebuild
@@ -50,7 +50,6 @@ pkg_setup() {
 }
 
 multilib_src_configure() {
-       local use_compiler_rt=OFF
        local libdir=$(get_libdir)
 
        # https://github.com/llvm/llvm-project/issues/56825
@@ -65,13 +64,8 @@ multilib_src_configure() {
 
        # link to compiler-rt
        # https://github.com/gentoo/gentoo/pull/21516
-       if tc-is-clang; then
-               local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
-                  ${LD_FLAGS} -print-libgcc-file-name)
-               if [[ ${compiler_rt} == *libclang_rt* ]]; then
-                       use_compiler_rt=ON
-               fi
-       fi
+       local use_compiler_rt=OFF
+       [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON
 
        local mycmakeargs=(
                -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"

Reply via email to