sys-libs/libcxx: Use -print-libgcc-file-name to get clang_rt path

Suggested-by: David Carlos Manuelda
Bug: https://bugs.gentoo.org/592326
This commit is contained in:
Michał Górny
2018-08-09 12:31:54 +02:00
parent 15db1be343
commit b375c11c5c
5 changed files with 30 additions and 50 deletions

View 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

View 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

View 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

View 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

View 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