sys-libs/libcxx: Use tc-get-c-rtlib

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2022-10-10 22:46:03 +02:00
parent 2faa09dc23
commit e968fbf5f2
7 changed files with 28 additions and 66 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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