From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1316332-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 012F61580B9
	for <garchives@archives.gentoo.org>; Fri, 27 Aug 2021 20:10:27 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 59F0CE0920;
	Fri, 27 Aug 2021 20:10:26 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 382C0E0920
	for <gentoo-commits@lists.gentoo.org>; Fri, 27 Aug 2021 20:10:26 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id EDF5D342C78
	for <gentoo-commits@lists.gentoo.org>; Fri, 27 Aug 2021 20:10:24 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id B88F189
	for <gentoo-commits@lists.gentoo.org>; Fri, 27 Aug 2021 20:10:21 +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: <1630095012.4c7e77d3770ba14db57ae649170b4a047c7fafbd.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.0_rc2.ebuild
X-VCS-Directories: sys-libs/llvm-libunwind/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 4c7e77d3770ba14db57ae649170b4a047c7fafbd
X-VCS-Branch: master
Date: Fri, 27 Aug 2021 20:10:21 +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: 0c06683e-5946-41a0-ab58-2e236eeda1d5
X-Archives-Hash: f79a3311180ff163a19488e8db90a2fe

commit:     4c7e77d3770ba14db57ae649170b4a047c7fafbd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 27 07:32:47 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug 27 20:10:12 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c7e77d3

sys-libs/llvm-libunwind: Bump to 13.0.0rc2

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

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

diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
index b6a66e33b83..396c3740d59 100644
--- a/sys-libs/llvm-libunwind/Manifest
+++ b/sys-libs/llvm-libunwind/Manifest
@@ -3,3 +3,4 @@ DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45c
 DIST llvmorg-12.0.0.tar.gz 134226215 BLAKE2B f9c3ba8c58571855caa4f206fd285c9b5be66672fb0814cb8bc0964a051f57f5d35013aa1e27cbda502652b37df1ec23474129109e76a42066847860db441dbe SHA512 0cff02155c5ac0d6db2b72d60d9819d5b5dd859663b45f721b1c7540239c2fceb1f57d9173f6870c49de851c242ed8e85c5c6d6577a1f8092a7c5dcd12513b26
 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
 DIST llvmorg-13.0.0-rc1.tar.gz 147235597 BLAKE2B 089fed119dee8a16f278cebb13808bd5a95629cc87ebee3050225cc041b78fee51acacc5bcc913d4a99e830bfe5774b19a04a845293c5087dd2a8c9d94d2fde9 SHA512 6e307e2c2dcb7ff41d11ee29d69f41c0ef55f200999847a3a924a2e773fc9c2160015746789af8b723c628bd232f97fce63370209bd0065491d80b0cc0017e85
+DIST llvmorg-13.0.0-rc2.tar.gz 147267736 BLAKE2B 153bf7320f2aa911112d366ffc79f7110cb04f135c2a8b176c263f0a75eb768206d9bd462893d45504b0e58aa9e127fdcafb02300eab1666e4616aa654d457dd SHA512 a01baf3eaa02f02af42bfcf6dcf24f166351bf1c09601495617c81e41def23210573bad40a344270f40c5deb881d06863536abac2a6481930766a6a56335fb44

diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0_rc2.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0_rc2.ebuild
new file mode 100644
index 00000000000..a4b1aceef51
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0_rc2.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=ONF
+		-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
+}