commit:     ddbaa6ba91ef9c5ba8fc06de6eab2ef847fad335
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 10:43:04 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 10:43:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ddbaa6ba

dev-lang/opencilk: new package, add 1.1, migrated from ::flow

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 dev-lang/opencilk/Manifest                         |   3 +
 ...er-Remove-cyclades-inclusion-in-sanitizer.patch | 102 +++++++++++++++++++++
 dev-lang/opencilk/metadata.xml                     |   8 ++
 dev-lang/opencilk/opencilk-1.1.ebuild              |  76 +++++++++++++++
 4 files changed, 189 insertions(+)

diff --git a/dev-lang/opencilk/Manifest b/dev-lang/opencilk/Manifest
new file mode 100644
index 000000000..b8af72dab
--- /dev/null
+++ b/dev-lang/opencilk/Manifest
@@ -0,0 +1,3 @@
+DIST opencilk-cheetah-1.1.tar.gz 197399 BLAKE2B 
d0fda6b85ff893d246cee7000298cc061902fa8b8abdf635fdefb291c922849a60b69a245e22d591630d0bfd6f7ad904d13a8c0229f08465ac0f97faee89541a
 SHA512 
5ac6aa993133ca3dbd1e3d500b2af78e4c768dbb0fbdf65abde714a5a026348e513adf42c306382c34f9d2a7b77b8744039c47735f0b1c87993814bd14872c81
+DIST opencilk-productivity-tools-1.1.tar.gz 192982 BLAKE2B 
51ca3e476ffd632b760c9b2fc64f425740e6a13e3c0cadd4ad30119a936816e1f81199cb0ba239d7e7043aa81750be72147f6dd59196f5cd515c78b71470c927
 SHA512 
5d0416db99c382b27fe0b86f7a06da81178114c800b80b9a6394714d82408fdc2c146d65d58a9c2f923a33347007eb24e139b7f194bac633f9672200635886f8
+DIST opencilk-project-1.1.tar.gz 137875544 BLAKE2B 
f9297175cb09f13c6daffbf51c7506fc2efbb4e75f84e8ce1a65c985aed3c0cb10a099a010b7b9612fb442bff0cf8ce41295111bea8c182c11e472b5be08fd7d
 SHA512 
