Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt/
Date: Mon, 30 Jan 2023 20:33:19
Message-Id: 1675110778.dc92494503d742c2470dc8dafcc45fb52ce7397c.mgorny@gentoo
1 commit: dc92494503d742c2470dc8dafcc45fb52ce7397c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 30 16:26:46 2023 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 30 20:32:58 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc924945
7
8 sys-libs/compiler-rt: Add 16.0.0_rc1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/compiler-rt/Manifest | 2 +
13 sys-libs/compiler-rt/compiler-rt-16.0.0_rc1.ebuild | 149 +++++++++++++++++++++
14 2 files changed, 151 insertions(+)
15
16 diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
17 index ff4ae182a40b..374894677b3a 100644
18 --- a/sys-libs/compiler-rt/Manifest
19 +++ b/sys-libs/compiler-rt/Manifest
20 @@ -5,6 +5,8 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f
21 DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
22 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
23 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
24 +DIST llvm-project-16.0.0rc1.src.tar.xz 118364920 BLAKE2B 449fa321722e77d1a595d0f1f52a4e9492954d928355402f6e07e6c8a20e4ebfc03690ef8272b92eb5cdd58c97ca37fa6baf847d399e36a84e3ea7d94d1ea6ca SHA512 a24074ea8e21af49b0545f02bdec4727e8df841e59340dc189cc5a144a70fc6880e82381fba622ac62c7504f7bf394c916c773ee25904e8faf41eaedce6ae9e0
25 +DIST llvm-project-16.0.0rc1.src.tar.xz.sig 566 BLAKE2B 29a593f74b05ef6268f0b2ee5ebd810a244e7c6b27dd94f709b22bca8e6c8367f8321a6ec61f85476cd399f31519ac2a3c978014afae29490c1e70d26eb6c35f SHA512 dcca03d41ee3cc7d5b150184b03eb9f2e579603ce9cd5289360d1ca47169174afc26a85079cf096ec91e23f487f0b38bb6cd5fb7e5197530582155b16a5ce748
26 DIST llvm-project-46d5a57801bc37e5ebb1a4d6b2acc0fa99c01e8d.tar.gz 180436731 BLAKE2B 51c30c3f11dd55a225b8ebe4ded752ce9e8eb58751e7458c29901dbdd3673f94892d337d111d696e779e3f7ef0bca6c7d79709e2072a4bf3a001d8813125d571 SHA512 ebbe0f8becac39d63433dcc3de474c40f1215fc8faab94fa2ba869d28e66b27e4fe088377bd7ae64575a6d7b07017b88bf92e5488a3185a753e647d8da352bbf
27 DIST llvm-project-6dc85bd3fde7df2999fda07e9e9f2e83d52c6125.tar.gz 175208511 BLAKE2B cf87cf7e9bf7c74aab8ccda0f153369cb81798047fdd48025c3c7030857b128babbaafb667385a5c8e9916e16038b14fee39f1623d329471e73c39c2f2d7bbfa SHA512 e6dc0cacd6c079be8a00364e4c244782d764d9a8d514d65f9078427cb4a0c1663ff88761bfbc1e955a1a990451439110497c2cb7af7f56b2c91f2e9db4389894
28 DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
29
30 diff --git a/sys-libs/compiler-rt/compiler-rt-16.0.0_rc1.ebuild b/sys-libs/compiler-rt/compiler-rt-16.0.0_rc1.ebuild
31 new file mode 100644
32 index 000000000000..2ed5fc860074
33 --- /dev/null
34 +++ b/sys-libs/compiler-rt/compiler-rt-16.0.0_rc1.ebuild
35 @@ -0,0 +1,149 @@
36 +# Copyright 1999-2023 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +
41 +PYTHON_COMPAT=( python3_{9..11} )
42 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
43 +
44 +DESCRIPTION="Compiler runtime library for clang (built-in part)"
45 +HOMEPAGE="https://llvm.org/"
46 +
47 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
48 +SLOT="${LLVM_MAJOR}"
49 +KEYWORDS=""
50 +IUSE="+abi_x86_32 abi_x86_64 +clang debug test"
51 +RESTRICT="!test? ( test ) !clang? ( test )"
52 +
53 +DEPEND="
54 + sys-devel/llvm:${LLVM_MAJOR}
55 +"
56 +BDEPEND="
57 + >=dev-util/cmake-3.16
58 + clang? ( sys-devel/clang )
59 + test? (
60 + $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]")
61 + =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR}
62 + )
63 + !test? (
64 + ${PYTHON_DEPS}
65 + )
66 +"
67 +
68 +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake )
69 +llvm.org_set_globals
70 +
71 +python_check_deps() {
72 + use test || return 0
73 + python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]"
74 +}
75 +
76 +pkg_pretend() {
77 + if ! use clang && ! tc-is-clang; then
78 + ewarn "Building using a compiler other than clang may result in broken atomics"
79 + ewarn "library. Enable USE=clang unless you have a very good reason not to."
80 + fi
81 +}
82 +
83 +pkg_setup() {
84 + # Darwin Prefix builds do not have llvm installed yet, so rely on
85 + # bootstrap-prefix to set the appropriate path vars to LLVM instead
86 + # of using llvm_pkg_setup.
87 + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
88 + LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
89 + fi
90 + python-any-r1_pkg_setup
91 +}
92 +
93 +test_compiler() {
94 + $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
95 + <<<'int main() { return 0; }' &>/dev/null
96 +}
97 +
98 +src_configure() {
99 + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
100 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
101 +
102 + # pre-set since we need to pass it to cmake
103 + BUILD_DIR=${WORKDIR}/${P}_build
104 +
105 + if use clang; then
106 + # Only do this conditionally to allow overriding with
107 + # e.g. CC=clang-13 in case of breakage
108 + if ! tc-is-clang ; then
109 + local -x CC=${CHOST}-clang
110 + local -x CXX=${CHOST}-clang++
111 + fi
112 +
113 + strip-unsupported-flags
114 + fi
115 +
116 + if ! test_compiler; then
117 + local nolib_flags=( -nodefaultlibs -lc )
118 +
119 + if test_compiler "${nolib_flags[@]}"; then
120 + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
121 + ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
122 + elif test_compiler "${nolib_flags[@]}" -nostartfiles; then
123 + # Avoiding -nostartfiles earlier on for bug #862540,
124 + # and set available entry symbol for bug #862798.
125 + nolib_flags+=( -nostartfiles -emain )
126 +
127 + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
128 + ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
129 + fi
130 + fi
131 +
132 + local mycmakeargs=(
133 + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
134 +
135 + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
136 + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
137 + -DCOMPILER_RT_BUILD_MEMPROF=OFF
138 + -DCOMPILER_RT_BUILD_ORC=OFF
139 + -DCOMPILER_RT_BUILD_PROFILE=OFF
140 + -DCOMPILER_RT_BUILD_SANITIZERS=OFF
141 + -DCOMPILER_RT_BUILD_XRAY=OFF
142 +
143 + -DPython3_EXECUTABLE="${PYTHON}"
144 + )
145 +
146 + if use amd64; then
147 + mycmakeargs+=(
148 + -DCAN_TARGET_i386=$(usex abi_x86_32)
149 + -DCAN_TARGET_x86_64=$(usex abi_x86_64)
150 + )
151 + fi
152 +
153 + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then
154 + mycmakeargs+=(
155 + # setting -isysroot is disabled with compiler-rt-prefix-paths.patch
156 + # this allows adding arm64 support using SDK in EPREFIX
157 + -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk"
158 + # Set version based on the SDK in EPREFIX.
159 + # This disables i386 for SDK >= 10.15
160 + -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')"
161 + # Use our libtool instead of looking it up with xcrun
162 + -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
163 + )
164 + fi
165 +
166 + if use test; then
167 + mycmakeargs+=(
168 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
169 + -DLLVM_LIT_ARGS="$(get_lit_flags)"
170 +
171 + -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang"
172 + -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++"
173 + )
174 + fi
175 +
176 + cmake_src_configure
177 +}
178 +
179 +src_test() {
180 + # respect TMPDIR!
181 + local -x LIT_PRESERVES_TMP=1
182 +
183 + cmake_build check-builtins
184 +}