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