commit:     5186ce90425a72fe15b3948ce4ce83074b933d17
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  8 12:28:17 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug  8 18:31:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5186ce90

sys-libs/compiler-rt: Add 17.0.0_rc2

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

 sys-libs/compiler-rt/Manifest                      |   2 +
 sys-libs/compiler-rt/compiler-rt-17.0.0_rc2.ebuild | 149 +++++++++++++++++++++
 2 files changed, 151 insertions(+)

diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
index 22e7a731cb12..a6ee9a92094f 100644
--- a/sys-libs/compiler-rt/Manifest
+++ b/sys-libs/compiler-rt/Manifest
@@ -8,4 +8,6 @@ DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 
95192d39cbd2914e5609db3659
 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 
2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a
 SHA512 
ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
 DIST llvm-project-17.0.0rc1.src.tar.xz 127805900 BLAKE2B 
ab6e3b7e7af10bbb086bdd271691c259925b8047d8425b0eafb55d2c1daf637c3a56903b88e50283667955e780a47f61e7215a1e3a1acd3634c62960cf17317f
 SHA512 
fa7ebe7fad14087861dc0eea08f68e8aa01dcc6560d70163ec38819a7fd799484f6ab1e35a69393a14962b45fa0a469c9d6c5fd2882b3609305bd01bc9f6701f
 DIST llvm-project-17.0.0rc1.src.tar.xz.sig 438 BLAKE2B 
976098c616d7f01c08c5be1d76dd395950184d2c6750f3f2c14235cdf446f1d876d842b3591f827cf1157fa25c707862a374e34d61fb73afe5a7b08d6041ee4a
 SHA512 
272e92dec1fd43819f6fafdaa7f55a975e60a1c3000a69875209b89b7f3e2d2851e32ec0f2725242479203068349aaeff8da261d998a2325a9c52733bc5d7697
+DIST llvm-project-17.0.0rc2.src.tar.xz 127795160 BLAKE2B 
58ed818f61e1cd179288d578e89460782617a3791a65dbc3e1f207629004f0d61225e87b78fdc0eeb3647912e5056ab68ce35ea2639a34ded1d8bdf0452e31f8
 SHA512 
7eb5c5172b5e9af65c940c876779f90e20a02659bf1489cedd06c67eea205aa1f4bdc5a8134a120db98cb80ca54673902b530c3315c9b53384c091200d9162c0
+DIST llvm-project-17.0.0rc2.src.tar.xz.sig 438 BLAKE2B 
55788eacc592729839dad581b507794f279d84cafcaa49785ae34e02931ee9d4f64caf9e251e280dbc8676f3cacdca52a22f36cf7282655a3fc0721a61c9f003
 SHA512 
141e1ba7eb9870c21b91060ca484316cc8a402d4e61c8312688023850070b255b0eebe2d10ef63925f7269ee1b347074440e1a9a18d37cb7e1b6c82a7d1a1710
 DIST llvm-project-c4bb3e073548cf436d5fa0406e3ae75e94684dec.tar.gz 195462091 
BLAKE2B 
982f1105db6cf63575916a20432df4c8623bdff236ce3bd95e63ffd931bc8e1f0e9ea9ad673b09d749c35c1bfe68a48f5b4080118f25040498db09a580db3a7e
 SHA512 
1c591175f44da85eb5ee831220c0387a3d9a0604beaf7abd89fbc6d1e0e9c4f80dac73de1dc22375a45115dd4c1d764fed0a0f628993ca780eb6991682aa0b5b

diff --git a/sys-libs/compiler-rt/compiler-rt-17.0.0_rc2.ebuild 
b/sys-libs/compiler-rt/compiler-rt-17.0.0_rc2.ebuild
new file mode 100644
index 000000000000..f31c17f1962a
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-17.0.0_rc2.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+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"
+RESTRICT="!test? ( test ) !clang? ( test )"
+
+DEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
+"
+BDEPEND="
+       >=dev-util/cmake-3.16
+       clang? ( sys-devel/clang )
+       test? (
+               $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]")
+               =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR}
+       )
+       !test? (
+               ${PYTHON_DEPS}
+       )
+"
+
+LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake )
+llvm.org_set_globals
+
+python_check_deps() {
+       use test || return 0
+       python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]"
+}
+
+pkg_pretend() {
+       if ! use clang && ! tc-is-clang; then
+               ewarn "Building using a compiler other than clang may result in 
broken atomics"
+               ewarn "library. Enable USE=clang unless you have a very good 
reason not to."
+       fi
+}
+
+pkg_setup() {
+       # Darwin Prefix builds do not have llvm installed yet, so rely on
+       # bootstrap-prefix to set the appropriate path vars to LLVM instead
+       # of using llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version sys-devel/llvm; then
+               LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+       fi
+       python-any-r1_pkg_setup
+}
+
+test_compiler() {
+       $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+               <<<'int main() { return 0; }' &>/dev/null
+}
+
+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}/${P}_build
+
+       if use clang; then
+               # Only do this conditionally to allow overriding with
+               # e.g. CC=clang-13 in case of breakage
+               if ! tc-is-clang ; then
+                       local -x CC=${CHOST}-clang
+                       local -x CXX=${CHOST}-clang++
+               fi
+
+               strip-unsupported-flags
+       fi
+
+       if ! test_compiler; then
+               local nolib_flags=( -nodefaultlibs -lc )
+
+               if test_compiler "${nolib_flags[@]}"; then
+                       local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+                       ewarn "${CC} seems to lack runtime, trying with 
${nolib_flags[*]}"
+               elif test_compiler "${nolib_flags[@]}" -nostartfiles; then
+                       # Avoiding -nostartfiles earlier on for bug #862540,
+                       # and set available entry symbol for bug #862798.
+                       nolib_flags+=( -nostartfiles -emain )
+
+                       local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+                       ewarn "${CC} seems to lack runtime, trying with 
${nolib_flags[*]}"
+               fi
+       fi
+
+       local mycmakeargs=(
+               
-DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
+
+               -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+               -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
+               -DCOMPILER_RT_BUILD_MEMPROF=OFF
+               -DCOMPILER_RT_BUILD_ORC=OFF
+               -DCOMPILER_RT_BUILD_PROFILE=OFF
+               -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+               -DCOMPILER_RT_BUILD_XRAY=OFF
+
+               -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 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
+                       -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
+
+       if use test; then
+               mycmakeargs+=(
+                       -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+                       -DLLVM_LIT_ARGS="$(get_lit_flags)"
+
+                       
-DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang"
+                       
-DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++"
+               )
+       fi
+
+       cmake_src_configure
+}
+
+src_test() {
+       # respect TMPDIR!
+       local -x LIT_PRESERVES_TMP=1
+
+       cmake_build check-builtins
+}

Reply via email to