From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1495253-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 9554F158062
	for <garchives@archives.gentoo.org>; Sat, 11 Mar 2023 15:46:21 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 333E2E0827;
	Sat, 11 Mar 2023 15:46:18 +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 0679DE0825
	for <gentoo-commits@lists.gentoo.org>; Sat, 11 Mar 2023 15:46:18 +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 D46CC335D16
	for <gentoo-commits@lists.gentoo.org>; Sat, 11 Mar 2023 15:46:16 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 402DB8E4
	for <gentoo-commits@lists.gentoo.org>; Sat, 11 Mar 2023 15:46:14 +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: <1678549564.ecccd4a8bb6b9a1f4f7107c2198fd065c88b6490.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt-sanitizers/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/compiler-rt-sanitizers/Manifest sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_rc4.ebuild
X-VCS-Directories: sys-libs/compiler-rt-sanitizers/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: ecccd4a8bb6b9a1f4f7107c2198fd065c88b6490
X-VCS-Branch: master
Date: Sat, 11 Mar 2023 15:46:14 +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: 73c9d96a-13b1-48f1-9fe5-7a1d194a2dfd
X-Archives-Hash: 20b3db42d517c9c77f66630554e3e3ec

commit:     ecccd4a8bb6b9a1f4f7107c2198fd065c88b6490
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 11 08:35:58 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 11 15:46:04 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecccd4a8

sys-libs/compiler-rt-sanitizers: Bump to 16.0.0_rc4

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

 sys-libs/compiler-rt-sanitizers/Manifest           |   2 +
 .../compiler-rt-sanitizers-16.0.0_rc4.ebuild       | 216 +++++++++++++++++++++
 2 files changed, 218 insertions(+)

diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index ff6baaa1dffe..d6ff3389d45f 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -6,4 +6,6 @@ DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78
 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
 DIST llvm-project-16.0.0rc3.src.tar.xz 117914548 BLAKE2B 18ffa35eb73c7cc4626d7b6b7b30aade7171ee2e17fb8d72e79a67185e809f611fefa4cfef17e5cd16822a5a70de2222534dc9f146fc53987eb49ff6a9d98c18 SHA512 d14e5e5ec984a0dc0292a2d27440398b3e32f120c1579517054dcb1a05dbc4ac5f1c6d078a3d6ef8597a71af6f22863868680a972a571839dcd573418b4a4697
 DIST llvm-project-16.0.0rc3.src.tar.xz.sig 566 BLAKE2B 43683d2d7b266a847516f71412bf6236a355462430330fc0da1d624fb8dfbc98bfc982d367baee74d5b4964a9e82e7a4a6ea84bdcff3996d246932f516cced1a SHA512 61adc4dc3eb5a4c11a7f96f9267ff37895e5845a08d48a609a03a2696c1b6bca5af5861a6f28de936c48e6d621bf282170589187f2cb593a912b9078300cf47c
+DIST llvm-project-16.0.0rc4.src.tar.xz 117930024 BLAKE2B 55cf032ad3ba52d2af0942fe1c627319ae95b466122d04b24a917c33e29139fae546d92c375715600190c02426b798803ead0ab7a97d86960cf98fca80e8815c SHA512 8d628205c5b93fe6683b67b97b5c7f98bae945bd87cccebcdac00ddd4362108bd171f077a5196242be0fb909c795592b34bfa1c96c50a744fb68f287fd9781cc
+DIST llvm-project-16.0.0rc4.src.tar.xz.sig 566 BLAKE2B bfcf39070f32e16cfeae699d95d06f184b1331c3af403340c31cc5a973a3bb1faec0b6342445176cebed5819ddf68e4abfdaa8542ec425b1c822fc8c03c03349 SHA512 2af72e3d771e2361873007a944dcccfe81fbdbc3025a2101e03cbc15f1a173d39ceb94c4ae8966b1d7564bf004ee9a5ffa032e2334c0cf7154aea1090d04b00f
 DIST llvm-project-2708869801ae00f4681f6b2d9d69b25b3fce26b6.tar.gz 180523586 BLAKE2B cf918d1e23f922d201a44531c9765b7d8ec2b3b8499ea7954845abcd5fa2687e85b3a34819a583c4f4a6d6e1baa49dbac0b4450cd6b9b322b0f13c88cd7da93c SHA512 18cb00e93d819993a925ae0467d382bc952d82c1eb92dbbb5bb3cdf87043269948670713734ddc3ea4ec50544e54dd11b6747496f7eaa02479374ab9ad075aa5

diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_rc4.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_rc4.ebuild
new file mode 100644
index 000000000000..cc599404c49c
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-16.0.0_rc4.ebuild
@@ -0,0 +1,216 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit check-reqs cmake flag-o-matic llvm llvm.org python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
+SLOT="${LLVM_MAJOR}"
+KEYWORDS=""
+IUSE="+abi_x86_32 abi_x86_64 +clang debug test"
+# base targets
+IUSE+=" +libfuzzer +memprof +orc +profile +xray"
+# sanitizer targets, keep in sync with config-ix.cmake
+# NB: ubsan, scudo deliberately match two entries
+SANITIZER_FLAGS=(
+	asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo
+	shadowcallstack gwp-asan
+)
+IUSE+=" ${SANITIZER_FLAGS[@]/#/+}"
+REQUIRED_USE="
+	|| ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray )
+	test? (
+		cfi? ( ubsan )
+		gwp-asan? ( scudo )
+	)
+"
+RESTRICT="
+	!clang? ( test )
+	!test? ( test )
+"
+
+DEPEND="
+	sys-devel/llvm:${LLVM_MAJOR}
+	virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?]
+"
+BDEPEND="
+	>=dev-util/cmake-3.16
+	clang? ( sys-devel/clang )
+	elibc_glibc? ( net-libs/libtirpc )
+	test? (
+		$(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]")
+		=sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR}
+		sys-libs/compiler-rt:${LLVM_MAJOR}
+	)
+	!test? (
+		${PYTHON_DEPS}
+	)
+"
+
+LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party )
+llvm.org_set_globals
+
+python_check_deps() {
+	use test || return 0
+	python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]"
+}
+
+check_space() {
+	if use test; then
+		local CHECKREQS_DISK_BUILD=11G
+		check-reqs_pkg_pretend
+	fi
+}
+
+pkg_pretend() {
+	check_space
+}
+
+pkg_setup() {
+	check_space
+	LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+	python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die
+
+	local flag
+	for flag in "${SANITIZER_FLAGS[@]}"; do
+		if ! use "${flag}"; then
+			local cmake_flag=${flag/-/_}
+			sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \
+				cmake/config-ix.cmake || die
+		fi
+	done
+
+	# TODO: fix these tests to be skipped upstream
+	if use asan && ! use profile; then
+		rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die
+	fi
+	if use ubsan && ! use cfi; then
+		> test/cfi/CMakeLists.txt || die
+	fi
+
+	llvm.org_src_prepare
+}
+
+src_configure() {
+	# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+	use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+	# pre-set since we need to pass it to cmake
+	BUILD_DIR=${WORKDIR}/compiler-rt_build
+
+	if use clang; then
+		local -x CC=${CHOST}-clang
+		local -x CXX=${CHOST}-clang++
+		strip-unsupported-flags
+	fi
+
+	local flag want_sanitizer=OFF
+	for flag in "${SANITIZER_FLAGS[@]}"; do
+		if use "${flag}"; then
+			want_sanitizer=ON
+			break
+		fi
+	done
+
+	local mycmakeargs=(
+		-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
+		# use a build dir structure consistent with install
+		# this makes it possible to easily deploy test-friendly clang
+		-DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}"
+
+		-DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+		# builtins & crt installed by sys-libs/compiler-rt
+		-DCOMPILER_RT_BUILD_BUILTINS=OFF
+		-DCOMPILER_RT_BUILD_CRT=OFF
+		-DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer)
+		-DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof)
+		-DCOMPILER_RT_BUILD_ORC=$(usex orc)
+		-DCOMPILER_RT_BUILD_PROFILE=$(usex profile)
+		-DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}"
+		-DCOMPILER_RT_BUILD_XRAY=$(usex xray)
+
+		-DPython3_EXECUTABLE="${PYTHON}"
+	)
+
+	if use amd64; then
+		mycmakeargs+=(
+			-DCAN_TARGET_i386=$(usex abi_x86_32)
+			-DCAN_TARGET_x86_64=$(usex abi_x86_64)
+		)
+	fi
+
+	if use test; then
+		mycmakeargs+=(
+			-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+			-DLLVM_LIT_ARGS="$(get_lit_flags)"
+
+			# they are created during src_test()
+			-DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang"
+			-DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++"
+		)
+
+		# same flags are passed for build & tests, so we need to strip
+		# them down to a subset supported by clang
+		CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \
+		CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \
+		strip-unsupported-flags
+	fi
+
+	if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
+		mycmakeargs+=(
+			# setting -isysroot is disabled with compiler-rt-prefix-paths.patch
+			# this allows adding arm64 support using SDK in EPREFIX
+			-DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
+			# Set version based on the SDK in EPREFIX
+			# This disables i386 for SDK >= 10.15
+			# Will error if has_use tsan and SDK < 10.12
+			-DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
+			# Use our libtool instead of looking it up with xcrun
+			-DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+		)
+	fi
+
+	cmake_src_configure
+
+	if use test; then
+		local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* )
+		[[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+		[[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+		# copy clang over since resource_dir is located relatively to binary
+		# therefore, we can put our new libraries in it
+		mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die
+		cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \
+			"${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die
+		cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \
+			"${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die
+		cp "${sys_dir}"/*builtins*.a \
+			"${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die
+		# we also need LLVMgold.so for gold-based tests
+		if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then
+			ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \
+				"${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die
+		fi
+	fi
+}
+
+src_test() {
+	# respect TMPDIR!
+	local -x LIT_PRESERVES_TMP=1
+	# disable sandbox to have it stop clobbering LD_PRELOAD
+	local -x SANDBOX_ON=0
+	# wipe LD_PRELOAD to make ASAN happy
+	local -x LD_PRELOAD=
+
+	cmake_build check-all
+}