diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | ocl-icd-fix-build-error-with-gcc-10.patch | 41 | ||||
-rw-r--r-- | ocl-icd.spec | 55 | ||||
-rw-r--r-- | sources | 1 |
4 files changed, 98 insertions, 0 deletions
@@ -0,0 +1 @@ +/v2.2.12.tar.gz diff --git a/ocl-icd-fix-build-error-with-gcc-10.patch b/ocl-icd-fix-build-error-with-gcc-10.patch new file mode 100644 index 0000000..3b2dad1 --- /dev/null +++ b/ocl-icd-fix-build-error-with-gcc-10.patch @@ -0,0 +1,41 @@ +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(-) + +diff --git a/icd_generator.rb b/icd_generator.rb +index d299dbd..6bd426d 100644 +--- a/icd_generator.rb ++++ b/icd_generator.rb +@@ -189,7 +189,7 @@ EOF + } + 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" + } +-- +2.30.0 diff --git a/ocl-icd.spec b/ocl-icd.spec new file mode 100644 index 0000000..e82ada6 --- /dev/null +++ b/ocl-icd.spec @@ -0,0 +1,55 @@ +Name: ocl-icd +Version: 2.2.12 +Release: 2 +Summary: OpenCL ICD Bindings +License: BSD +URL: https://github.com/OCL-dev/ocl-icd +Source0: https://github.com/OCL-dev/ocl-icd/archive/v%{version}.tar.gz + +BuildRequires: gcc automake autoconf make libtool opencl-headers ruby rubygems +Patch0001: ocl-icd-fix-build-error-with-gcc-10.patch + +%description +%{summary}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} opencl-headers +%description devel +This package contains the development files for %{name}. + +%prep +%autosetup -p1 + +%build +autoreconf -vfi +%configure +%make_build + +%install +%make_install +rm -vf %{buildroot}%{_libdir}/*.la +rm -vrf %{buildroot}%{_defaultdocdir} + +%check +make check +%ldconfig_scriptlets + +%files +%license COPYING +%doc NEWS README +%{_libdir}/libOpenCL.so.* + +%files devel +%doc ocl_icd_loader_gen.map ocl_icd_bindings.c +%{_includedir}/ocl_icd.h +%{_libdir}/libOpenCL.so +%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/pkgconfig/OpenCL.pc + +%changelog +* Fri Jul 30 2021 sunguoshuai <sunguoshuai@huawei.com> - 2.2.12-2 +- ocl-icd fix build error with gcc 10 + +* Mon Jul 27 2020 maminjie <maminjie1@huawei.com> - 2.2.12-1 +- package init @@ -0,0 +1 @@ +47035a0b597fe334be16a653c7c7951f v2.2.12.tar.gz |