341220f0b638376e2668c136c42490560ce3b87d3fb5aea6c23e4c0eb90f3ce7a11f811d1c31c18366985a4c874bd5387f8cc05e748a4fba31634bc572816513

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
new file mode 100644
index 000000000..46b1d1049
--- /dev/null
+++ 
b/dev-lang/opencilk/files/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch
@@ -0,0 +1,102 @@
+From f7a7928e02c7facb317f92fc5a1c734332fa5f6f Mon Sep 17 00:00:00 2001
+From: Tamar Christina <[email protected]>
+Date: Thu, 20 May 2021 18:55:11 +0100
+Subject: [PATCH] libsanitizer: Remove cyclades inclusion in sanitizer
+
+The Linux kernel has removed the interface to cyclades from
+the latest kernel headers[1] due to them being orphaned for the
+past 13 years.
+
+libsanitizer uses this header when compiling against glibc, but
+glibcs itself doesn't seem to have any references to cyclades.
+
+Further more it seems that the driver is broken in the kernel and
+the firmware doesn't seem to be available anymore.
+
+As such since this is breaking the build of libsanitizer (and so the
+GCC bootstrap[2]) I propose to remove this.
+
+[1] https://lkml.org/lkml/2021/3/2/153
+[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
+
+Reviewed By: eugenis
+
+Differential Revision: https://reviews.llvm.org/D102059
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
+ 
+ #if SANITIZER_GLIBC
+   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
+-  _(CYGETDEFTHRESH, WRITE, sizeof(int));
+-  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
+-  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
+-  _(CYGETTHRESH, WRITE, sizeof(int));
+-  _(CYGETTIMEOUT, WRITE, sizeof(int));
+-  _(CYSETDEFTHRESH, NONE, 0);
+-  _(CYSETDEFTIMEOUT, NONE, 0);
+-  _(CYSETTHRESH, NONE, 0);
+-  _(CYSETTIMEOUT, NONE, 0);
+   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
+   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
+   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
+ # include <sys/procfs.h>
+ #endif
+ #include <sys/user.h>
+-#include <linux/cyclades.h>
+ #include <linux/if_eql.h>
+ #include <linux/if_plip.h>
+ #include <linux/lp.h>
+@@ -459,7 +458,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ 
+ #if SANITIZER_GLIBC
+   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
+-  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
+ #if EV_VERSION > (0x010000)
+   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
+ #else
+@@ -823,15 +821,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ #endif // SANITIZER_LINUX
+ 
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+-  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
+-  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
+-  unsigned IOCTL_CYGETMON = CYGETMON;
+-  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
+-  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
+-  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
+-  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
+-  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
+-  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
+   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
+   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
+   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
+ 
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ extern unsigned struct_ax25_parms_struct_sz;
+-extern unsigned struct_cyclades_monitor_sz;
+ extern unsigned struct_input_keymap_entry_sz;
+ extern unsigned struct_ipx_config_data_sz;
+ extern unsigned struct_kbdiacrs_sz;
+@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
+ #endif  // SANITIZER_LINUX
+ 
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+-extern unsigned IOCTL_CYGETDEFTHRESH;
+-extern unsigned IOCTL_CYGETDEFTIMEOUT;
+-extern unsigned IOCTL_CYGETMON;
+-extern unsigned IOCTL_CYGETTHRESH;
+-extern unsigned IOCTL_CYGETTIMEOUT;
+-extern unsigned IOCTL_CYSETDEFTHRESH;
+-extern unsigned IOCTL_CYSETDEFTIMEOUT;
+-extern unsigned IOCTL_CYSETTHRESH;
+-extern unsigned IOCTL_CYSETTIMEOUT;
+ extern unsigned IOCTL_EQL_EMANCIPATE;
+ extern unsigned IOCTL_EQL_ENSLAVE;
+ extern unsigned IOCTL_EQL_GETMASTRCFG;

diff --git a/dev-lang/opencilk/metadata.xml b/dev-lang/opencilk/metadata.xml
new file mode 100644
index 000000000..87a759d41
--- /dev/null
+++ b/dev-lang/opencilk/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <name>Florian Schmaus</name>
+               <email>[email protected]</email>
+       </maintainer>
+</pkgmetadata>

diff --git a/dev-lang/opencilk/opencilk-1.1.ebuild 
b/dev-lang/opencilk/opencilk-1.1.ebuild
new file mode 100644
index 000000000..f79efe420
--- /dev/null
+++ b/dev-lang/opencilk/opencilk-1.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="The OpenCilk concurrency platform for parallel programming"
+HOMEPAGE="https://opencilk.org/";
+
+SRC_URI="
+       
https://github.com/OpenCilk/opencilk-project/archive/refs/tags/opencilk/v${PV}.tar.gz
 -> ${PN}-project-${PV}.tar.gz
+       
https://github.com/OpenCilk/cheetah/archive/refs/tags/opencilk/v${PV}.tar.gz -> 
${PN}-cheetah-${PV}.tar.gz
+       
https://github.com/OpenCilk/productivity-tools/archive/refs/tags/opencilk/v${PV}.tar.gz
 -> ${PN}-productivity-tools-${PV}.tar.gz
+"
+
+# Since opencilk-project is a fork of LLVM 12, this lists the licenses
+# of LLVM 12, while opencilk-project states that it us under "MIT with
+# the OpenCilk Addendum", which basically states that you can
+# distributed it under the LLVM licences. I am also not sure if OpenCilk
+# is able to change the license of LLVM (which source code they use),
+# hence this needs more investigation and we only list t he LLVM 12
+# licenses, because those definetly are correct.
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug"
+
+MY_POSTFIX="${PN}-v${PV}"
+S="${WORKDIR}/${PN}-project-${MY_POSTFIX}"
+CMAKE_USE_DIR="${S}/llvm"
+
+RDEPEND="
+       dev-libs/libxml2
+       sys-libs/ncurses:=
+       sys-libs/zlib
+"
+
+PATCHES=(
+       
"${FILESDIR}"/llvm-libsanitizer-Remove-cyclades-inclusion-in-sanitizer.patch
+)
+
+src_prepare() {
+       local -A symlinks
+       symlinks["${S}/cheetah"]="${WORKDIR}/cheetah-${MY_POSTFIX}"
+       symlinks["${S}/cilktools"]="${WORKDIR}/productivity-tools-${MY_POSTFIX}"
+
+       local link target
+       for link in "${!symlinks[@]}"; do
+               target="${symlinks[${link}]}"
+               ln -rs "${target}" "${link}" || die
+       done
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local libdir=$(get_libdir)
+       local mycmakeargs=(
+               "-DLLVM_ENABLE_PROJECTS=clang;compiler-rt"
+               "-DLLVM_ENABLE_RUNTIMES=cheetah;cilktools"
+               -DLLVM_TARGETS_TO_BUILD=host
+               -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+               -DCMAKE_INSTALL_PREFIX="${EPREFIX}/opt/${P}"
+               -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+               -DBUILD_SHARED_LIBS=OFF
+               -DLLVM_HOST_TRIPLE="${CHOST}"
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       # Do not install man pages which may conflict with llvm/clang/etc.
+       rm "${ED}/usr/share/man/man1/scan-build.1.bz2" || die
+}

Reply via email to