mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-17 02:39:08 -07:00
Merge updates from master
This commit is contained in:
@@ -60,20 +60,22 @@ tbegin "tc-ld-is-gold (ld=bfd cc=bfd)"
|
||||
LD=ld.bfd LDFLAGS=-fuse-ld=bfd tc-ld-is-gold && ret=1 || ret=0
|
||||
tend ${ret}
|
||||
|
||||
tbegin "tc-ld-is-gold (ld=gold cc=default)"
|
||||
LD=ld.gold tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
if type -P ld.gold &>/dev/null; then
|
||||
tbegin "tc-ld-is-gold (ld=gold cc=default)"
|
||||
LD=ld.gold tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
|
||||
tbegin "tc-ld-is-gold (ld=gold cc=bfd)"
|
||||
LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
tbegin "tc-ld-is-gold (ld=gold cc=bfd)"
|
||||
LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
|
||||
tbegin "tc-ld-is-gold (ld=bfd cc=gold)"
|
||||
LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
tbegin "tc-ld-is-gold (ld=bfd cc=gold)"
|
||||
LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold
|
||||
ret=$?
|
||||
tend ${ret}
|
||||
fi
|
||||
|
||||
#
|
||||
# TEST: tc-ld-disable-gold
|
||||
@@ -87,23 +89,25 @@ tc-ld-disable-gold
|
||||
)
|
||||
tend $?
|
||||
|
||||
tbegin "tc-ld-disable-gold (ld=gold)"
|
||||
(
|
||||
export LD=ld.gold LDFLAGS=
|
||||
ewarn() { :; }
|
||||
tc-ld-disable-gold
|
||||
[[ ${LD} == "ld.bfd" || ${LDFLAGS} == *"-fuse-ld=bfd"* ]]
|
||||
)
|
||||
tend $?
|
||||
if type -P ld.gold &>/dev/null; then
|
||||
tbegin "tc-ld-disable-gold (ld=gold)"
|
||||
(
|
||||
export LD=ld.gold LDFLAGS=
|
||||
ewarn() { :; }
|
||||
tc-ld-disable-gold
|
||||
[[ ${LD} == "ld.bfd" || ${LDFLAGS} == *"-fuse-ld=bfd"* ]]
|
||||
)
|
||||
tend $?
|
||||
|
||||
tbegin "tc-ld-disable-gold (cc=gold)"
|
||||
(
|
||||
export LD= LDFLAGS="-fuse-ld=gold"
|
||||
ewarn() { :; }
|
||||
tc-ld-disable-gold
|
||||
[[ ${LD} == *"/ld.bfd" || ${LDFLAGS} == "-fuse-ld=gold -fuse-ld=bfd" ]]
|
||||
)
|
||||
tend $?
|
||||
tbegin "tc-ld-disable-gold (cc=gold)"
|
||||
(
|
||||
export LD= LDFLAGS="-fuse-ld=gold"
|
||||
ewarn() { :; }
|
||||
tc-ld-disable-gold
|
||||
[[ ${LD} == *"/ld.bfd" || ${LDFLAGS} == "-fuse-ld=gold -fuse-ld=bfd" ]]
|
||||
)
|
||||
tend $?
|
||||
fi
|
||||
|
||||
unset CPP
|
||||
|
||||
@@ -198,4 +202,36 @@ for compiler in gcc clang not-really-a-compiler; do
|
||||
fi
|
||||
done
|
||||
|
||||
if type -P gcc &>/dev/null; then
|
||||
tbegin "tc-get-cxx-stdlib (gcc)"
|
||||
[[ $(CXX=g++ tc-get-cxx-stdlib) == libstdc++ ]]
|
||||
tend $?
|
||||
|
||||
tbegin "tc-get-c-rtlib (gcc)"
|
||||
[[ $(CC=gcc tc-get-c-rtlib) == libgcc ]]
|
||||
tend $?
|
||||
fi
|
||||
|
||||
if type -P clang &>/dev/null; then
|
||||
for stdlib in libc++ libstdc++; do
|
||||
if clang++ -stdlib=${stdlib} -x c++ -E -P - &>/dev/null \
|
||||
<<<'#include <ciso646>'
|
||||
then
|
||||
tbegin "tc-get-cxx-stdlib (clang, ${stdlib})"
|
||||
[[ $(CXX=clang++ CXXFLAGS="-stdlib=${stdlib}" tc-get-cxx-stdlib) == ${stdlib} ]]
|
||||
tend $?
|
||||
fi
|
||||
done
|
||||
|
||||
tbegin "tc-get-cxx-stdlib (clang, invalid)"
|
||||
! CXX=clang++ CXXFLAGS="-stdlib=invalid" tc-get-cxx-stdlib
|
||||
tend $?
|
||||
|
||||
for rtlib in compiler-rt libgcc; do
|
||||
tbegin "tc-get-c-rtlib (clang, ${rtlib})"
|
||||
[[ $(CC=clang CFLAGS="--rtlib=${rtlib}" tc-get-c-rtlib) == ${rtlib} ]]
|
||||
tend $?
|
||||
done
|
||||
fi
|
||||
|
||||
texit
|
||||
|
||||
@@ -1173,4 +1173,68 @@ gen_usr_ldscript() {
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: tc-get-cxx-stdlib
|
||||
# @DESCRIPTION:
|
||||
# Attempt to identify the C++ standard library used by the compiler.
|
||||
# If the library is identified, the function returns 0 and prints one
|
||||
# of the following:
|
||||
#
|
||||
# - ``libc++`` for ``sys-libs/libcxx``
|
||||
# - ``libstdc++`` for ``sys-devel/gcc``'s libstdc++
|
||||
#
|
||||
# If the library is not recognized, the function returns 1.
|
||||
tc-get-cxx-stdlib() {
|
||||
local code='#include <ciso646>
|
||||
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#elif defined(__GLIBCXX__)
|
||||
HAVE_LIBSTDCPP
|
||||
#endif
|
||||
'
|
||||
local res=$(
|
||||
$(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - \
|
||||
<<<"${code}" 2>/dev/null
|
||||
)
|
||||
|
||||
case ${res} in
|
||||
*HAVE_LIBCXX*)
|
||||
echo libc++;;
|
||||
*HAVE_LIBSTDCPP*)
|
||||
echo libstdc++;;
|
||||
*)
|
||||
return 1;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# @FUNCTION: tc-get-c-rtlib
|
||||
# @DESCRIPTION:
|
||||
# Attempt to identify the runtime used by the C/C++ compiler.
|
||||
# If the runtime is identifed, the function returns 0 and prints one
|
||||
# of the following:
|
||||
#
|
||||
# - ``compiler-rt`` for ``sys-libs/compiler-rt``
|
||||
# - ``libgcc`` for ``sys-devel/gcc``'s libgcc
|
||||
#
|
||||
# If the runtime is not recognized, the function returns 1.
|
||||
tc-get-c-rtlib() {
|
||||
local res=$(
|
||||
$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \
|
||||
-print-libgcc-file-name 2>/dev/null
|
||||
)
|
||||
|
||||
case ${res} in
|
||||
*libclang_rt*)
|
||||
echo compiler-rt;;
|
||||
*libgcc*)
|
||||
echo libgcc;;
|
||||
*)
|
||||
return 1;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
@@ -174,18 +174,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -367,7 +355,7 @@ multilib_src_configure() {
|
||||
-DOCAMLFIND=NO
|
||||
)
|
||||
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -186,18 +186,6 @@ src_prepare() {
|
||||
rm test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll || die
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -381,7 +369,7 @@ multilib_src_configure() {
|
||||
-DOCAMLFIND=NO
|
||||
)
|
||||
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -180,18 +180,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -379,7 +367,7 @@ multilib_src_configure() {
|
||||
-DOCAMLFIND=NO
|
||||
)
|
||||
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -180,18 +180,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -379,7 +367,7 @@ multilib_src_configure() {
|
||||
-DOCAMLFIND=NO
|
||||
)
|
||||
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -184,18 +184,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -391,7 +379,7 @@ multilib_src_configure() {
|
||||
# the commit id in the SOVERSION to contain the breakage
|
||||
suffix+="git${EGIT_VERSION::8}"
|
||||
fi
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -184,18 +184,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -391,7 +379,7 @@ multilib_src_configure() {
|
||||
# the commit id in the SOVERSION to contain the breakage
|
||||
suffix+="git${EGIT_VERSION::8}"
|
||||
fi
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -184,18 +184,6 @@ src_prepare() {
|
||||
llvm.org_src_prepare
|
||||
}
|
||||
|
||||
# Is LLVM being linked against libc++?
|
||||
is_libcxx_linked() {
|
||||
local code='#include <ciso646>
|
||||
#if defined(_LIBCPP_VERSION)
|
||||
HAVE_LIBCXX
|
||||
#endif
|
||||
'
|
||||
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
|
||||
|
||||
[[ ${out} == *HAVE_LIBCXX* ]]
|
||||
}
|
||||
|
||||
get_distribution_components() {
|
||||
local sep=${1-;}
|
||||
|
||||
@@ -391,7 +379,7 @@ multilib_src_configure() {
|
||||
# the commit id in the SOVERSION to contain the breakage
|
||||
suffix+="git${EGIT_VERSION::8}"
|
||||
fi
|
||||
if is_libcxx_linked; then
|
||||
if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
|
||||
# Smart hack: alter version suffix -> SOVERSION when linking
|
||||
# against libc++. This way we won't end up mixing LLVM libc++
|
||||
# libraries with libstdc++ clang, and the other way around.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -53,12 +53,8 @@ multilib_src_configure() {
|
||||
|
||||
# link against compiler-rt instead of libgcc if we are using clang with libunwind
|
||||
local want_compiler_rt=OFF
|
||||
if use libunwind && 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
|
||||
if use libunwind && [[ $(tc-get-c-rtlib) == compiler-rt ]]; then
|
||||
want_compiler_rt=ON
|
||||
fi
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
|
||||
@@ -59,12 +59,8 @@ pkg_setup() {
|
||||
multilib_src_configure() {
|
||||
# link against compiler-rt instead of libgcc if we are using clang with libunwind
|
||||
local want_compiler_rt=OFF
|
||||
if use libunwind && 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
|
||||
if use libunwind && [[ $(tc-get-c-rtlib) == compiler-rt ]]; then
|
||||
want_compiler_rt=ON
|
||||
fi
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
|
||||
@@ -63,15 +63,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
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
local mycmakeargs=(
|
||||
@@ -83,7 +77,7 @@ multilib_src_configure() {
|
||||
-DLIBCXXABI_ENABLE_SHARED=ON
|
||||
-DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBCXXABI_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${use_compiler_rt}
|
||||
|
||||
# upstream is omitting standard search path for this
|
||||
# probably because gcc & clang are bundling their own unwind.h
|
||||
|
||||
@@ -62,15 +62,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
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
local mycmakeargs=(
|
||||
@@ -82,7 +76,7 @@ multilib_src_configure() {
|
||||
-DLIBCXXABI_ENABLE_SHARED=ON
|
||||
-DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBCXXABI_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${use_compiler_rt}
|
||||
|
||||
# upstream is omitting standard search path for this
|
||||
# probably because gcc & clang are bundling their own unwind.h
|
||||
|
||||
@@ -62,15 +62,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
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
local mycmakeargs=(
|
||||
@@ -82,7 +76,7 @@ multilib_src_configure() {
|
||||
-DLIBCXXABI_ENABLE_SHARED=ON
|
||||
-DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBCXXABI_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${use_compiler_rt}
|
||||
|
||||
# upstream is omitting standard search path for this
|
||||
# probably because gcc & clang are bundling their own unwind.h
|
||||
|
||||
@@ -62,15 +62,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
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
local mycmakeargs=(
|
||||
@@ -82,7 +76,7 @@ multilib_src_configure() {
|
||||
-DLIBCXXABI_ENABLE_SHARED=ON
|
||||
-DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBCXXABI_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${use_compiler_rt}
|
||||
|
||||
# upstream is omitting standard search path for this
|
||||
# probably because gcc & clang are bundling their own unwind.h
|
||||
|
||||
@@ -62,15 +62,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
|
||||
|
||||
local libdir=$(get_libdir)
|
||||
local mycmakeargs=(
|
||||
@@ -82,7 +76,7 @@ multilib_src_configure() {
|
||||
-DLIBCXXABI_ENABLE_SHARED=ON
|
||||
-DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBCXXABI_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
|
||||
-DLIBCXXABI_USE_COMPILER_RT=${use_compiler_rt}
|
||||
|
||||
# upstream is omitting standard search path for this
|
||||
# probably because gcc & clang are bundling their own unwind.h
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
@@ -80,13 +74,11 @@ multilib_src_configure() {
|
||||
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
|
||||
-DLLVM_INCLUDE_TESTS=OFF
|
||||
-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
|
||||
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON
|
||||
-DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
|
||||
-DLIBUNWIND_INCLUDE_TESTS=$(usex test)
|
||||
-DLIBUNWIND_INSTALL_HEADERS=ON
|
||||
|
||||
# temporarily disabled due to upstream regression
|
||||
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=OFF
|
||||
|
||||
# avoid dependency on libgcc_s if compiler-rt is used
|
||||
-DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user