Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-lang/opencilk/, dev-lang/opencilk/files/
Date: Fri, 24 Jun 2022 10:46:16
Message-Id: 1656067387.ddbaa6ba91ef9c5ba8fc06de6eab2ef847fad335.flow@gentoo
1 commit: ddbaa6ba91ef9c5ba8fc06de6eab2ef847fad335
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 24 10:43:04 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 24 10:43:07 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ddbaa6ba
7
8 dev-lang/opencilk: new package, add 1.1, migrated from ::flow
9
10 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
11
12 dev-lang/opencilk/Manifest | 3 +
13 ...er-Remove-cyclades-inclusion-in-sanitizer.patch | 102 +++++++++++++++++++++
14 dev-lang/opencilk/metadata.xml | 8 ++
15 dev-lang/opencilk/opencilk-1.1.ebuild | 76 +++++++++++++++
16 4 files changed, 189 insertions(+)
17
18 diff --git a/dev-lang/opencilk/Manifest b/dev-lang/opencilk/Manifest
19 new file mode 100644
20 index 000000000..b8af72dab
21 --- /dev/null
22 +++ b/dev-lang/opencilk/Manifest
23 @@ -0,0 +1,3 @@
24 +DIST opencilk-cheetah-1.1.tar.gz 197399 BLAKE2B d0fda6b85ff893d246cee7000298cc061902fa8b8abdf635fdefb291c922849a60b69a245e22d591630d0bfd6f7ad904d13a8c0229f08465ac0f97faee89541a SHA512 5ac6aa993133ca3dbd1e3d500b2af78e4c768dbb0fbdf65abde714a5a026348e513adf42c306382c34f9d2a7b77b8744039c47735f0b1c87993814bd14872c81
25 +DIST opencilk-productivity-tools-1.1.tar.gz 192982 BLAKE2B 51ca3e476ffd632b760c9b2fc64f425740e6a13e3c0cadd4ad30119a936816e1f81199cb0ba239d7e7043aa81750be72147f6dd59196f5cd515c78b71470c927 SHA512 5d0416db99c382b27fe0b86f7a06da81178114c800b80b9a6394714d82408fdc2c146d65d58a9c2f923a33347007eb24e139b7f194bac633f9672200635886f8
26 +DIST opencilk-project-1.1.tar.gz 137875544 BLAKE2B f9297175cb09f13c6daffbf51c7506fc2efbb4e75f84e8ce1a65c985aed3c0cb10a099a010b7b9612fb442bff0cf8ce41295111bea8c182c11e472b5be08fd7d SHA512 341220f0b638376e2668c136c42490560ce3b87d3fb5aea6c23e4c0eb90f3ce7a11f811d1c31c18366985a4c874bd5387f8cc05e748a4fba31634bc572816513
27
28 diff --git a/dev-lang/opencilk/files/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch b/dev-lang/opencilk/files/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch
29 new file mode 100644
30 index 000000000..46b1d1049
31 --- /dev/null
32 +++ b/dev-lang/opencilk/files/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch
33 @@ -0,0 +1,102 @@
34 +From f7a7928e02c7facb317f92fc5a1c734332fa5f6f Mon Sep 17 00:00:00 2001
35 +From: Tamar Christina <tamar.christina@×××.com>
36 +Date: Thu, 20 May 2021 18:55:11 +0100
37 +Subject: [PATCH] libsanitizer: Remove cyclades inclusion in sanitizer
38 +
39 +The Linux kernel has removed the interface to cyclades from
40 +the latest kernel headers[1] due to them being orphaned for the
41 +past 13 years.
42 +
43 +libsanitizer uses this header when compiling against glibc, but
44 +glibcs itself doesn't seem to have any references to cyclades.
45 +
46 +Further more it seems that the driver is broken in the kernel and
47 +the firmware doesn't seem to be available anymore.
48 +
49 +As such since this is breaking the build of libsanitizer (and so the
50 +GCC bootstrap[2]) I propose to remove this.
51 +
52 +[1] https://lkml.org/lkml/2021/3/2/153
53 +[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
54 +
55 +Reviewed By: eugenis
56 +
57 +Differential Revision: https://reviews.llvm.org/D102059
58 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
59 ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
60 +@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
61 +
62 + #if SANITIZER_GLIBC
63 + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
64 +- _(CYGETDEFTHRESH, WRITE, sizeof(int));
65 +- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
66 +- _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
67 +- _(CYGETTHRESH, WRITE, sizeof(int));
68 +- _(CYGETTIMEOUT, WRITE, sizeof(int));
69 +- _(CYSETDEFTHRESH, NONE, 0);
70 +- _(CYSETDEFTIMEOUT, NONE, 0);
71 +- _(CYSETTHRESH, NONE, 0);
72 +- _(CYSETTIMEOUT, NONE, 0);
73 + _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
74 + _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
75 + _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
76 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
77 ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
78 +@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
79 + # include <sys/procfs.h>
80 + #endif
81 + #include <sys/user.h>
82 +-#include <linux/cyclades.h>
83 + #include <linux/if_eql.h>
84 + #include <linux/if_plip.h>
85 + #include <linux/lp.h>
86 +@@ -459,7 +458,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
87 +
88 + #if SANITIZER_GLIBC
89 + unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
90 +- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
91 + #if EV_VERSION > (0x010000)
92 + unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
93 + #else
94 +@@ -823,15 +821,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
95 + #endif // SANITIZER_LINUX
96 +
97 + #if SANITIZER_LINUX && !SANITIZER_ANDROID
98 +- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
99 +- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
100 +- unsigned IOCTL_CYGETMON = CYGETMON;
101 +- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
102 +- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
103 +- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
104 +- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
105 +- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
106 +- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
107 + unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
108 + unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
109 + unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
110 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
111 ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
112 +@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
113 +
114 + #if SANITIZER_LINUX && !SANITIZER_ANDROID
115 + extern unsigned struct_ax25_parms_struct_sz;
116 +-extern unsigned struct_cyclades_monitor_sz;
117 + extern unsigned struct_input_keymap_entry_sz;
118 + extern unsigned struct_ipx_config_data_sz;
119 + extern unsigned struct_kbdiacrs_sz;
120 +@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
121 + #endif // SANITIZER_LINUX
122 +
123 + #if SANITIZER_LINUX && !SANITIZER_ANDROID
124 +-extern unsigned IOCTL_CYGETDEFTHRESH;
125 +-extern unsigned IOCTL_CYGETDEFTIMEOUT;
126 +-extern unsigned IOCTL_CYGETMON;
127 +-extern unsigned IOCTL_CYGETTHRESH;
128 +-extern unsigned IOCTL_CYGETTIMEOUT;
129 +-extern unsigned IOCTL_CYSETDEFTHRESH;
130 +-extern unsigned IOCTL_CYSETDEFTIMEOUT;
131 +-extern unsigned IOCTL_CYSETTHRESH;
132 +-extern unsigned IOCTL_CYSETTIMEOUT;
133 + extern unsigned IOCTL_EQL_EMANCIPATE;
134 + extern unsigned IOCTL_EQL_ENSLAVE;
135 + extern unsigned IOCTL_EQL_GETMASTRCFG;
136
137 diff --git a/dev-lang/opencilk/metadata.xml b/dev-lang/opencilk/metadata.xml
138 new file mode 100644
139 index 000000000..87a759d41
140 --- /dev/null
141 +++ b/dev-lang/opencilk/metadata.xml
142 @@ -0,0 +1,8 @@
143 +<?xml version="1.0" encoding="UTF-8"?>
144 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
145 +<pkgmetadata>
146 + <maintainer type="person">
147 + <name>Florian Schmaus</name>
148 + <email>flow@g.o</email>
149 + </maintainer>
150 +</pkgmetadata>
151
152 diff --git a/dev-lang/opencilk/opencilk-1.1.ebuild b/dev-lang/opencilk/opencilk-1.1.ebuild
153 new file mode 100644
154 index 000000000..f79efe420
155 --- /dev/null
156 +++ b/dev-lang/opencilk/opencilk-1.1.ebuild
157 @@ -0,0 +1,76 @@
158 +# Copyright 1999-2022 Gentoo Authors
159 +# Distributed under the terms of the GNU General Public License v2
160 +
161 +EAPI=8
162 +
163 +inherit cmake
164 +
165 +DESCRIPTION="The OpenCilk concurrency platform for parallel programming"
166 +HOMEPAGE="https://opencilk.org/"
167 +
168 +SRC_URI="
169 + https://github.com/OpenCilk/opencilk-project/archive/refs/tags/opencilk/v${PV}.tar.gz -> ${PN}-project-${PV}.tar.gz
170 + https://github.com/OpenCilk/cheetah/archive/refs/tags/opencilk/v${PV}.tar.gz -> ${PN}-cheetah-${PV}.tar.gz
171 + https://github.com/OpenCilk/productivity-tools/archive/refs/tags/opencilk/v${PV}.tar.gz -> ${PN}-productivity-tools-${PV}.tar.gz
172 +"
173 +
174 +# Since opencilk-project is a fork of LLVM 12, this lists the licenses
175 +# of LLVM 12, while opencilk-project states that it us under "MIT with
176 +# the OpenCilk Addendum", which basically states that you can
177 +# distributed it under the LLVM licences. I am also not sure if OpenCilk
178 +# is able to change the license of LLVM (which source code they use),
179 +# hence this needs more investigation and we only list t he LLVM 12
180 +# licenses, because those definetly are correct.
181 +LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
182 +SLOT="0"
183 +KEYWORDS="~amd64"
184 +IUSE="debug"
185 +
186 +MY_POSTFIX="${PN}-v${PV}"
187 +S="${WORKDIR}/${PN}-project-${MY_POSTFIX}"
188 +CMAKE_USE_DIR="${S}/llvm"
189 +
190 +RDEPEND="
191 + dev-libs/libxml2
192 + sys-libs/ncurses:=
193 + sys-libs/zlib
194 +"
195 +
196 +PATCHES=(
197 + "${FILESDIR}"/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch
198 +)
199 +
200 +src_prepare() {
201 + local -A symlinks
202 + symlinks["${S}/cheetah"]="${WORKDIR}/cheetah-${MY_POSTFIX}"
203 + symlinks["${S}/cilktools"]="${WORKDIR}/productivity-tools-${MY_POSTFIX}"
204 +
205 + local link target
206 + for link in "${!symlinks[@]}"; do
207 + target="${symlinks[${link}]}"
208 + ln -rs "${target}" "${link}" || die
209 + done
210 +
211 + cmake_src_prepare
212 +}
213 +
214 +src_configure() {
215 + local libdir=$(get_libdir)
216 + local mycmakeargs=(
217 + "-DLLVM_ENABLE_PROJECTS=clang;compiler-rt"
218 + "-DLLVM_ENABLE_RUNTIMES=cheetah;cilktools"
219 + -DLLVM_TARGETS_TO_BUILD=host
220 + -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
221 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/opt/${P}"
222 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
223 + -DBUILD_SHARED_LIBS=OFF
224 + -DLLVM_HOST_TRIPLE="${CHOST}"
225 + )
226 + cmake_src_configure
227 +}
228 +
229 +src_install() {
230 + cmake_src_install
231 + # Do not install man pages which may conflict with llvm/clang/etc.
232 + rm "${ED}/usr/share/man/man1/scan-build.1.bz2" || die
233 +}