summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-04-21 14:18:00 +0200
committerMichał Górny <mgorny@gentoo.org>2023-04-21 19:15:54 +0200
commit68891a07d20e74c3c7a8ccfa21f45f4c000b6c05 (patch)
treed46526e12a26cc139fe3c6dd5215d8f2cb9cfc5e /sys-libs
parentdev-util/lldb: Add 17.0.0_pre20230421 snapshot (diff)
downloadgentoo-68891a07d20e74c3c7a8ccfa21f45f4c000b6c05.tar.gz
gentoo-68891a07d20e74c3c7a8ccfa21f45f4c000b6c05.tar.bz2
gentoo-68891a07d20e74c3c7a8ccfa21f45f4c000b6c05.zip
sys-libs/compiler-rt: Add 17.0.0_pre20230421 snapshot
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/compiler-rt/Manifest1
-rw-r--r--sys-libs/compiler-rt/compiler-rt-17.0.0_pre20230421.ebuild149
2 files changed, 150 insertions, 0 deletions
diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
index feb0dcafc244..428ab0cdb362 100644
--- a/sys-libs/compiler-rt/Manifest
+++ b/sys-libs/compiler-rt/Manifest
@@ -10,3 +10,4 @@ DIST llvm-project-16.0.1.src.tar.xz.sig 566 BLAKE2B 06c03d789e63ab30bba4c56ba9ec
DIST llvm-project-16.0.2.src.tar.xz 117995768 BLAKE2B b329b2b123428f3a966a96f074a75520f07d12fc13ec755403cff2346b23195e6a0c05ca9e789b4cf5b4b3557a922bd41d8dffb6056ee33fbbf2b81001511fae SHA512 4ca76aaaca8812a06a94071e7444a3213d85dca51ea86f6125f854776f69a3e088a92d0621e3911e526f280b35bfb778fb3742c6010d3ed1eba605c08720377c
DIST llvm-project-16.0.2.src.tar.xz.sig 566 BLAKE2B 8243748ac27e4eec3cc011371e179e19f1005336f07d956fd358f649d1429c8d0ea22ecc376b1dec9fe3db971467ad1dd63e97bb089885d0e1994eeab26b6fd7 SHA512 dbe9367a259954a38f2369b2f226726162090227f1a5ae8c8809eaae47cad7b3b26c754633e6e5c54cacd6360a504d7ba4c659d9232c1648388d657a2aaad10c
DIST llvm-project-5c60a08c696c0420ddc5fdad5b8e50a7528cb3bf.tar.gz 182291041 BLAKE2B f5997611e0293df515d4494d14895cc8fbe22b536f5c419e4ad7d098acbf2b1046ceb332d865eacdae0b7fa1a77b78090551976835dd1b95b5270c9f6e12e410 SHA512 6cda8e55b4fc70e94838c772c56213c811affda96fb98a03d432348f995a313447d0e0e84533350e1fda3162d82633b260ccd8e3b1d59d3216187b44dc5556fb
+DIST llvm-project-5ea158077ec9ca50857ede5cbb0b27c61663fd55.tar.gz 182543024 BLAKE2B 32f5a9ddaa6c7e283d97256d7bd68634f2f8ed6d7167e743ba8076809ea1a3a7159f9ccc56a6e5a8838481cade07389669d8a35b17b5922da0cbef04c80131f8 SHA512 3d180c04ef39adbc9c6ee485e21cdf63fde362f0a22026b00a6d3eba6243e4c8e96fc088335f31051e54f4546d62569131a671d2e655ea735d597361f5732827
diff --git a/sys-libs/compiler-rt/compiler-rt-17.0.0_pre20230421.ebuild b/sys-libs/compiler-rt/compiler-rt-17.0.0_pre20230421.ebuild
new file mode 100644
index 000000000000..5bb8f9d050ac
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-17.0.0_pre20230421.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_{9..11} )
+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
+}