sys-libs/libcxx: Use -print-libgcc-file-name to get clang_rt path
authorMichał Górny <mgorny@gentoo.org>
Thu, 9 Aug 2018 10:31:54 +0000 (12:31 +0200)
committerMichał Górny <mgorny@gentoo.org>
Thu, 9 Aug 2018 10:31:54 +0000 (12:31 +0200)
Suggested-by: David Carlos Manuelda
Bug: https://bugs.gentoo.org/592326

sys-libs/libcxx/libcxx-5.0.2.ebuild
sys-libs/libcxx/libcxx-6.0.1.ebuild
sys-libs/libcxx/libcxx-6.0.9999.ebuild
sys-libs/libcxx/libcxx-7.0.9999.ebuild
sys-libs/libcxx/libcxx-9999.ebuild

index 885f8b1318263db29f88f698948a18a95caa6bd6..bd65e51b774bf2778dcc3885f255e68cffeafceb 100644 (file)
@@ -94,16 +94,12 @@ multilib_src_configure() {
                # 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
-                       # get the full library list out of 'pretend mode'
-                       # and grep it for libclang_rt references
-                       local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
-                       local i
-                       for i in "${args[@]}"; do
-                               if [[ ${i} == *libclang_rt* ]]; then
-                                       want_gcc_s=OFF
-                                       extra_libs+=( "${i}" )
-                               fi
-                       done
+                       local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
+                          ${LDFLAGS} -print-libgcc-file-name)
+                       if [[ ${compiler_rt} == *libclang_rt* ]]; then
+                               want_gcc_s=OFF
+                               extra_libs+=( "${compiler_rt}" )
+                       fi
                fi
        fi
 
index b7dda42427a241d617a5eee1b6349c6d06540ddf..6c5c866f9c61a75aca14717f68d9bf150a2cb716 100644 (file)
@@ -101,16 +101,12 @@ multilib_src_configure() {
                # 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
-                       # get the full library list out of 'pretend mode'
-                       # and grep it for libclang_rt references
-                       local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
-                       local i
-                       for i in "${args[@]}"; do
-                               if [[ ${i} == *libclang_rt* ]]; then
-                                       want_gcc_s=OFF
-                                       extra_libs+=( "${i}" )
-                               fi
-                       done
+                       local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
+                          ${LDFLAGS} -print-libgcc-file-name)
+                       if [[ ${compiler_rt} == *libclang_rt* ]]; then
+                               want_gcc_s=OFF
+                               extra_libs+=( "${compiler_rt}" )
+                       fi
                fi
        fi
 
index 7454f776ff64f28a6a7c78581227f086aeaa8e3a..8b1b4efcd6e8e819ef0e6369283289a6bf6cca5f 100644 (file)
@@ -113,16 +113,12 @@ multilib_src_configure() {
                # 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
-                       # get the full library list out of 'pretend mode'
-                       # and grep it for libclang_rt references
-                       local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
-                       local i
-                       for i in "${args[@]}"; do
-                               if [[ ${i} == *libclang_rt* ]]; then
-                                       want_gcc_s=OFF
-                                       extra_libs+=( "${i}" )
-                               fi
-                       done
+                       local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
+                          ${LDFLAGS} -print-libgcc-file-name)
+                       if [[ ${compiler_rt} == *libclang_rt* ]]; then
+                               want_gcc_s=OFF
+                               extra_libs+=( "${compiler_rt}" )
+                       fi
                fi
        fi
 
index 64bc9accf2638976c200651df3ef2fb4408f427b..e5777074eeda95de76182ec496701c241f4c3046 100644 (file)
@@ -113,16 +113,12 @@ multilib_src_configure() {
                # 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
-                       # get the full library list out of 'pretend mode'
-                       # and grep it for libclang_rt references
-                       local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
-                       local i
-                       for i in "${args[@]}"; do
-                               if [[ ${i} == *libclang_rt* ]]; then
-                                       want_gcc_s=OFF
-                                       extra_libs+=( "${i}" )
-                               fi
-                       done
+                       local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
+                          ${LDFLAGS} -print-libgcc-file-name)
+                       if [[ ${compiler_rt} == *libclang_rt* ]]; then
+                               want_gcc_s=OFF
+                               extra_libs+=( "${compiler_rt}" )
+                       fi
                fi
        fi
 
index a4fdb61c8c7db7f3b1cb9167df06d7f6bd5e2905..4272b2117944fe665d983443568ed4dfa63f691c 100644 (file)
@@ -112,16 +112,12 @@ multilib_src_configure() {
                # 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
-                       # get the full library list out of 'pretend mode'
-                       # and grep it for libclang_rt references
-                       local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
-                       local i
-                       for i in "${args[@]}"; do
-                               if [[ ${i} == *libclang_rt* ]]; then
-                                       want_gcc_s=OFF
-                                       extra_libs+=( "${i}" )
-                               fi
-                       done
+                       local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
+                          ${LDFLAGS} -print-libgcc-file-name)
+                       if [[ ${compiler_rt} == *libclang_rt* ]]; then
+                               want_gcc_s=OFF
+                               extra_libs+=( "${compiler_rt}" )
+                       fi
                fi
        fi