public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/ocl-icd/files/, dev-libs/ocl-icd/
@ 2020-03-21 23:30 Sergei Trofimovich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2020-03-21 23:30 UTC (permalink / raw
  To: gentoo-commits

commit:     3b0142eada144a18e5d1bc521b36ae274e0056d7
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 21 23:30:48 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Mar 21 23:30:48 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b0142ea

dev-libs/ocl-icd: tweak for gcc-10, bug #706098

Reported-by: Anthony Parsons
Closes: https://bugs.gentoo.org/706098
Package-Manager: Portage-2.3.94, Repoman-2.3.21
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/ocl-icd/files/ocl-icd-2.2.12-gcc-10.patch | 39 ++++++++++++++++++++++
 dev-libs/ocl-icd/ocl-icd-2.2.12-r1.ebuild          |  2 ++
 2 files changed, 41 insertions(+)

diff --git a/dev-libs/ocl-icd/files/ocl-icd-2.2.12-gcc-10.patch b/dev-libs/ocl-icd/files/ocl-icd-2.2.12-gcc-10.patch
new file mode 100644
index 00000000000..64948d5b05e
--- /dev/null
+++ b/dev-libs/ocl-icd/files/ocl-icd-2.2.12-gcc-10.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/706098
+
+From 4667bddd365bcc1dc66c483835971f0083b44b1d Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 22 Jan 2020 19:38:23 +0000
+Subject: [PATCH] icd_generator.rb: fix build failure against gcc-10
+
+On gcc-10 (and gcc-9 -fno-common) build fails as:
+
+```
+libtool: link: gcc -shared  -fPIC -DPIC  .libs/libdummy_icd.o .libs/libdummy_icd_gen.o \
+    -ldl  -g -O2   -Wl,-soname -Wl,libdummycl.so.0 -o .libs/libdummycl.so.0.0.0
+ld: .libs/libdummy_icd_gen.o:/home/slyfox/dev/git/ocl-icd/libdummy_icd_gen.h:226:
+  multiple definition of `master_dispatch'; .libs/libdummy_icd.o:/home/slyfox/dev/git/ocl-icd/libdummy_icd_gen.h:226: first defined here
+```
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Reported-by: Anthony Parsons
+Bug: https://bugs.gentoo.org/706098
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ icd_generator.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/icd_generator.rb
++++ b/icd_generator.rb
+@@ -207,7 +207,7 @@ def self.generate_libdummy_icd_header
+     }
+     libdummy_icd_structures += "};\n\n"
+     libdummy_icd_structures += "#pragma GCC visibility push(hidden)\n\n"
+-    libdummy_icd_structures += "struct _cl_icd_dispatch master_dispatch; \n\n"
++    libdummy_icd_structures += "extern struct _cl_icd_dispatch master_dispatch; \n\n"
+     $use_name_in_test.each { |k, f|
+       libdummy_icd_structures += "typeof(#{f}) INT#{f};\n"
+     }

diff --git a/dev-libs/ocl-icd/ocl-icd-2.2.12-r1.ebuild b/dev-libs/ocl-icd/ocl-icd-2.2.12-r1.ebuild
index aebd6ac1e7e..3142ef64c65 100644
--- a/dev-libs/ocl-icd/ocl-icd-2.2.12-r1.ebuild
+++ b/dev-libs/ocl-icd/ocl-icd-2.2.12-r1.ebuild
@@ -18,6 +18,8 @@ IUSE="+khronos-headers"
 BDEPEND="${RUBY_DEPS}"
 RDEPEND="app-eselect/eselect-opencl"
 
+PATCHES=("${FILESDIR}"/${P}-gcc-10.patch)
+
 src_prepare() {
 	replace-flags -Os -O2 # bug 646122
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/ocl-icd/files/, dev-libs/ocl-icd/
@ 2021-05-29 14:43 James Le Cuirot
  0 siblings, 0 replies; 2+ messages in thread
From: James Le Cuirot @ 2021-05-29 14:43 UTC (permalink / raw
  To: gentoo-commits

commit:     d19af2426ace8a0bbc48ee64c042ef15a18f29ea
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat May 29 14:41:28 2021 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat May 29 14:43:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d19af242

dev-libs/ocl-icd: Version bump to 2.3.0

This is compatible with the new OpenCL headers.

Closes: https://bugs.gentoo.org/789558
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 dev-libs/ocl-icd/Manifest                          |  1 +
 .../ocl-icd/files/ocl-icd-2.3.0-new-headers.patch  | 94 ++++++++++++++++++++++
 dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild              | 61 ++++++++++++++
 3 files changed, 156 insertions(+)

diff --git a/dev-libs/ocl-icd/Manifest b/dev-libs/ocl-icd/Manifest
index 8b60ba9e2d3..50148b96627 100644
--- a/dev-libs/ocl-icd/Manifest
+++ b/dev-libs/ocl-icd/Manifest
@@ -1,2 +1,3 @@
 DIST ocl-icd-2.2.12.tar.gz 80718 BLAKE2B 524f9eea9782323eafa2f41858c4970333c029898c651bbf15624331e184d1b439d2259532b02defd67c9ab434a35b1b9a64a28e1515b3f42f09b3a270975df7 SHA512 f1668c3a39ecfbc089ee5a5f61f44ceb86ab80e504e58064dec306ce907daf77936c5403b4af15ed8714068891d68346c86725f285cfbc90c4fcb35d18db4048
 DIST ocl-icd-2.2.14.tar.gz 100629 BLAKE2B 4862560541c979edb06d89f7f57b78a34c02e38843c02b0f125a121649cd6a33570e29c86fe7d3fd6f0fa3d489831777100daef97264e32b82854384075cbbf2 SHA512 78510b6fa4e2c6a52141a51ccf0d0ef3110b0b4902a43bb97f7622ff0ce470b108dc05c9619c28ce8758ccea1e1cf6b2e7f1a296f8b07f52532f23b2b036a5cf
+DIST ocl-icd-2.3.0.tar.gz 100848 BLAKE2B b9e5b78df63f4865bb4cb3623fbc6bd336c86b4a9e1f23a29fab1cf11f848cb20d6d8d4a480ff44e442b02d606247a923798143058256ef59c2b16c9daf7098d SHA512 003f3661b7086a7364e79d1058591f12a7095aa2c3decfc4b496f00a0863a91cd81080f33b9308e3948045f8aca5856868ed2725f478654230e51a60d654e613

diff --git a/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch b/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch
new file mode 100644
index 00000000000..aa35c96ccda
--- /dev/null
+++ b/dev-libs/ocl-icd/files/ocl-icd-2.3.0-new-headers.patch
@@ -0,0 +1,94 @@
+From aed1832c81c0971ea001e12d41e04df834257f94 Mon Sep 17 00:00:00 2001
+From: Brice Videau <bvideau@anl.gov>
+Date: Wed, 12 May 2021 10:24:44 -0500
+Subject: [PATCH] Updated to support latest Khronos headers.
+
+---
+ icd_generator.rb                              |   4 +-
+ khronos-headers/CL/cl.h                       |  46 +--
+ khronos-headers/CL/cl_d3d10.h                 |  12 +-
+ khronos-headers/CL/cl_d3d11.h                 |  12 +-
+ khronos-headers/CL/cl_dx9_media_sharing.h     |  32 +-
+ khronos-headers/CL/cl_egl.h                   |   8 +-
+ khronos-headers/CL/cl_ext.h                   | 228 +++++++++----
+ khronos-headers/CL/cl_gl.h                    |  22 +-
+ khronos-headers/CL/cl_gl_ext.h                |  26 +-
+ khronos-headers/CL/cl_icd.h                   | 316 +++++++++---------
+ khronos-headers/CL/cl_layer.h                 |   4 +-
+ khronos-headers/CL/cl_platform.h              | 125 ++++---
+ .../CL/cl_va_api_media_sharing_intel.h        |  24 +-
+ khronos-headers/CL/opencl.h                   |   3 +-
+ ocl_interface.yaml                            |  10 +-
+ run_dummy_icd.c                               |   1 -
+ 16 files changed, 484 insertions(+), 389 deletions(-)
+
+diff --git a/icd_generator.rb b/icd_generator.rb
+index bb0f2e9..ed4217f 100644
+--- a/icd_generator.rb
++++ b/icd_generator.rb
+@@ -57,7 +57,7 @@ module IcdGenerator
+                          "clGetGLContextInfoKHR", "clUnloadCompiler",
+     "clCreateContext", "clCreateContextFromType", "clWaitForEvents"]
+   $header_files = ["/usr/include/CL/cl.h", "/usr/include/CL/cl_gl.h", "/usr/include/CL/cl_egl.h",
+-    "/usr/include/CL/cl_ext.h", "/usr/include/CL/cl_gl_ext.h"]
++    "/usr/include/CL/cl_ext.h"]
+   $windows_header_files = ["/usr/include/CL/cl_dx9_media_sharing.h", "/usr/include/CL/cl_d3d11.h", "/usr/include/CL/cl_d3d10.h"]
+   $cl_data_type_error = { "cl_platform_id"   => "CL_INVALID_PLATFORM",
+                           "cl_device_id"     => "CL_INVALID_DEVICE",
+@@ -246,7 +246,7 @@ def self.generate_run_dummy_icd_source
+     run_dummy_icd += "\n\n"
+     $api_entries.each_key { |func_name|
+        next if $forbidden_funcs.include?(func_name)
+-       run_dummy_icd += $api_entries[func_name]+";\n"
++       run_dummy_icd += $api_entries[func_name]+"\n"
+     }
+     run_dummy_icd += "\n\n"
+     run_dummy_icd += "void call_all_OpenCL_functions(cl_platform_id chosen_platform) {\n"
+diff --git a/ocl_interface.yaml b/ocl_interface.yaml
+index 1e80f16..43a0e59 100644
+--- a/ocl_interface.yaml
++++ b/ocl_interface.yaml
+@@ -674,18 +674,18 @@
+                         const cl_device_partition_property_ext * /* properties */,
+                         cl_uint /*num_entries*/,
+                         cl_device_id * /*out_devices*/,
+-                        cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
++                        cl_uint * /*num_devices*/ ) CL_API_SUFFIX__VERSION_1_1;
+ 90: |-
+   CL_API_ENTRY cl_int CL_API_CALL
+-  clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
++  clRetainDeviceEXT( cl_device_id /*device*/ ) CL_API_SUFFIX__VERSION_1_1;
+ 91: |-
+   CL_API_ENTRY cl_int CL_API_CALL
+-  clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
++  clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_API_SUFFIX__VERSION_1_1;
+ 92: |-
+   CL_API_ENTRY cl_event CL_API_CALL
+   clCreateEventFromGLsyncKHR(cl_context           /* context */,
+                              cl_GLsync            /* cl_GLsync */,
+-                             cl_int *             /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1;
++                             cl_int *             /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
+ 93: |-
+   CL_API_ENTRY cl_int CL_API_CALL
+   clCreateSubDevices(cl_device_id                         /* in_device */,
+@@ -1016,7 +1016,7 @@
+                              const void * /*input_value*/,
+                              size_t /*param_value_size*/,
+                              void* /*param_value*/,
+-                             size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
++                             size_t* /*param_value_size_ret*/ ) CL_API_SUFFIX__VERSION_2_0;
+ 137: |-
+   CL_API_ENTRY cl_kernel CL_API_CALL
+   clCloneKernel(cl_kernel     /* source_kernel */,
+diff --git a/run_dummy_icd.c b/run_dummy_icd.c
+index 400c1b0..c064b19 100644
+--- a/run_dummy_icd.c
++++ b/run_dummy_icd.c
+@@ -39,7 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  include <CL/cl_gl.h>
+ #  include <CL/cl_egl.h>
+ #  include <CL/cl_ext.h>
+-#  include <CL/cl_gl_ext.h>
+ #pragma GCC diagnostic pop
+ #include <string.h>
+ #include "ocl_icd_debug.h"

diff --git a/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild b/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild
new file mode 100644
index 00000000000..3a274d0c168
--- /dev/null
+++ b/dev-libs/ocl-icd/ocl-icd-2.3.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+USE_RUBY="ruby25 ruby26 ruby27 ruby30"
+inherit autotools flag-o-matic multilib-minimal ruby-single
+
+DESCRIPTION="Alternative to vendor specific OpenCL ICD loaders"
+HOMEPAGE="https://github.com/OCL-dev/ocl-icd"
+SRC_URI="https://github.com/OCL-dev/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Does nothing now but by keeping it here we avoid having to have virtual/opencl
+# handle ebuilds both with and without this flag.
+IUSE="+khronos-headers"
+
+BDEPEND="${RUBY_DEPS}"
+DEPEND=">=dev-util/opencl-headers-2021.04.29"
+RDEPEND="${DEPEND}
+	!app-eselect/eselect-opencl
+	!dev-libs/opencl-icd-loader"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-new-headers.patch
+)
+
+src_prepare() {
+	replace-flags -Os -O2 # bug 646122
+
+	default
+	eautoreconf
+}
+
+multilib_src_configure() {
+	# dev-util/opencl-headers ARE official Khronos Group headers, what this option
+	# does is disable the use of the bundled ones
+	ECONF_SOURCE="${S}" econf --enable-pthread-once --disable-official-khronos-headers
+}
+
+multilib_src_compile() {
+	local candidates=(${USE_RUBY})
+	local ruby=
+	for (( idx=${#candidates[@]}-1 ; idx>=0 ; idx-- )) ; do
+		if ${candidates[idx]} --version &> /dev/null; then
+			ruby=${candidates[idx]} && break
+		fi
+	done
+	[[ -z ${ruby} ]] && die "No ruby executable found"
+
+	emake RUBY=${ruby}
+}
+
+multilib_src_install() {
+	default
+
+	# Drop .la files
+	find "${ED}" -name '*.la' -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-29 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-29 14:43 [gentoo-commits] repo/gentoo:master commit in: dev-libs/ocl-icd/files/, dev-libs/ocl-icd/ James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2020-03-21 23:30 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox