Lines 231-236
llvm_check_deps() {
Link Here
|
231 |
has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]" |
231 |
has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]" |
232 |
} |
232 |
} |
233 |
|
233 |
|
|
|
234 |
# Is LLVM being linked against libc++? |
235 |
is_libcxx_linked() { |
236 |
local code='#include <ciso646> |
237 |
#if defined(_LIBCPP_VERSION) |
238 |
HAVE_LIBCXX |
239 |
#endif |
240 |
' |
241 |
local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1 |
242 |
[[ ${out} == *HAVE_LIBCXX* ]] |
243 |
} |
244 |
|
234 |
pkg_pretend() { |
245 |
pkg_pretend() { |
235 |
pre_build_checks |
246 |
pre_build_checks |
236 |
} |
247 |
} |
Lines 297-303
src_prepare() {
Link Here
|
297 |
src_configure() { |
308 |
src_configure() { |
298 |
filter-flags '-flto*' # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231 |
309 |
filter-flags '-flto*' # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231 |
299 |
|
310 |
|
300 |
local rust_target="" rust_targets="" arch_cflags use_libcxx="false" |
311 |
local rust_target="" rust_targets="" arch_cflags |
301 |
|
312 |
|
302 |
# Collect rust target names to compile standard libs for all ABIs. |
313 |
# Collect rust target names to compile standard libs for all ABIs. |
303 |
for v in $(multilib_get_enabled_abi_pairs); do |
314 |
for v in $(multilib_get_enabled_abi_pairs); do |
Lines 335-348
src_configure() {
Link Here
|
335 |
|
346 |
|
336 |
rust_target="$(rust_abi)" |
347 |
rust_target="$(rust_abi)" |
337 |
|
348 |
|
338 |
# https://bugs.gentoo.org/732632 |
|
|
339 |
if tc-is-clang; then |
340 |
local clang_slot="$(clang-major-version)" |
341 |
if { has_version "sys-devel/clang:${clang_slot}[default-libcxx(-)]" || has_version "sys-devel/clang-common:${clang_slot}[default-libcxx(-)]" || is-flagq -stdlib=libc++; }; then |
342 |
use_libcxx="true" |
343 |
fi |
344 |
fi |
345 |
|
346 |
local cm_btype="$(usex debug DEBUG RELEASE)" |
349 |
local cm_btype="$(usex debug DEBUG RELEASE)" |
347 |
cat <<- _EOF_ > "${S}"/config.toml |
350 |
cat <<- _EOF_ > "${S}"/config.toml |
348 |
changelog-seen = 2 |
351 |
changelog-seen = 2 |
Lines 355-361
src_configure() {
Link Here
|
355 |
targets = "${LLVM_TARGETS// /;}" |
358 |
targets = "${LLVM_TARGETS// /;}" |
356 |
experimental-targets = "" |
359 |
experimental-targets = "" |
357 |
link-shared = $(toml_usex system-llvm) |
360 |
link-shared = $(toml_usex system-llvm) |
358 |
$(if [[ ${use_libcxx} == true ]]; then |
361 |
$(if is_libcxx_linked; then |
|
|
362 |
# https://bugs.gentoo.org/732632 |
359 |
echo "use-libcxx = true" |
363 |
echo "use-libcxx = true" |
360 |
echo "static-libstdcpp = false" |
364 |
echo "static-libstdcpp = false" |
361 |
fi) |
365 |
fi) |
362 |
- |
|
|