From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1344620-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id E7CD2158086
	for <garchives@archives.gentoo.org>; Tue, 30 Nov 2021 10:01:39 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E24C22BC044;
	Tue, 30 Nov 2021 10:01:38 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id BDFDB2BC044
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Nov 2021 10:01:38 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 16DD8342F82
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Nov 2021 10:01:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 1F9DD213
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Nov 2021 10:01:34 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1638266481.8cfb2193aeedd7845ea00bed7606aa318e50dbf4.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/llvm-libunwind/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/llvm-libunwind/Manifest sys-libs/llvm-libunwind/llvm-libunwind-13.0.1_rc1.ebuild
X-VCS-Directories: sys-libs/llvm-libunwind/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 8cfb2193aeedd7845ea00bed7606aa318e50dbf4
X-VCS-Branch: master
Date: Tue, 30 Nov 2021 10:01:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 78ce9175-e469-4520-ae64-90a69dc988df
X-Archives-Hash: 568436cf6cb42f9d95ba44de6371bc86

commit:     8cfb2193aeedd7845ea00bed7606aa318e50dbf4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 30 09:44:47 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 30 10:01:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cfb2193

sys-libs/llvm-libunwind: Bump to 13.0.1_rc1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/llvm-libunwind/Manifest                   |   1 +
 .../llvm-libunwind-13.0.1_rc1.ebuild               | 141 +++++++++++++++++++++
 2 files changed, 142 insertions(+)

diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
index 826997b3c689..e08cd107ad6d 100644
--- a/sys-libs/llvm-libunwind/Manifest
+++ b/sys-libs/llvm-libunwind/Manifest
@@ -1,3 +1,4 @@
 DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
 DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
+DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1_rc1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1_rc1.ebuild
new file mode 100644
index 000000000000..5d782b4128b2
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.1_rc1.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+PYTHON_COMPAT=( python3_{8..10} )
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug static-libs test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-6 for new lit options
+DEPEND="
+	>=sys-devel/llvm-6"
+BDEPEND="
+	test? ( >=sys-devel/clang-3.9.0
+		$(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+	)"
+
+LLVM_COMPONENTS=( libunwind libcxx llvm/cmake )
+LLVM_TEST_COMPONENTS=( libcxxabi )
+llvm.org_set_globals
+
+python_check_deps() {
+	has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+	local use_compiler_rt=OFF
+	local libdir=$(get_libdir)
+
+	# 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 mycmakeargs=(
+		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+		-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+		-DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+		-DLLVM_INCLUDE_TESTS=$(usex test)
+
+		# support non-native unwinding; given it's small enough,
+		# enable it unconditionally
+		-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON
+
+		# avoid dependency on libgcc_s if compiler-rt is used
+		-DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt}
+	)
+	if use test; then
+		local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+		[[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+
+		mycmakeargs+=(
+			-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+			-DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}"
+			-DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
+		)
+	fi
+
+	cmake_src_configure
+}
+
+wrap_libcxxabi() {
+	local mycmakeargs=(
+		-DLIBCXXABI_LIBDIR_SUFFIX=
+		-DLIBCXXABI_ENABLE_SHARED=OFF
+		-DLIBCXXABI_ENABLE_STATIC=ON
+		-DLIBCXXABI_USE_LLVM_UNWINDER=ON
+		-DLIBCXXABI_INCLUDE_TESTS=OFF
+
+		-DLIBCXXABI_LIBCXX_INCLUDES="${BUILD_DIR}"/libcxx/include/c++/v1
+		-DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include
+	)
+
+	local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)"
+	local CMAKE_USE_DIR=${WORKDIR}/libcxxabi
+	local BUILD_DIR=${BUILD_DIR}/libcxxabi
+
+	"${@}"
+}
+
+wrap_libcxx() {
+	local mycmakeargs=(
+		-DLIBCXX_LIBDIR_SUFFIX=
+		-DLIBCXX_ENABLE_SHARED=OFF
+		-DLIBCXX_ENABLE_STATIC=ON
+		-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+		-DLIBCXXABI_USE_LLVM_UNWINDER=ON
+		-DLIBCXX_CXX_ABI=libcxxabi
+		-DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include
+		-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+		-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+		-DLIBCXX_HAS_GCC_S_LIB=OFF
+		-DLIBCXX_INCLUDE_TESTS=OFF
+	)
+
+	local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)"
+	local CMAKE_USE_DIR=${WORKDIR}/libcxx
+	local BUILD_DIR=${BUILD_DIR}/libcxx
+
+	"${@}"
+}
+
+multilib_src_test() {
+	# build local copies of libc++ & libc++abi for testing to avoid
+	# circular deps
+	wrap_libcxx cmake_src_configure
+	wrap_libcxx cmake_build generate-cxx-headers
+	wrap_libcxxabi cmake_src_configure
+	wrap_libcxxabi cmake_src_compile
+	wrap_libcxx cmake_src_compile
+	mv "${BUILD_DIR}"/libcxx*/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die
+
+	local -x LIT_PRESERVES_TMP=1
+	cmake_build check-unwind
+}
+
+multilib_src_install() {
+	cmake_src_install
+
+	# install headers like sys-libs/libunwind
+	doheader "${S}"/include/*.h
+}