Import pocl_3.0-6.debian.tar.xz
authorAndreas Beckmann <anbe@debian.org>
Wed, 3 Aug 2022 23:54:01 +0000 (00:54 +0100)
committerAndreas Beckmann <anbe@debian.org>
Wed, 3 Aug 2022 23:54:01 +0000 (00:54 +0100)
[dgit import tarball pocl 3.0-6 pocl_3.0-6.debian.tar.xz]

53 files changed:
changelog [new file with mode: 0644]
clean [new file with mode: 0644]
control [new file with mode: 0644]
copyright [new file with mode: 0644]
libpocl-dev.install [new file with mode: 0644]
libpocl2-common.install [new file with mode: 0644]
libpocl2.install [new file with mode: 0644]
libpocl2.lintian-overrides [new file with mode: 0644]
libpocl2.symbols [new file with mode: 0644]
patches/1001-poclcc-use-poclu_show_program_build_log.patch [new file with mode: 0644]
patches/1002-check-CMAKE_LIBRARY_ARCHITECTURE-instead-of-CMAKE_SY.patch [new file with mode: 0644]
patches/1003-llc-version-no-longer-exits-with-a-non-zero-return-c.patch [new file with mode: 0644]
patches/1004-try-to-apply-the-LLVM-style-first.patch [new file with mode: 0644]
patches/1005-no-using-namespace-in-headers.patch [new file with mode: 0644]
patches/1006-always-use-runtime-determined-llvm_cpu-to-compute-bu.patch [new file with mode: 0644]
patches/1007-force-kernellib-name-on-HOST_CPU_FORCED-too.patch [new file with mode: 0644]
patches/1008-use-a-UTC-timestamp-for-POCL_BUILD_TIMESTAMP.patch [new file with mode: 0644]
patches/1009-rename-getX86KernelLibName-to-pocl_get_distro_kernel.patch [new file with mode: 0644]
patches/1010-use-a-more-generic-solution-for-pocl_get_distro_kern.patch [new file with mode: 0644]
patches/1011-add-pocl_get_distro_cpu_name.patch [new file with mode: 0644]
patches/1012-_cl_device_id-add-const-char-kernellib_name.patch [new file with mode: 0644]
patches/1013-allow-overriding-kernellib_name-for-distro-builds-wi.patch [new file with mode: 0644]
patches/1014-improve-grouping-of-ENABLE_HOST_CPU_DEVICES-specific.patch [new file with mode: 0644]
patches/1015-use-_LLC_HOST_CPU-as-internal-variable.patch [new file with mode: 0644]
patches/1016-let-LLC_HOST_CPU-be-forced-HOST_CPU_FORCED-to-any-cp.patch [new file with mode: 0644]
patches/1017-support-overriding-the-runtime-cpu-detection-with-PO.patch [new file with mode: 0644]
patches/1018-drop-unused-POCL_ATOMIC_CAS.patch [new file with mode: 0644]
patches/1019-switch-from-__sync_add_and_fetch-to-__atomic_add_fet.patch [new file with mode: 0644]
patches/1020-check-whether-64bit-atomics-require-latomic.patch [new file with mode: 0644]
patches/2002-link-against-single-shared-libclang-cpp-when-buildin.patch [new file with mode: 0644]
patches/blhc.patch [new file with mode: 0644]
patches/distro.patch [new file with mode: 0644]
patches/fix-opencl.hpp-detection.patch [new file with mode: 0644]
patches/generic-cpu.patch [new file with mode: 0644]
patches/no-rc.patch [new file with mode: 0644]
patches/series [new file with mode: 0644]
patches/test_structs_as_args.patch [new file with mode: 0644]
patches/timeout.patch [new file with mode: 0644]
pocl-doc.doc-base [new file with mode: 0644]
pocl-doc.docs [new file with mode: 0644]
pocl-opencl-icd.docs [new file with mode: 0644]
pocl-opencl-icd.install [new file with mode: 0644]
pocl-opencl-icd.lintian-overrides [new file with mode: 0644]
pocl-source.install [new file with mode: 0644]
pocl-tests.install [new file with mode: 0644]
pocl-tests.lintian-overrides [new file with mode: 0644]
rules [new file with mode: 0755]
salsa-ci.yml [new file with mode: 0644]
source/format [new file with mode: 0644]
source/lintian-overrides [new file with mode: 0644]
tests/control [new file with mode: 0644]
upstream/metadata [new file with mode: 0644]
watch [new file with mode: 0644]

diff --git a/changelog b/changelog
new file mode 100644 (file)
index 0000000..eb9105c
--- /dev/null
+++ b/changelog
@@ -0,0 +1,931 @@
+pocl (3.0-6) unstable; urgency=medium
+
+  * Update symbols file.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 04 Aug 2022 01:54:01 +0200
+
+pocl (3.0-5) unstable; urgency=medium
+
+  * Rebuild with GCC 12.  (Closes: #1016294)
+  * Add some patches to use -latomic if needed.
+  * Drop redundant pie flags to make blhc happy.
+  * Update symbols file for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 03 Aug 2022 07:26:39 +0200
+
+pocl (3.0-4) unstable; urgency=medium
+
+  * Switch to llvm 13.  (Closes: #1001317)
+  * Update Lintian overrides.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 21 Jun 2022 20:47:34 +0200
+
+pocl (3.0-3) unstable; urgency=medium
+
+  * Switch to llvm 12.
+  * Improve nodoc build.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 19 Jun 2022 23:32:05 +0200
+
+pocl (3.0-2) unstable; urgency=medium
+
+  * Update symbols file.
+  * Add some patches to allow overriding CPU detection.
+  * Test all kernellib variants (that are supported by the host cpu) on distro
+    builds.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 14 Jun 2022 14:14:47 +0200
+
+pocl (3.0-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Refresh patches.
+  * Use the embedded copy of the OpenCL headers for building the library.
+  * Update symbols file for amd64 and i386.
+  * Build with a reproducible UTC timestamp.
+  * Add salsa-ci.yml.
+  * Bump Standards-Version to 4.6.1, no changes needed.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 13 Jun 2022 08:57:49 +0200
+
+pocl (1.8-4) experimental; urgency=medium
+
+  * Add pocl-source package, to allow building e.g. the cuda device.
+  * Add pocl-tests package, to allow testing pocl on the local CPU.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 11 Mar 2022 16:48:13 +0100
+
+pocl (1.8-3) unstable; urgency=medium
+
+  * Cherry-pick several upstream(ed) patches:
+    - Check return code of all pthread_*() function calls for errors.
+    - Return error (don't assert) if any worker thread is out-of-memory.
+    - Show more information on OpenCL compile errors or test failures.
+    - Export more symbols needed by other devices.
+    - Fix underlinked device libraries.
+    - Skip tests that require unavailable devices.
+    - Unify test success/failure reporting.
+    - Miscellaneous bugfixes.
+  * armel/armhf: Reduce printf buffer size to 4 MB per core.
+    (Closes: #997908)
+  * Add superficial autopkgtest running clinfo.
+  * Update symbols file.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 08 Jan 2022 00:55:22 +0100
+
+pocl (1.8-2) experimental; urgency=medium
+
+  * Add printf() tests for more vector types.
+  * Ignore llvm-10/llvm-11/llvm-12 segmentation fault (#975931) on
+    armel/armhf, seems fixed in llvm-13.
+  * Switch to llvm 11.  (Closes: #974797)
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 22 Nov 2021 18:00:18 +0100
+
+pocl (1.8-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Refresh patches.
+  * Update symbols file for amd64 and i386.
+  * Revert to llvm 9.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 15 Oct 2021 18:22:36 +0200
+
+pocl (1.7-3) experimental; urgency=medium
+
+  * Switch to llvm 11.  (Closes: #974797)
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 04 Oct 2021 19:10:55 +0200
+
+pocl (1.7-2) unstable; urgency=medium
+
+  * Work around getconf on qemu/riscv64 returning 'undefined', thanks to
+    Alexandre Ghiti.  (Closes: #994797) (LP: #1942895)
+  * Bump Standards-Version to 4.6.0, no changes needed.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 30 Sep 2021 18:07:33 +0200
+
+pocl (1.7-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 03 Jun 2021 01:58:27 +0200
+
+pocl (1.6-5) unstable; urgency=medium
+
+  * Stop building libllvmopencl.so which is no longer used since 0.14.
+  * Build with -fvisibility=hidden.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 16 Feb 2021 11:00:57 +0100
+
+pocl (1.6-4) unstable; urgency=medium
+
+  * Restore setting unroll-threshold on LLVM 9 to avoid kernel/test_rotate
+    hanging on avx512 capable cpus.  (Closes: #980626)
+  * Kill hanging tests after 30 minutes.
+  * Let dh_shlibdeps find libpocl-devices-basic.so.
+  * Do not use the embedded copy of the OpenCL headers.
+  * Build with -fvisibility-inlines-hidden.
+  * Drop hidden symbols.
+  * Bump Standards-Version to 4.5.1, no changes needed.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 03 Feb 2021 21:21:03 +0100
+
+pocl (1.6-3) unstable; urgency=medium
+
+  * Update symbols file.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 05 Jan 2021 02:08:00 +0100
+
+pocl (1.6-2) experimental; urgency=medium
+
+  * Build with -DHARDENING_ENABLE=ON.
+  * Update symbols file for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 28 Dec 2020 23:50:16 +0100
+
+pocl (1.6-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh/remove patches.
+  * Add testcase for bug #975931.
+  * Revert to llvm 9.  (Reopens: #974797)
+  * Reintroduce "visibility hidden" to expose less internal symbols.
+  * Update symbols file for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 24 Dec 2020 04:19:57 +0100
+
+pocl (1.5-8) experimental; urgency=medium
+
+  * Cherry-pick upstream commits for llvm 11 support and some bugfixes.
+  * Switch to llvm 11.  (Closes: #974797)
+  * Update symbols file for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 17 Nov 2020 17:08:26 +0100
+
+pocl (1.5-7) unstable; urgency=medium
+
+  * Switch to llvm 10.
+  * Update symbols file.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 16 Nov 2020 14:45:48 +0100
+
+pocl (1.5-6) unstable; urgency=medium
+
+  * Fix separate arch:all build in debhelper-compat 13 with
+    -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 29 Jul 2020 12:52:56 +0200
+
+pocl (1.5-5) unstable; urgency=medium
+
+  * Update symbols file.
+  * Switch to debhelper-compat (= 13).
+  * Fix typos found by Lintian.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 29 Jul 2020 02:18:39 +0200
+
+pocl (1.5-4) unstable; urgency=medium
+
+  * Rebuild with GCC 10.  (Closes: #957694)
+  * Update symbols file.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 23 Jul 2020 14:20:52 +0200
+
+pocl (1.5-3) unstable; urgency=medium
+
+  * Update symbols file.
+  * Cherry-pick upstream commit 90fdec99 to avoid unwanted dependency on
+    symbols from libOpenCL.so.1.  (Closes: #958700)
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 27 Apr 2020 00:46:54 +0200
+
+pocl (1.5-2) unstable; urgency=medium
+
+  * The bullseye toolchain defaults to linking with --as-needed.
+  * Link against shared libclang-cpp when building with llvm >= 9.
+  * Update symbols file for amd64 and i386.
+  * Reduce local memory safety margin to prevent the pthread device from
+    running out of memory during initialization. This affects 32-bit builds
+    on platforms with large caches and large corecount.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 17 Apr 2020 16:40:56 +0200
+
+pocl (1.5-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh/remove patches.
+  * Update symbols file for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 04 Apr 2020 18:43:38 +0200
+
+pocl (1.4-6) unstable; urgency=medium
+
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 05 Feb 2020 20:55:06 +0100
+
+pocl (1.4-5) experimental; urgency=medium
+
+  * Update symbols files.
+  * Switch to llvm 9.
+  * Bump Standards-Version to 4.5.0, no changes needed.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 31 Jan 2020 17:11:45 +0100
+
+pocl (1.4-4) unstable; urgency=medium
+
+  * Postpone clinfo failures after dh_makeshlibs, too.
+  * Work around add_test_pocl() ignoring SKIP_RETURN_CODE.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 28 Jan 2020 12:02:47 +0100
+
+pocl (1.4-3) unstable; urgency=medium
+
+  * Update symbols files.
+  * Fix clash with altivec macros on ppc64el.
+  * Skip subdevice tests on (virtual) single core CPUs.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 19 Jan 2020 15:58:32 +0100
+
+pocl (1.4-2) experimental; urgency=medium
+
+  * Update symbols files.
+  * Switch to llvm 8.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 16 Jan 2020 03:03:18 +0100
+
+pocl (1.4-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh/remove patches.
+  * Link kernels with libm to avoid missing fma/fmaf/... symbols.
+  * Ignore regression/struct_kernel_arguments failure on i686.
+  * Switch back to llvm 7 for now.
+  * Update symbols files for amd64 and i386.
+  * Fix build on GNU/hurd, thanks to Samuel Thibault.  (Closes: #947881)
+  * Update copyright holders and years.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 04 Jan 2020 11:08:11 +0100
+
+pocl (1.3-10) unstable; urgency=medium
+
+  * Use upstream version of upstreamed patches.
+  * Backport "Use libdl directly" and related fixes from 1.4.
+    (Closes: #946582, #946422)
+  * Drop B-D on libltdl-dev.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 26 Dec 2019 23:19:15 +0100
+
+pocl (1.3-9) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.4.1, no changes needed.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 09 Oct 2019 23:15:27 +0200
+
+pocl (1.3-8) experimental; urgency=medium
+
+  * Switch to llvm 8.
+  * Update symbols files for amd64 and i386.
+  * Backport "Fixes to global memory size detection" from 1.4.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 25 Sep 2019 00:48:51 +0200
+
+pocl (1.3-7) unstable; urgency=medium
+
+  * Try a fix for allocation limit computation on kfreebsd-i386.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 24 Sep 2019 00:55:41 +0200
+
+pocl (1.3-6) experimental; urgency=medium
+
+  * Update symbols files.
+  * Ignore workgroup/loop_with_two_paths_to_the_latch_LOOPS failures.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 14 Sep 2019 19:49:14 +0200
+
+pocl (1.3-5) experimental; urgency=medium
+
+  * Switch to llvm 7, again.  (Closes: #912793, #932707)
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Aug 2019 18:35:12 +0200
+
+pocl (1.3-4) unstable; urgency=medium
+
+  * Enable --exclude-libs on kFreeBSD.
+  * Tune symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 06 Sep 2019 23:13:34 +0200
+
+pocl (1.3-3) unstable; urgency=medium
+
+  * Rebuild with GCC 9.
+  * Update symbols files for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 24 Aug 2019 07:37:21 +0200
+
+pocl (1.3-2) unstable; urgency=medium
+
+  * Update symbols files.
+  * Bump Standards-Version to 4.4.0, no changes needed.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 14 Jul 2019 15:35:36 +0200
+
+pocl (1.3-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh/remove patches.
+  * Switch back to llvm 6.0 for now.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 13 Jul 2019 13:33:22 +0200
+
+pocl (1.2-10) experimental; urgency=medium
+
+  * Switch to llvm 7.  (Closes: #912793)
+  * Update symbols files.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 11 Feb 2019 16:56:57 +0100
+
+pocl (1.2-5) unstable; urgency=medium
+
+  * Disable dh_dwz which fails on 32-bit platforms, see #918903.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 05 Feb 2019 00:39:59 +0100
+
+pocl (1.2-4) unstable; urgency=medium
+
+  * Cherry-pick upstream "Fix kernel debug data emission".  (Closes: #919824)
+  * Switch to debhelper-compat (= 12).
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 04 Feb 2019 16:08:38 +0100
+
+pocl (1.2-3) experimental; urgency=medium
+
+  * kernel/test_printf: Add more tests.
+  * Perform compile test to select -march or -mcpu for clang.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 21 Jan 2019 01:34:24 +0100
+
+pocl (1.2-2) unstable; urgency=medium
+
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 15 Jan 2019 16:55:49 +0100
+
+pocl (1.2-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Remove patches that were applied upstream.
+  * Cherry-pick upstream commit fixing LINK_WITH_CLANG.
+  * Do not link with --rtlib=compiler-rt at all.
+  * Ignore kernel/test_printf failure on i686.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 11 Jan 2019 19:49:24 +0100
+
+pocl (1.2~rc2-1) experimental; urgency=medium
+
+  * New upstream release candidate.
+  * Refresh/remove patches.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 07 Sep 2018 19:14:21 +0200
+
+pocl (1.1-9) unstable; urgency=medium
+
+  * Drop unused deprecated module 'sphinx.ext.pngmath'.  (Closes: #918828)
+  * Update symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 10 Jan 2019 00:56:33 +0100
+
+pocl (1.1-8) unstable; urgency=medium
+
+  * Update symbols files.  (Closes: #916024)
+  * Fix building in armel chroot on arm64 host.  (Closes: #917244)
+  * Switch to debhelper-compat (= 11).
+  * Bump Standards-Version to 4.3.0, no changes needed.
+  * Update Lintian overrides.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 08 Jan 2019 13:04:26 +0100
+
+pocl (1.1-7) unstable; urgency=medium
+
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 07 Sep 2018 16:04:52 +0200
+
+pocl (1.1-6) experimental; urgency=medium
+
+  * pocl-opencl-icd: Mark as Multi-Arch: same.
+  * Fix building in armhf chroot on arm64 host.
+  * Bump Standards-Version to 4.2.1, no changes needed.
+  * Update symbols files.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 06 Sep 2018 14:11:03 +0200
+
+pocl (1.1-5) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 09 Apr 2018 14:42:39 +0200
+
+pocl (1.1-4) experimental; urgency=medium
+
+  * Run clinfo during testing.
+  * Do not link with --rtlib=compiler-rt on non-x86.  (Closes: #892426)
+  * Prevent PIC/no-PIC option clash on mips64el.
+  * Set target cpu for armel to arm946e-s (arch=armv5te).
+  * Set target cpu for armhf to arm1156t2f-s (arch=armv6t2) with
+    -mfpu=vfp3-d16. Probably suboptimal (should rather be arch=armv7-a without
+    neon,vfp4), but passes all tests.  (Closes: #888063)
+  * Bump Standards-Version to 4.1.4, no changes needed.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 06 Apr 2018 19:39:01 +0200
+
+pocl (1.1-3) experimental; urgency=medium
+
+  * Add support for building for the GENERIC cpu, i.e. llvm defaults.
+  * Build with -DLLC_HOST_CPU=GENERIC on most architectures.
+  * Build with -DKERNELLIB_HOST_CPU_VARIANTS=distro on amd64.
+  * Switch to llvm 6.0.  (Closes: #892428)
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Mar 2018 13:12:40 +0200
+
+pocl (1.1-2) experimental; urgency=medium
+
+  * Switch to llvm 5.0.
+  * Update symbols files for amd64 and i386.
+  * Cherry-pick upstream commits for libhwloc 2.0 support.
+  * Cherry-pick upstream commit fixing test_clCreateSubDevices with 3 CUs.
+  * Cherry-pick upstream commit fixing reported values of native/preferred
+    vector width for unsupported types.
+  * pocl-doc: Mark as Multi-Arch: foreign.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 25 Mar 2018 17:35:44 +0200
+
+pocl (1.1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Remove patches, applied or fixed upstream.
+  * Remove -DFORCE_OCL_KERNEL_TARGET_CPU=ON, fixed upstream.
+  * Report the error code on test failure.
+  * Point watch file to git tags on github.
+  * Add debian/upstream/metadata.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 10 Mar 2018 00:37:43 +0100
+
+pocl (1.1~rc2-1) experimental; urgency=medium
+
+  * New upstream release candidate.  (Closes: #888062)
+  * Remove patches that were applied upstream.
+  * Update symbols files.
+  * Do not attempt to run the testsuite during an arch-indep build.
+  * Set LLVM_ARCH for arm64, armel, armhf to generic.
+  * Set LLVM_ARCH for s390x to z10.  (Closes: #888064)
+  * Drop internal helper library packages libpoclu-dev and libpoclu2.
+  * Add altivec.patch to get rid of the conflicting bool and vector macros
+    from altivec.h.  (Closes: #764561)
+  * Update Lintian overrides.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 27 Feb 2018 17:31:09 +0100
+
+pocl (1.0-2) unstable; urgency=medium
+
+  * Merge changes from 0.14-7.
+  * Build with SLEEF instead of VECMATHLIB.
+  * HACK: Ignore test failure for kernel/test_fabs on i386.
+  * Add and use new CMake option -DFORCE_OCL_KERNEL_TARGET_CPU=ON.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 19 Jan 2018 01:11:11 +0100
+
+pocl (1.0-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh/remove patches.
+  * Build with -DPOCL_ICD_ABSOLUTE_PATH=OFF.
+  * Rename library packages for SOVERSION bump: 1 => 2.
+  * Update symbols files for amd64 and i386.
+  * Build with -DENABLE_VECMATHLIB=ON.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 14:13:19 +0100
+
+pocl (0.14-7) unstable; urgency=medium
+
+  * Switch to llvm 4.0.  (Closes: #873417)
+  * Update symbols files for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 18:36:08 +0100
+
+pocl (0.14-6) unstable; urgency=medium
+
+  * Switch to debhelper compat level 11.
+  * Bump Standards-Version to 4.1.3, no changes needed.
+  * Switch Vcs-* to salsa.debian.org.
+  * Remove superfluous patches.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 17 Jan 2018 06:13:22 +0100
+
+pocl (0.14-5) unstable; urgency=medium
+
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 18 Dec 2017 01:44:17 +0100
+
+pocl (0.14-4) experimental; urgency=medium
+
+  * Switch to llvm 3.9.
+  * Update symbols files for amd64 and i386.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 16 Dec 2017 05:24:25 +0100
+
+pocl (0.14-3) experimental; urgency=medium
+
+  * Cherry-pick upstream [c9d2cd15] "llvm/Flatten: switch back to
+    force-inlining only some funcs", fixing kernel/test_convert_type_* failing
+    on i386 with LLC_HOST_CPU=i686.
+  * Switch LLC_HOST_CPU from "pentium3" to the correct baseline "i686" on
+    i386.
+  * kernel/test_printf actually passes on i386 with LLC_HOST_CPU=i686.
+  * Only override POCL_CACHE_DIR for the testsuite, not HOME.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 15 Dec 2017 07:08:32 +0100
+
+pocl (0.14-2) experimental; urgency=medium
+
+  * Cherry-pick upstream [62b74d6f] "Fix malloc size in tests/runtime/
+    test_clBuildProgram.c", fixing runtime/clBuildProgram failing frequently
+    on i386.
+  * Try to guess the minimal cpu for more architectures.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 14 Dec 2017 01:37:41 +0100
+
+pocl (0.14-1) experimental; urgency=medium
+
+  * New upstream release.
+  * The autotools based build system is gone.
+  * Refresh/remove patches.
+  * Use the CMAKE_INSTALL_SYSCONFDIR setting for /etc.
+  * Update symbols files.
+  * Update copyright holders and years.
+  * Remove pocl-standalone(1) manpage. The binary is no longer shipped.
+  * Ship the new poclcc binary in libpocl-dev.
+  * Do not downgrade to -std=c++11, fixing test_fabs failing on i386.
+    (Closes: #883613)
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 12 Dec 2017 03:48:35 +0100
+
+pocl (0.13-14) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.1.2, no changes needed.
+  * cmake-no-get_cpu_name.patch: Rename/redo as
+    cmake-no-llvm-sys-getHostCPUName.patch to not use
+    llvm::sys::getHostCPUName().
+  * Clean up generated include/CL/cl.hpp* to fix building twice in a row.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 08 Dec 2017 18:55:52 +0100
+
+pocl (0.13-13) experimental; urgency=medium
+
+  * Fix cmake i386 detection, thanks to James Price.  (Closes: #882875)
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 28 Nov 2017 03:04:06 +0100
+
+pocl (0.13-12) experimental; urgency=medium
+
+  * Switch to cmake build system.
+  * llvmopencl.so.7 is now a private library.  (Closes: #823528)
+  * cmake-no-fno-rtti.patch: Build without -fno-rtti (a workaround for
+    clang-3.7), like autotools, to avoid symbol changes.
+  * cmake-no-get_cpu_name.patch: Do not use get_cpu_name(), makes some tests
+    fail.
+  * cmake-forcibly-link-regtests-with-pthread.patch: Link regression tests
+    with -lpthread unconditionally, otherwise test_issue_231 fails.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 27 Nov 2017 16:01:58 +0100
+
+pocl (0.13-11) unstable; urgency=medium
+
+  * Add Built-Using control field for linking against static clang libraries.
+  * do-not-export-clang-symbols.patch: Link static clang libraries with
+    --exclude-libs to not export their symbols.
+  * Update symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 26 Nov 2017 19:22:48 +0100
+
+pocl (0.13-10) unstable; urgency=medium
+
+  * Update symbols files.
+  * Bump Standards-Version to 4.1.1, no changes needed.
+  * Use dpkg makefile snippets instead of parsing the changelog manually.
+  * Switch B-D-I: python-sphinx to python3-sphinx.
+  * Set Rules-Requires-Root: no.
+  * set-POCL_DEVICE_ADDRESS_BITS-before-use.patch: Fix use-before-init in
+    CMakeLists.txt causing i386 to be misdetected as x86_64.
+  * Do not export libOpenCL.so.1 symbols.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 25 Nov 2017 21:03:13 +0100
+
+pocl (0.13-9) unstable; urgency=medium
+
+  * Work around using clang-3.8 with libstdc++-7-dev.  (Closes: #853620)
+  * Update symbols files.
+  * Switch to debhelper compat level 10.
+  * Bump Standards-Version to 4.0.1.
+  * Raise Priority to optional.
+  * Support nodoc build.
+  * Do not mark the -dev packages as Multi-Arch: foreign.
+  * Move kernel-<triplet>.bc from libpocl1-common into libpocl1.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 07 Aug 2017 04:57:35 +0200
+
+pocl (0.13-8) unstable; urgency=medium
+
+  * Enable more hardening.
+  * Reduce superfluous dependencies by linking with --as-needed.
+  * Update symbols files.
+  * Update lintian overrides.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 10 Oct 2016 13:38:39 +0200
+
+pocl (0.13-7) unstable; urgency=medium
+
+  * Update symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 09 Sep 2016 19:51:19 +0200
+
+pocl (0.13-6) unstable; urgency=medium
+
+  * Update symbols files.  (Closes: #835690, #836219)
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 06 Sep 2016 14:55:01 +0200
+
+pocl (0.13-5) unstable; urgency=medium
+
+  * Build-depend on the llvm-3.8 release version.
+  * Update symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 11 Jul 2016 04:24:40 +0200
+
+pocl (0.13-4) unstable; urgency=medium
+
+  * Use CLOCK_UPTIME_FAST on kFreeBSD.
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 03 Jul 2016 16:17:52 +0200
+
+pocl (0.13-3) experimental; urgency=medium
+
+  * Switch to llvm 3.8.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 22 Jun 2016 14:37:21 +0200
+
+pocl (0.13-2) unstable; urgency=medium
+
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 22 Jun 2016 11:40:19 +0200
+
+pocl (0.13-1) experimental; urgency=medium
+
+  * New upstream release.  (Closes: #820480)
+  * Refresh llvm-system-libs.patch, new upstream only supports llvm 3.7/3.8.
+  * Remove fix-image-args.patch, fixed upstream.
+  * glibc-2.23.patch: New, add support for glibc 2.23.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 15 Jun 2016 18:55:21 +0200
+
+pocl (0.12-6) unstable; urgency=medium
+
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 14 Jun 2016 20:11:10 +0200
+
+pocl (0.12-5) experimental; urgency=medium
+
+  * Switch to llvm 3.7.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Thu, 09 Jun 2016 10:26:04 +0200
+
+pocl (0.12-4) unstable; urgency=medium
+
+  * Update symbols files.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 08 Jun 2016 02:36:14 +0200
+
+pocl (0.12-3) unstable; urgency=medium
+
+  * Fix OpenCL headers for GNU/Hurd.
+  * Update symbols files.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sat, 28 May 2016 17:17:37 +0200
+
+pocl (0.12-2) experimental; urgency=medium
+
+  * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 10 May 2016 20:32:16 +0200
+
+pocl (0.12-1) experimental; urgency=medium
+
+  * New upstream release.
+  * Refresh patches.
+  * Update symbols files for amd64 and i386.
+  * Upload to experimental.
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 09 May 2016 14:44:03 +0200
+
+pocl (0.11-5) unstable; urgency=medium
+
+  * Work around clang failing to find sys/cdefs.h on !linux.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 27 May 2016 12:29:56 +0200
+
+pocl (0.11-4) unstable; urgency=medium
+
+  * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 17 May 2016 12:45:38 +0200
+
+pocl (0.11-3) unstable; urgency=medium
+
+  * Update symbols files.
+  * Provide documentation package (pocl-doc), thanks to Ghislain Vaillant.
+
+ -- Andreas Beckmann <anbe@debian.org>  Sun, 08 May 2016 02:57:38 +0200
+
+pocl (0.11-2) unstable; urgency=medium
+
+  * Make the B-D on clang versioned to match llvm.
+  * Drop superfluous B-D.
+  * Fix testsuite failure on i386.  (Closes: #822563)
+  * Switch back target cpu to pentium3 on any-i386.
+  * Fix arm64 detection.  (Closes: #787686)
+  * Move libpocl1-common to section utils.
+  * Upload to unstable.
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 27 Apr 2016 10:17:50 +0200
+
+pocl (0.11-1) experimental; urgency=medium
+
+  [ Vincent Danjean ]
+  * New upstream version  (Closes: #795321)
+  * Switch to llvm-3.6  (Closes: #803652)
+  * Fix "FTBFS on arm64" by targeting llvm arch to cortex-a53 on arm64
+    (Closes: #787686)
+  * Fix "vcs-browser field does not work" by fixing URL in debian/control
+    (Closes: #775844)
+
+  [ Andreas Beckmann ]
+  * Use a temporary, writable $HOME while running the testsuite.
+  * Show the full tests/testsuite.log on testsuite failures.
+  * Drop the -dbg package in favor of autogenerated -dbgsym packages.
+  * Update symbols files for amd64 and i386.
+  * llvm-config --system-libs is only needed with static llvm.
+  * Fix detection of image and sampler arguments, thanks to James Price.
+    (Closes: #799322)
+  * Put package under "Debian OpenCL Maintainers" team maintenance.
+  * Add Vincent Danjean and myself to Uploaders.
+  * Bump Standards-Version to 3.9.8 (no changes needed).
+
+ -- Andreas Beckmann <anbe@debian.org>  Mon, 25 Apr 2016 09:49:29 +0200
+
+pocl (0.10-12) experimental; urgency=medium
+
+  * Update again symbol file for armel
+  * apply partial fix for armhf (only one test fail, due to neon instruction)
+
+ -- Vincent Danjean <vdanjean@debian.org>  Sun, 02 Nov 2014 01:36:13 +0100
+
+pocl (0.10-11) experimental; urgency=medium
+
+  * Correctly fix FreeBSD include
+  * Update symbols file
+
+ -- Vincent Danjean <vdanjean@debian.org>  Mon, 27 Oct 2014 12:31:47 +0100
+
+pocl (0.10-10) unstable; urgency=medium
+
+  * fix symbol file (again), perhaps due to previous target adjustment
+  * trying pentium-m (for i386) and nehalem (for freebsd-i386) as
+    processor target
+
+ -- Vincent Danjean <vdanjean@debian.org>  Sat, 25 Oct 2014 22:32:40 +0200
+
+pocl (0.10-9) unstable; urgency=medium
+
+  * fix symbol file (again)
+  * lowering armhf llvm target (cortex-a5 instead of cortex-a7)
+    The good one should be ARMv7-A but it does not exist in LLVM
+    https://wiki.debian.org/ArmHardFloatPort
+  * bumping i386 target (from i686 to pentium4)
+    => some officially Debian supported i386 systems wont work with
+    pocl
+
+ -- Vincent Danjean <vdanjean@debian.org>  Fri, 24 Oct 2014 14:20:00 +0200
+
+pocl (0.10-8) unstable; urgency=medium
+
+  * fix symbol file for other architecture (!amd64)
+
+ -- Vincent Danjean <vdanjean@debian.org>  Fri, 24 Oct 2014 08:09:48 +0200
+
+pocl (0.10-7) unstable; urgency=medium
+
+  * bump minimum arch on i386 (from i586 to i686)
+  * to not ignore failed testsuite anymore at build time
+
+ -- Vincent Danjean <vdanjean@debian.org>  Wed, 22 Oct 2014 21:07:51 +0200
+
+pocl (0.10-6) unstable; urgency=medium
+
+  * Fix OpenCL headers for i386 FreeBSD
+  * use pkg-kde-tools to handle C++ symbols
+  * Try to support more Debian architectures.
+
+ -- Vincent Danjean <vdanjean@debian.org>  Wed, 22 Oct 2014 12:31:11 +0200
+
+pocl (0.10-5) unstable; urgency=medium
+
+  * Fix arm configure.ac detection
+  * try to support more Debian architectures
+
+ -- Vincent Danjean <vdanjean@debian.org>  Tue, 21 Oct 2014 14:50:28 +0200
+
+pocl (0.10-4) unstable; urgency=medium
+
+  * No need to provide utlist.h that is already provided in the uthash-dev
+    package (Closes: #764571)
+  * Fix some glitches in descriptions
+  * Remove old unneeded patches
+  * Add clang-3.5 dependency for libpocl1 (required when running a kernel)
+  * Fix default host CPU for the OpenCL compiler
+  * Add info in build logs to help debugging
+
+ -- Vincent Danjean <vdanjean@debian.org>  Fri, 10 Oct 2014 22:23:38 +0200
+
+pocl (0.10-3) unstable; urgency=medium
+
+  * Move the manpage in the correct package
+
+ -- Vincent Danjean <vdanjean@debian.org>  Wed, 08 Oct 2014 00:03:28 +0200
+
+pocl (0.10-2) unstable; urgency=medium
+
+  * Fix URLs, project name and update the copyright list
+    (initially created in 2012 with 0.7 version)
+
+ -- Vincent Danjean <vdanjean@debian.org>  Mon, 06 Oct 2014 23:22:34 +0200
+
+pocl (0.10-1) unstable; urgency=medium
+
+  * Initial release. (Closes: #676504: ITP: pocl -- Portable OpenCL)
+
+ -- Vincent Danjean <vdanjean@debian.org>  Sun, 05 Oct 2014 21:15:18 +0200
diff --git a/clean b/clean
new file mode 100644 (file)
index 0000000..1bfc841
--- /dev/null
+++ b/clean
@@ -0,0 +1,3 @@
+build-doc/
+debian/kcache/
+debian/stamp-failed-testsuite
diff --git a/control b/control
new file mode 100644 (file)
index 0000000..0ed93c3
--- /dev/null
+++ b/control
@@ -0,0 +1,170 @@
+Source: pocl
+Section: libs
+Priority: optional
+Maintainer: Debian OpenCL Maintainers <pkg-opencl-devel@lists.alioth.debian.org>
+Uploaders: Vincent Danjean <vdanjean@debian.org>,
+ Andreas Beckmann <anbe@debian.org>,
+Build-Depends:
+ debhelper-compat (= 13),
+ gcc (>= 4:12),
+ clang-13,
+ libclang-13-dev,
+ libclang-cpp13-dev,
+ llvm-13-dev,
+ cmake,
+ libhwloc-dev,
+ ocl-icd-dev,
+ ocl-icd-opencl-dev,
+ pkg-config,
+ pkg-kde-tools,
+ clinfo <!nocheck>,
+Build-Depends-Indep:
+ dh-sequence-sphinxdoc <!nodoc>,
+ python3-sphinx <!nodoc>,
+Rules-Requires-Root: no
+Standards-Version: 4.6.1
+Homepage: http://portablecl.org
+Vcs-Browser: https://salsa.debian.org/opencl-team/pocl
+Vcs-Git: https://salsa.debian.org/opencl-team/pocl.git
+
+Package: pocl-opencl-icd
+Architecture: any
+Multi-Arch: same
+Depends:
+ libpocl2 (= ${binary:Version}),
+ ${misc:Depends}
+Provides:
+ opencl-icd,
+ opencl-icd-1.1-1,
+ opencl-icd-1.2-1,
+Description: pocl ICD
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package allows one to use pocl as an installable client driver (ICD) for
+ OpenCL.
+
+Package: libpocl2-common
+Architecture: all
+Multi-Arch: foreign
+Section: utils
+Depends:
+ ${misc:Depends}
+Breaks:
+ libpocl1-common,
+Replaces:
+ libpocl1-common,
+Description: common files for the pocl library
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package provides the architecture independent files of the pocl library.
+
+Package: libpocl2
+Architecture: any
+Multi-Arch: same
+Pre-Depends:
+ ${misc:Pre-Depends}
+Depends:
+ libpocl2-common (= ${source:Version}),
+ clang-${LLVM:Version},
+ ${shlibs:Depends},
+ ${misc:Depends}
+Recommends:
+ pocl-opencl-icd,
+Breaks:
+ libpocl1-common (<< 0.13-9),
+Replaces:
+ libpocl1-common (<< 0.13-9),
+Provides:
+ libpocl2+llvm${LLVM:Version},
+Description: Portable Computing Language library
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package provides the core of pocl.
+
+Package: libpocl-dev
+Architecture: any
+Section: libdevel
+Depends:
+ libpocl2 (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: development files for the pocl library
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package provides the development files for the pocl library. Unless very
+ specific needs, this package is useless. This package is only required to link
+ directly and explicitly with pocl.
+ .
+ To develop OpenCL programs (that can be run with pocl), the opencl-dev virtual
+ package (provided by ocl-icd-opencl-dev for example) is required, not this one.
+
+Package: pocl-tests
+Architecture: all
+Multi-Arch: foreign
+Section: devel
+Depends:
+ ${misc:Depends}
+Description: pocl testsuite
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package contains the source code of the pocl test suite.
+
+Package: pocl-doc
+Architecture: all
+Multi-Arch: foreign
+Section: doc
+Build-Profiles: <!nodoc>
+Depends:
+ ${sphinxdoc:Depends},
+ ${misc:Depends}
+Built-Using: ${sphinxdoc:Built-Using}
+Description: documentation for the pocl library
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations. A "native" target is included,
+ which allows running OpenCL kernels on the host (CPU).
+ .
+ This package provides the development files for the pocl library.  Unless very
+ specific needs, this package is useless.  This package is only required to link
+ directly and explicitly with pocl.
+ .
+ This package provides the documentation for the pocl library.
+
+Package: pocl-source
+Architecture: all
+Multi-Arch: foreign
+Section: devel
+Depends:
+ ${misc:Depends}
+Provides:
+ pocl-source-${source:Upstream-Version},
+Description: pocl source code
+ Portable Computing Language is an open source implementation of the OpenCL
+ standard which can be easily adapted for new targets. One of the goals of the
+ project is improving performance portability of OpenCL programs, avoiding the
+ need for target-dependent manual optimizations.
+ .
+ This package provides original Debian (with Debian patches already applied)
+ sources of pocl shipped in a tarball. This can be used for building the
+ device libraries for additional targets.
diff --git a/copyright b/copyright
new file mode 100644 (file)
index 0000000..0e05c9e
--- /dev/null
+++ b/copyright
@@ -0,0 +1,133 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Portable Computing Language
+Source: http://portablecl.org/download.html
+
+Files: *
+Copyright: 2012-2021 pocl developers
+           2002-2019 Tampere University
+           2011-2012 Carlos Sánchez de La Lama
+           2011-2020 Pekka Jääskeläinen / Tampere University of Technology
+           2011-2014 Kalle Raiskila
+           2011-2014 Erik Schnetter
+           2011-2015 Ville Korhonen / Tampere University of Technology
+           2011-2015 Universidad Rey Juan Carlos
+           2012-2017 Christian Rau
+           2012      Cyril Roelandt
+           2012      Timo Viitanen
+           2013      Jesse Towner
+           2013      Kalray
+           2013      Victor Oliveira
+           2014-2016 Advanced Micro Devices, Inc.
+           2014      Felix Bytow
+           2014      Lassi Koskinen
+           2014-2015 Matias Koskela
+           2014-2018 Michal Babej
+           2015-2020 Giuseppe Bilotta
+           2016      Tom Gall
+           2016      Marc Andrysco
+           2016-2017 James Price
+           2017      Stephan Nolting
+           2018      Julius Ikkala
+           2020      Isuru Fernando
+License: Expat
+
+Files: include/utlist.h
+Copyright: 2007-2011, Troy D. Hanson   http://uthash.sourceforge.net
+License: Free-Software-2
+
+Files: include/CL/*.h*
+Copyright: 2008-2019 The Khronos Group Inc.
+License: Free-Software-3
+
+Files: lib/kernel/sleef/*
+Copyright: 2010-2017 Naoki Shibata
+           2010-2017 ARM Ltd.
+License: Boost-1.0
+
+Files: debian/*
+Copyright: 2012 Vincent Danjean <vdanjean@debian.org>
+           Â© 2016-2022 Andreas Beckmann <anbe@debian.org>
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+License: Free-Software-2
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: Free-Software-3
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and/or associated documentation files (the
+ "Materials"), to deal in the Materials without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Materials, and to
+ permit persons to whom the Materials are furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Materials.
+ .
+ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+License: Boost-1.0
+ Boost Software License - Version 1.0 - August 17th, 2003
+ .
+ Permission is hereby granted, free of charge, to any person or organization
+ obtaining a copy of the software and accompanying documentation covered by
+ this license (the "Software") to use, reproduce, display, distribute,
+ execute, and transmit the Software, and to prepare derivative works of the
+ Software, and to permit third-parties to whom the Software is furnished to
+ do so, all subject to the following:
+ .
+ The copyright notices in the Software and this entire statement, including
+ the above license grant, this restriction and the following disclaimer,
+ must be included in all copies of the Software, in whole or in part, and
+ all derivative works of the Software, unless such copies or derivative
+ works are solely in the form of machine-executable object code generated by
+ a source language processor.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
diff --git a/libpocl-dev.install b/libpocl-dev.install
new file mode 100644 (file)
index 0000000..1b06fa2
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin
+usr/lib/${DEB_HOST_MULTIARCH}/libpocl.so
+usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/pocl.pc
diff --git a/libpocl2-common.install b/libpocl2-common.install
new file mode 100644 (file)
index 0000000..a8e36ee
--- /dev/null
@@ -0,0 +1 @@
+usr/share/pocl/include
diff --git a/libpocl2.install b/libpocl2.install
new file mode 100644 (file)
index 0000000..65801a2
--- /dev/null
@@ -0,0 +1,4 @@
+usr/lib/${DEB_HOST_MULTIARCH}/libpocl.so.2*
+usr/lib/${DEB_HOST_MULTIARCH}/pocl/libpocl-devices-basic.so
+usr/lib/${DEB_HOST_MULTIARCH}/pocl/libpocl-devices-pthread.so
+usr/share/pocl/kernel-*-*-*-*-*.bc
diff --git a/libpocl2.lintian-overrides b/libpocl2.lintian-overrides
new file mode 100644 (file)
index 0000000..6d898ad
--- /dev/null
@@ -0,0 +1,2 @@
+# we use fake Debian revisions to mark symbol (dis)appearance on compiler version changes
+symbols-file-contains-debian-revision
diff --git a/libpocl2.symbols b/libpocl2.symbols
new file mode 100644 (file)
index 0000000..c55cb23
--- /dev/null
@@ -0,0 +1,275 @@
+# SymbolsHelper-Confirmed: 3.0-5~gcc12 amd64 arm64 armel armhf hurd-i386 i386 mips64el mipsel ppc64 ppc64el s390x
+libpocl-devices-basic.so #PACKAGE# #MINVER#
+* Build-Depends-Package: libpocl-dev
+ pocl_basic_init_device_ops@Base 1.6
+libpocl-devices-pthread.so #PACKAGE# #MINVER#
+* Build-Depends-Package: libpocl-dev
+ pocl_pthread_init_device_ops@Base 1.6
+libpocl.so.2 #PACKAGE# #MINVER#
+* Build-Depends-Package: libpocl-dev
+#MISSING: 0.11# Header@Base 0.10
+#MISSING: 0.11# KernelName@Base 0.10
+ POclGetExtensionFunctionAddress@Base 3.0
+ POclIcdGetPlatformIDsKHR@Base 3.0
+ POclReleaseDevice@Base 1.8-3~visibility
+ POclReleaseEvent@Base 1.6-5~visibility
+ POclRetainEvent@Base 1.6-5~visibility
+#MISSING: 1.6-5~visibility# X@Base 0.13
+#MISSING: 1.6-5~visibility# Y@Base 0.10
+ _Z20getModuleIntMetadataRKN4llvm6ModuleEPKcRm@Base 1.8
+ _Z21getModuleBoolMetadataRKN4llvm6ModuleEPKcRb@Base 1.8
+ _Z23getModuleStringMetadataRKN4llvm6ModuleEPKcRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@Base 1.8
+ _ZGVZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb0EEclEcE5__nul@Base 3.0
+ _ZGVZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb1EEclEcE5__nul@Base 3.0
+ _ZGVZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb0EEclEcE5__nul@Base 3.0
+ _ZGVZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb1EEclEcE5__nul@Base 3.0
+ _ZN4pocl23eraseFunctionAndCallersEPN4llvm8FunctionE@Base 1.8-3~visibility
+#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12emplace_backIJS5_EEEvDpOT_@Base 0.11
+#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRKS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
+#MISSING: 1.8# (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
+#MISSING: 1.8# (optional=templinst)_ZNSt6vectorIPKcSaIS1_EE17_M_realloc_insertIJS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 0.13-9~llvm3.8+gcc7
+#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening
+#MISSING: 1.8# (optional=templinst|arch=mipsel)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag@Base 1.1-6~llvm6.0+gcc8
+#MISSING: 1.8# (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4swapERS4_@Base 1.6-2~hardening
+#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKc{size_t}@Base 1.6-2~hardening
+#MISSING: 1.8# (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_@Base 1.6-2~hardening
+#MISSING: 1.8# (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE24_M_get_insert_unique_posERKS5_@Base 1.0
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS5_ERKS5_@Base 1.0
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E@Base 1.0
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 1.1-2~llvm5.0
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIvESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 1.7-3~llvm10
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 0.11
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 0.11
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 1.0
+#MISSING: 1.8# (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 1.0
+ (optional=templinst)_ZNSt8__detail8_ScannerIcE18_M_eat_escape_ecmaEv@Base 3.0
+ (optional=templinst)_ZNSt8__detail8_ScannerIcE19_M_eat_escape_posixEv@Base 3.0
+#MISSING: 1.8# (optional=templinst)_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_@Base 1.6-2~hardening
+ (arch=armel riscv64)_ZTIN9__gnu_cxx7__mutexE@Base 1.4-5~llvm9
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb0EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb1EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb0EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb1EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0ELb0EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0ELb1EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1ELb0EEE@Base 3.0
+ _ZTINSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1ELb1EEE@Base 3.0
+ _ZTINSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0EEE@Base 3.0
+ _ZTINSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1EEE@Base 3.0
+ _ZTINSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0EEE@Base 3.0
+ _ZTINSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1EEE@Base 3.0
+ _ZTINSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0EEE@Base 3.0
+ _ZTINSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1EEE@Base 3.0
+ _ZTINSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0EEE@Base 3.0
+ _ZTINSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1EEE@Base 3.0
+ (arch=armel riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
+ (arch=!armel !riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
+ (arch=armel riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
+ (arch=!armel !riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
+ (arch=armel armhf)_ZTISt19_Sp_make_shared_tag@Base 0.10
+ (arch=armel riscv64)_ZTSN9__gnu_cxx7__mutexE@Base 1.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb0EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb1EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb0EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb1EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0ELb0EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0ELb1EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1ELb0EEE@Base 3.0
+ _ZTSNSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1ELb1EEE@Base 3.0
+ _ZTSNSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0EEE@Base 3.0
+ _ZTSNSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1EEE@Base 3.0
+ _ZTSNSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0EEE@Base 3.0
+ _ZTSNSt8__detail12_CharMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1EEE@Base 3.0
+ _ZTSNSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0EEE@Base 3.0
+ _ZTSNSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1EEE@Base 3.0
+ _ZTSNSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb1ELb0EEE@Base 3.0
+ _ZTSNSt8__detail15_BracketMatcherINSt7__cxx1112regex_traitsIcEELb1ELb1EEE@Base 3.0
+ (arch=armel riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
+ (arch=!armel !riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
+ (arch=armel riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10
+ (arch=!armel !riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10
+ _ZTSSt19_Sp_make_shared_tag@Base 0.10
+#MISSING: 3.0-5~gcc12# (arch=armel riscv64)_ZTSSt23_Sp_counted_ptr_inplaceINSt8__detail4_NFAINSt7__cxx1112regex_traitsIcEEEESaIS5_ELN9__gnu_cxx12_Lock_policyE1EE@Base 3.0
+#MISSING: 3.0-5~gcc12# (arch=!armel !riscv64)_ZTSSt23_Sp_counted_ptr_inplaceINSt8__detail4_NFAINSt7__cxx1112regex_traitsIcEEEESaIS5_ELN9__gnu_cxx12_Lock_policyE2EE@Base 3.0
+ (arch=armel)_ZTSSt23_Sp_counted_ptr_inplaceINSt8__detail4_NFAINSt7__cxx1112regex_traitsIcEEEESaIvELN9__gnu_cxx12_Lock_policyE1EE@Base 3.0-5~gcc12
+ (arch=!armel !riscv64)_ZTSSt23_Sp_counted_ptr_inplaceINSt8__detail4_NFAINSt7__cxx1112regex_traitsIcEEEESaIvELN9__gnu_cxx12_Lock_policyE2EE@Base 3.0-5~gcc12
+ (optional=templinst)_ZZNKSt7__cxx1112regex_traitsIcE16lookup_classnameIPKcEENS1_10_RegexMaskET_S6_bE12__classnames@Base 3.0
+ (optional=templinst)_ZZNKSt7__cxx1112regex_traitsIcE18lookup_collatenameIPKcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_SA_E14__collatenames@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb0EEclEcE5__nul@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb0ELb1EEclEcE5__nul@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb0EEclEcE5__nul@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail11_AnyMatcherINSt7__cxx1112regex_traitsIcEELb0ELb1ELb1EEclEcE5__nul@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail9_ExecutorIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS5_9sub_matchISB_EEENS5_12regex_traitsIcEELb0EE10_M_is_wordEcE3__s@Base 3.0
+ (optional=templinst)_ZZNKSt8__detail9_ExecutorIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS5_9sub_matchISB_EEENS5_12regex_traitsIcEELb1EE10_M_is_wordEcE3__s@Base 3.0
+ _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag@Base 1.1-8~llvm6.0+gcc8.2
+#MISSING: 0.14# check_compiler_cache@Base 0.10
+ clGetExtensionFunctionAddress@Base 0.10
+ clGetExtensionFunctionAddressForPlatform@Base 1.0
+#MISSING: 1.6-5~visibility# cl_context_count@Base 1.1
+#MISSING: 0.14~visibility# context_set_properties@Base 0.10
+#MISSING: 0.14# cpufreq_file@Base 0.10
+#MISSING: 0.14# cpuinfo@Base 0.10
+#MISSING: 1.0# create_workitem_aa_plugin@Base 0.10
+#MISSING: 1.8# currentPoclDevice@Base 0.14
+#MISSING: 1.6-5~# fill_dev_image_t@Base 1.6
+#MISSING: 1.6-5~# fill_dev_sampler_t@Base 1.6
+#MISSING: 0.14# find_env@Base 0.10
+#MISSING: 0.14# get_cpu_name@Base 0.13
+#MISSING: 0.14~visibility# llvm_codegen@Base 0.10
+ opencl_image_type_to_index@Base 3.0
+ pocl_SHA1_Final@Base 1.8-3~visibility
+ pocl_SHA1_Init@Base 1.8-3~visibility
+ pocl_SHA1_Update@Base 1.8-3~visibility
+ pocl_abort_on_pthread_error@Base 1.8-3~visibility
+ pocl_align_value@Base 3.0
+ pocl_aligned_malloc@Base 1.6
+ pocl_aligned_malloc_global_mem@Base 1.6
+ pocl_alloc_buffer_from_region@Base 1.8-3~visibility
+ pocl_alloc_or_retain_mem_host_ptr@Base 1.8
+#MISSING: 0.12# pocl_basic_malloc@Base 0.11
+#MISSING: 0.13# pocl_basic_set_buffer_image_limits@Base 0.12
+ pocl_bitcode_is_spirv_execmodel_kernel@Base 3.0
+ pocl_bitcode_is_spirv_execmodel_shader@Base 3.0
+ pocl_broadcast@Base 1.6
+ pocl_byteswap_uint32_t@Base 1.8-3~visibility
+ pocl_cache_create_program_cachedir@Base 1.8-3~visibility
+ pocl_cache_kernel_cachedir_path@Base 1.8-3~visibility
+ pocl_cache_program_bc_path@Base 1.8-3~visibility
+ pocl_cache_tempname@Base 1.8-3~visibility
+ pocl_cache_work_group_function_path@Base 1.6-5~visibility
+ pocl_cache_write_descriptor@Base 1.8-3~visibility
+ pocl_check_kernel_disk_cache@Base 1.8
+ pocl_check_kernel_dlhandle_cache@Base 1.6
+ pocl_cmd_max_grid_dim_width@Base 1.8-3~visibility
+#MISSING: 0.11~visibility# pocl_command_enqueue@Base 0.10
+ pocl_command_push@Base 1.6
+ pocl_command_to_str@Base 1.6-5~visibility
+#MISSING: 0.14# pocl_compact_queue_list@Base 0.12
+#MISSING: 1.6~visibility# pocl_context_handling_lock@Base 1.1
+#MISSING: 0.14~visibility# pocl_cpufreq_get_max@Base 0.10
+#MISSING: 0.12# pocl_cpuinfo_append_cpu_name@Base 0.10
+#MISSING: 0.14~visibility# pocl_cpuinfo_detect_compute_unit_count@Base 0.10
+ pocl_cpuinfo_detect_device_info@Base 1.6
+#MISSING: 0.14~visibility# pocl_cpuinfo_detect_max_clock_frequency@Base 0.10
+#MISSING: 0.14~visibility# pocl_cpuinfo_get_cpu_name_and_vendor@Base 0.12
+#MISSING: 1.6~visibility# pocl_cq_profiling_enabled@Base 1.5
+#MISSING: 1.6~visibility# pocl_cq_profiling_init@Base 1.5
+#MISSING: 1.6~visibility# pocl_cq_profiling_register_event@Base 1.5
+#MISSING: 0.11~visibility# pocl_create_command@Base 0.10
+#MISSING: 0.11~visibility# pocl_create_event@Base 0.10
+ pocl_debug_measure_finish@Base 1.8-3~visibility
+ pocl_debug_measure_start@Base 1.8-3~visibility
+#MISSING: 0.12# pocl_debug_messages@Base 0.11
+ pocl_debug_messages_filter@Base 1.6
+ pocl_debug_messages_setup@Base 1.8
+ pocl_debug_output_lock@Base 1.6
+ pocl_debug_output_unlock@Base 1.6
+ pocl_debug_print_duration@Base 1.8-3~visibility
+ pocl_debug_print_header@Base 1.6
+#MISSING: 0.12# pocl_debug_timespec@Base 0.11
+ pocl_default_local_size_optimizer@Base 1.6
+ pocl_device_get_env_count@Base 1.6
+#MISSING: 1.6-5~visibility# pocl_device_types@Base 1.6
+ pocl_driver_alloc_mem_obj@Base 1.8-3~visibility
+ pocl_driver_build_binary@Base 1.8
+ pocl_driver_build_poclbinary@Base 1.8
+ pocl_driver_build_source@Base 1.8
+ pocl_driver_copy@Base 1.8
+ pocl_driver_copy_rect@Base 1.8
+ pocl_driver_copy_with_size@Base 1.8
+ pocl_driver_free@Base 1.8-3~visibility
+ pocl_driver_free_mapping_ptr@Base 1.8
+ pocl_driver_free_program@Base 1.8
+ pocl_driver_get_mapping_ptr@Base 1.8
+ pocl_driver_link_program@Base 1.8
+ pocl_driver_map_mem@Base 1.8
+ pocl_driver_memfill@Base 1.8
+ pocl_driver_read@Base 1.8
+ pocl_driver_read_rect@Base 1.8
+ pocl_driver_setup_metadata@Base 1.8
+ pocl_driver_supports_binary@Base 1.8
+ pocl_driver_svm_fill@Base 1.8-3~visibility
+ pocl_driver_unmap_mem@Base 1.8
+ pocl_driver_write@Base 1.8
+ pocl_driver_write_rect@Base 1.8
+ pocl_exec_command@Base 1.6
+ pocl_exists@Base 1.6-5~visibility
+ pocl_fill_dev_image_t@Base 1.6-5~
+ pocl_fill_dev_sampler_t@Base 1.6-5~
+#MISSING: 0.14# pocl_find_img_format@Base 0.10
+#MISSING: 0.14# pocl_finish_all_queues@Base 0.12
+ pocl_free_chunk@Base 1.8-3~visibility
+ pocl_free_global_mem@Base 1.6
+#MISSING: 0.14~visibility# pocl_free_llvm_irs@Base 0.12
+ pocl_get_bool_option@Base 0.10
+ (optional=distro_build)pocl_get_distro_cpu_name@Base 3.0-2~
+ (optional=distro_build)pocl_get_distro_kernellib_name@Base 3.0-2~
+ pocl_get_int_option@Base 0.10
+ pocl_get_llvm_cpu_name@Base 1.8-3~visibility
+ pocl_get_string_option@Base 0.10
+ pocl_gettimemono_ns@Base 1.6-5~visibility
+ pocl_init_default_device_infos@Base 1.6
+ pocl_init_dlhandle_cache@Base 1.6
+#MISSING: 0.14~visibility# pocl_init_mem_manager@Base 0.10
+ pocl_init_mem_region@Base 1.8-3~visibility
+ pocl_is_option_set@Base 1.8-3~visibility
+#MISSING: 0.14~visibility# pocl_llvm_build_program@Base 0.10
+#MISSING: 0.14~visibility# pocl_llvm_codegen@Base 0.10
+ pocl_llvm_generate_workgroup_function@Base 0.10
+#MISSING: 0.14~visibility# pocl_llvm_get_kernel_count@Base 0.12
+#MISSING: 0.14# pocl_llvm_get_kernel_metadata@Base 0.10
+#MISSING: 0.14# pocl_llvm_get_kernel_names@Base 0.10
+#MISSING: 0.14~visibility# pocl_llvm_update_binaries@Base 0.10
+#MISSING: 0.14# pocl_map_mem_cmd@Base 0.10
+#MISSING: 0.14~visibility# pocl_mem_manager_free_command@Base 0.10
+#MISSING: 0.14~visibility# pocl_mem_manager_free_event@Base 0.10
+#MISSING: 0.14~visibility# pocl_mem_manager_new_command@Base 0.10
+#MISSING: 0.14~visibility# pocl_mem_manager_new_event@Base 0.10
+#MISSING: 0.14~visibility# pocl_memalign_alloc@Base 0.11
+#MISSING: 0.14# pocl_memalign_alloc_global_mem@Base 0.13
+ pocl_mk_tempname@Base 1.8-3~visibility
+ pocl_mkdir_p@Base 1.8-3~visibility
+#MISSING: 3.0# pocl_ndrange_node_cleanup@Base 1.6
+#MISSING: 0.14~visibility# pocl_print_system_memory_stats@Base 0.13
+#MISSING: 0.13# pocl_pthread_malloc@Base 0.11
+ pocl_read_file@Base 1.8-3~visibility
+#MISSING: 0.14~visibility# pocl_rect_copy@Base 0.13
+ pocl_reinit_system_memory@Base 1.8-3~visibility
+ pocl_release_dlhandle_cache@Base 1.6
+ pocl_release_mem_host_ptr@Base 1.8
+ pocl_rename@Base 1.8-3~visibility
+ pocl_restore_ftz@Base 1.6
+ pocl_restore_rm@Base 1.6
+ pocl_run_command@Base 1.8-3~visibility
+ pocl_run_command_capture_output@Base 3.0
+ pocl_save_ftz@Base 1.6
+ pocl_save_rm@Base 1.6
+ pocl_set_buffer_image_limits@Base 1.6
+ pocl_set_default_rm@Base 1.6
+ pocl_set_ftz@Base 1.6
+ pocl_setup_builtin_kernels_with_version@Base 3.0
+ pocl_setup_device_for_system_memory@Base 1.8-3~visibility
+ pocl_setup_extensions_with_version@Base 3.0
+ pocl_setup_features_with_version@Base 3.0
+ pocl_setup_ils_with_version@Base 3.0
+ pocl_setup_opencl_c_with_version@Base 3.0
+ pocl_size_ceil2@Base 1.8-3~visibility
+ pocl_stderr_is_a_tty@Base 1.6-5~
+#MISSING: 0.12# pocl_sysfs_detect_compute_unit_count@Base 0.11
+ pocl_topology_detect_device_info@Base 1.6
+#MISSING: 3.0# pocl_unmap_command_finished2@Base 1.8-3~visibility
+ pocl_update_event_complete@Base 3.0
+#MISSING: 3.0# pocl_update_event_complete_msg@Base 1.6
+ pocl_update_event_failed@Base 1.6
+#MISSING: 1.6-5~visibility# pocl_update_event_finished_msg@Base 1.4
+ pocl_update_event_running@Base 1.6
+ pocl_update_event_running_unlocked@Base 1.8-3~visibility
+ pocl_update_event_submitted@Base 1.6
+#MISSING: 0.14~visibility# pocl_update_program_llvm_irs@Base 0.11
+ pocl_wg_utilization_maximizer@Base 1.8-3~visibility
+ pocl_write_file@Base 1.6-5~visibility
+#MISSING: 1.6~visibility# scheduler_initialized@Base 1.3
+#MISSING: 1.6-5~# stderr_is_a_tty@Base 1.6
+#MISSING: 0.12~visibility# supported_image_formats@Base 0.10
+#MISSING: 0.14# ta_pool_lock@Base 0.10
diff --git a/patches/1001-poclcc-use-poclu_show_program_build_log.patch b/patches/1001-poclcc-use-poclu_show_program_build_log.patch
new file mode 100644 (file)
index 0000000..3ccf607
--- /dev/null
@@ -0,0 +1,35 @@
+From 49620ff9c8430390ca8efe2f334727ddf6111698 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Mon, 21 Mar 2022 17:48:30 +0100
+Subject: [PATCH 1001/1017] poclcc: use poclu_show_program_build_log()
+
+---
+ bin/poclcc.c | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/bin/poclcc.c b/bin/poclcc.c
+index c6de231e..24aef3ff 100644
+--- a/bin/poclcc.c
++++ b/bin/poclcc.c
+@@ -333,16 +333,8 @@ main(int argc, char **argv)
+   if (err != CL_SUCCESS)
+     {
+       printf ("Compilation failed\n");
+-      char build_log[4096];
+-      size_t actual_size = 0;
+-      err = clGetProgramBuildInfo (program, device_ids[opencl_device_id],
+-                                   CL_PROGRAM_BUILD_LOG, 4095, build_log,
+-                                   &actual_size);
+-      if (err == CL_SUCCESS)
+-        {
+-          build_log[actual_size] = 0;
+-          printf ("Error log: \n\n%s\n", build_log);
+-        }
++      poclu_show_program_build_log (program);
++      CHECK_OPENCL_ERROR_IN ("clBuildProgram");
+     }
+   size_t binary_sizes;
+-- 
+2.20.1
+
diff --git a/patches/1002-check-CMAKE_LIBRARY_ARCHITECTURE-instead-of-CMAKE_SY.patch b/patches/1002-check-CMAKE_LIBRARY_ARCHITECTURE-instead-of-CMAKE_SY.patch
new file mode 100644 (file)
index 0000000..89c991d
--- /dev/null
@@ -0,0 +1,50 @@
+From 32c7a173aaaf6b81977afd2662b8df6c490a4b15 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 08:49:28 +0100
+Subject: [PATCH 1002/1017] check CMAKE_LIBRARY_ARCHITECTURE instead of
+ CMAKE_SYSTEM_PROCESSOR
+
+e.g. architecture armhf runs on an aarch64 processor, too
+---
+ CMakeLists.txt              | 4 ++++
+ tests/kernel/CMakeLists.txt | 5 +++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 96ace837..ca161eab 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -29,6 +29,10 @@ cmake_policy(SET CMP0067 OLD)
+ project(pocl)
+ set(CMAKE_PROJECT_DESCRIPTION "pocl is a portable OpenCl runtime.")
++MESSAGE(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
++MESSAGE(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
++MESSAGE(STATUS "CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}")
++
+ set(LATEST_KNOWN_CXX_STD_VERSION "20")
+ set(SUPPORTED_CXX_STD_VERSION "11")
+diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt
+index 25ee0b7b..6ef0e357 100644
+--- a/tests/kernel/CMakeLists.txt
++++ b/tests/kernel/CMakeLists.txt
+@@ -242,12 +242,13 @@ if (NOT ENABLE_POCL_FLOAT_CONVERSION)
+   # on most platforms, the printf tests for vector types expose bugs in the
+   # pocl printf implementation (passing of variadic arguments containing OpenCL
+   # vector types) and maybe also related bugs in llvm (issue #682, #1007)
+-  if(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR
+-          CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x"))
++  if(NOT (CMAKE_LIBRARY_ARCHITECTURE STREQUAL "aarch64-linux-gnu" OR
++          CMAKE_LIBRARY_ARCHITECTURE STREQUAL "s390x-linux-gnu"))
+     set_tests_properties("kernel/test_printf_vectors"
+                         "kernel/test_printf_vectors_ulongn"
+       PROPERTIES WILL_FAIL 1)
+   endif()
++
+ endif()
+ add_test_pocl(NAME "kernel/test_sizeof_uint"
+-- 
+2.20.1
+
diff --git a/patches/1003-llc-version-no-longer-exits-with-a-non-zero-return-c.patch b/patches/1003-llc-version-no-longer-exits-with-a-non-zero-return-c.patch
new file mode 100644 (file)
index 0000000..dec97e0
--- /dev/null
@@ -0,0 +1,31 @@
+From 26e56f8ce5d5d5d7c5abc80e32fa39a88e67524b Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 10:24:11 +0100
+Subject: [PATCH 1003/1017] llc --version no longer exits with a non-zero
+ return code
+
+---
+ cmake/LLVM.cmake | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
+index 926b9776..73d8b6e2 100644
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -672,10 +672,9 @@ endif()
+ if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED LLC_HOST_CPU_AUTO)
+   message(STATUS "Find out LLC host CPU with ${LLVM_LLC}")
+   execute_process(COMMAND ${LLVM_LLC} "--version" RESULT_VARIABLE RES_VAR OUTPUT_VARIABLE OUTPUT_VAR)
+-  # WTF, ^^ has return value 1
+-  #if(RES_VAR)
+-  #  message(FATAL_ERROR "Error ${RES_VAR} while determining LLC host CPU")
+-  #endif()
++  if(RES_VAR)
++    message(FATAL_ERROR "Error ${RES_VAR} while determining LLC host CPU")
++  endif()
+   if(OUTPUT_VAR MATCHES "Host CPU: ([^ ]*)")
+     # sigh... STRING(STRIP is to workaround regexp bug in cmake
+-- 
+2.20.1
+
diff --git a/patches/1004-try-to-apply-the-LLVM-style-first.patch b/patches/1004-try-to-apply-the-LLVM-style-first.patch
new file mode 100644 (file)
index 0000000..7a95dfe
--- /dev/null
@@ -0,0 +1,27 @@
+From 015ce07c1886e7235af27f80e342bf2d5876c6a1 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 15:47:49 +0100
+Subject: [PATCH 1004/1017] try to apply the LLVM style first
+
+otherwise lib/llvmopencl/.*\.h get reformatted with GNU style
+---
+ tools/scripts/format-last-commit.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/scripts/format-last-commit.sh b/tools/scripts/format-last-commit.sh
+index 4c48e998..14212934 100755
+--- a/tools/scripts/format-last-commit.sh
++++ b/tools/scripts/format-last-commit.sh
+@@ -19,8 +19,8 @@ git show -U0 --no-color >$PATCHY
+ SCRIPTPATH=$( realpath "$0"  )
+ RELPATH=$(dirname "$SCRIPTPATH")
++$RELPATH/clang-format-diff.py -regex '(.*(\.hpp$|\.cc$))|(lib/llvmopencl/.*\.h)' -i -p1 -style LLVM <$PATCHY
+ $RELPATH/clang-format-diff.py -regex '.*(\.h$|\.c$|\.cl$)' -i -p1 -style GNU <$PATCHY
+-$RELPATH/clang-format-diff.py -regex '(.*(\.hh$|\.cc$))|(lib/llvmopencl/.*\.h)' -i -p1 -style LLVM <$PATCHY
+ if [ -z "$(git diff)" ]; then
+   echo "No changes."
+-- 
+2.20.1
+
diff --git a/patches/1005-no-using-namespace-in-headers.patch b/patches/1005-no-using-namespace-in-headers.patch
new file mode 100644 (file)
index 0000000..798bbdc
--- /dev/null
@@ -0,0 +1,60 @@
+From ea3e3f69acc8ffab76b378265604df08ba6b7ed9 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 15:43:45 +0100
+Subject: [PATCH 1005/1017] no 'using namespace' in headers
+
+---
+ lib/llvmopencl/BreakConstantGEPs.cpp | 2 ++
+ lib/llvmopencl/BreakConstantGEPs.h   | 9 ++++-----
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/lib/llvmopencl/BreakConstantGEPs.cpp b/lib/llvmopencl/BreakConstantGEPs.cpp
+index 4ae83a47..ecd285b0 100644
+--- a/lib/llvmopencl/BreakConstantGEPs.cpp
++++ b/lib/llvmopencl/BreakConstantGEPs.cpp
+@@ -38,6 +38,8 @@ IGNORE_COMPILER_WARNING("-Wunused-parameter")
+ #include "BreakConstantGEPs.h"
+ #include "Workgroup.h"
++using namespace llvm;
++
+ // Identifier variable for the pass
+ char BreakConstantGEPs::ID = 0;
+diff --git a/lib/llvmopencl/BreakConstantGEPs.h b/lib/llvmopencl/BreakConstantGEPs.h
+index d5a184dc..6b52a296 100644
+--- a/lib/llvmopencl/BreakConstantGEPs.h
++++ b/lib/llvmopencl/BreakConstantGEPs.h
+@@ -24,8 +24,6 @@
+ #include "llvm/IR/Module.h"
+ #include "llvm/Pass.h"
+-using namespace llvm;
+-
+ //
+ // Pass: BreakConstantGEPs
+ //
+@@ -33,7 +31,8 @@ using namespace llvm;
+ //  This pass modifies a function so that it uses GEP instructions instead of
+ //  GEP constant expressions.
+ //
+-struct BreakConstantGEPs : public FunctionPass {
++struct BreakConstantGEPs : public llvm::FunctionPass
++{
+   private:
+     // Private methods
+@@ -43,8 +42,8 @@ struct BreakConstantGEPs : public FunctionPass {
+     static char ID;
+     BreakConstantGEPs() : FunctionPass(ID) {}
+     llvm::StringRef getPassName() const override {return "Remove Constant GEP Expressions";}
+-    virtual bool runOnFunction (Function & F) override;
+-    virtual void getAnalysisUsage(AnalysisUsage &AU) const override {
++  virtual bool runOnFunction (llvm::Function &F) override;
++  virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
+       // This pass does not modify the control-flow graph of the function
+       AU.setPreservesCFG();
+     }
+-- 
+2.20.1
+
diff --git a/patches/1006-always-use-runtime-determined-llvm_cpu-to-compute-bu.patch b/patches/1006-always-use-runtime-determined-llvm_cpu-to-compute-bu.patch
new file mode 100644 (file)
index 0000000..e171725
--- /dev/null
@@ -0,0 +1,71 @@
+From f268754b2b17222372b1310dd4c471d87a322268 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Wed, 16 Mar 2022 16:10:50 +0100
+Subject: [PATCH 1006/1017] always use runtime determined llvm_cpu to compute
+ build_hash
+
+---
+ CMakeLists.txt                   | 4 ----
+ lib/CL/devices/basic/basic.c     | 9 ++-------
+ lib/CL/devices/pthread/pthread.c | 9 ++-------
+ 3 files changed, 4 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ca161eab..2ff89ad6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -479,11 +479,7 @@ if(ENABLE_LLVM)
+   if(ENABLE_HOST_CPU_DEVICES)
+   if(NOT DEFINED HOST_DEVICE_BUILD_HASH)
+-    if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
+       set(HOST_DEVICE_BUILD_HASH "${LLC_TRIPLE}")
+-    else()
+-      set(HOST_DEVICE_BUILD_HASH "${LLC_TRIPLE}-${LLC_HOST_CPU}")
+-    endif()
+   endif()
+   if(INTEL_SDE_AVX512)
+diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c
+index 689af090..8caf0748 100644
+--- a/lib/CL/devices/basic/basic.c
++++ b/lib/CL/devices/basic/basic.c
+@@ -143,13 +143,8 @@ char *
+ pocl_basic_build_hash (cl_device_id device)
+ {
+   char* res = calloc(1000, sizeof(char));
+-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-  char *name = pocl_get_llvm_cpu_name ();
+-  snprintf (res, 1000, "basic-%s-%s", HOST_DEVICE_BUILD_HASH, name);
+-  POCL_MEM_FREE (name);
+-#else
+-  snprintf (res, 1000, "basic-%s", HOST_DEVICE_BUILD_HASH);
+-#endif
++  snprintf (res, 1000, "basic-%s-%s", HOST_DEVICE_BUILD_HASH,
++            device->llvm_cpu);
+   return res;
+ }
+diff --git a/lib/CL/devices/pthread/pthread.c b/lib/CL/devices/pthread/pthread.c
+index 9d250c06..150c879a 100644
+--- a/lib/CL/devices/pthread/pthread.c
++++ b/lib/CL/devices/pthread/pthread.c
+@@ -101,13 +101,8 @@ char *
+ pocl_pthread_build_hash (cl_device_id device)
+ {
+   char* res = calloc(1000, sizeof(char));
+-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-  char *name = pocl_get_llvm_cpu_name ();
+-  snprintf (res, 1000, "pthread-%s-%s", HOST_DEVICE_BUILD_HASH, name);
+-  POCL_MEM_FREE (name);
+-#else
+-  snprintf (res, 1000, "pthread-%s", HOST_DEVICE_BUILD_HASH);
+-#endif
++  snprintf (res, 1000, "pthread-%s-%s", HOST_DEVICE_BUILD_HASH,
++            device->llvm_cpu);
+   return res;
+ }
+-- 
+2.20.1
+
diff --git a/patches/1007-force-kernellib-name-on-HOST_CPU_FORCED-too.patch b/patches/1007-force-kernellib-name-on-HOST_CPU_FORCED-too.patch
new file mode 100644 (file)
index 0000000..89a7fdc
--- /dev/null
@@ -0,0 +1,34 @@
+From 1804388d87a75af409ac6355efcbc59b0780c6fa Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 22 Mar 2022 14:51:19 +0100
+Subject: [PATCH 1007/1017] force kernellib name on HOST_CPU_FORCED, too
+
+---
+ lib/CL/pocl_llvm_build.cc | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/CL/pocl_llvm_build.cc b/lib/CL/pocl_llvm_build.cc
+index 5587e3fd..ee1698ed 100644
+--- a/lib/CL/pocl_llvm_build.cc
++++ b/lib/CL/pocl_llvm_build.cc
+@@ -977,6 +977,8 @@ static llvm::Module *getKernelLibrary(cl_device_id device,
+     kernellib += '-';
+ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+     kernellib += getX86KernelLibName();
++#elif defined(HOST_CPU_FORCED)
++    kernellib += OCL_KERNEL_TARGET_CPU;
+ #else
+     kernellib_fallback = kernellib;
+     kernellib_fallback += OCL_KERNEL_TARGET_CPU;
+@@ -996,7 +998,7 @@ static llvm::Module *getKernelLibrary(cl_device_id device,
+     }
+   else
+     {
+-#ifndef KERNELLIB_HOST_DISTRO_VARIANTS
++#if !defined(KERNELLIB_HOST_DISTRO_VARIANTS) && !defined(HOST_CPU_FORCED)
+       if (is_host && pocl_exists(kernellib_fallback.c_str()))
+         {
+           POCL_MSG_WARN("Using fallback %s as the built-in lib.\n",
+-- 
+2.20.1
+
diff --git a/patches/1008-use-a-UTC-timestamp-for-POCL_BUILD_TIMESTAMP.patch b/patches/1008-use-a-UTC-timestamp-for-POCL_BUILD_TIMESTAMP.patch
new file mode 100644 (file)
index 0000000..df5b3f9
--- /dev/null
@@ -0,0 +1,27 @@
+From 4aff0565e2fbd71c98939412edcb2af2d947a3cc Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Thu, 7 Apr 2022 22:27:03 +0200
+Subject: [PATCH 1008/1017] use a UTC timestamp for POCL_BUILD_TIMESTAMP
+
+this will be reproducible if SOURCE_DATE_EPOCH is set,
+regardless of any TZ setting
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2ff89ad6..b49d9955 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1043,7 +1043,7 @@ endif()
+ set_expr(POCL_KERNEL_CACHE_DEFAULT KERNEL_CACHE_DEFAULT)
+-string(TIMESTAMP POCL_BUILD_TIMESTAMP "%d%m%Y%H%M%S")
++string(TIMESTAMP POCL_BUILD_TIMESTAMP "%d%m%Y%H%M%S" UTC)
+ file(WRITE "${CMAKE_BINARY_DIR}/pocl_build_timestamp.h" "#define POCL_BUILD_TIMESTAMP \"${POCL_BUILD_TIMESTAMP}\"")
+ ####################################################################
+-- 
+2.20.1
+
diff --git a/patches/1009-rename-getX86KernelLibName-to-pocl_get_distro_kernel.patch b/patches/1009-rename-getX86KernelLibName-to-pocl_get_distro_kernel.patch
new file mode 100644 (file)
index 0000000..34ea23d
--- /dev/null
@@ -0,0 +1,80 @@
+From 701b61b699b1fceeababef5fbfa48a6d648edac6 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Wed, 23 Mar 2022 13:55:50 +0100
+Subject: [PATCH 1009/1017] rename getX86KernelLibName() to
+ pocl_get_distro_kernellib_name()
+
+---
+ lib/CL/pocl_llvm.h        |  5 +++++
+ lib/CL/pocl_llvm_build.cc | 17 +++++++++--------
+ 2 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h
+index bf32ab27..2f5f625f 100644
+--- a/lib/CL/pocl_llvm.h
++++ b/lib/CL/pocl_llvm.h
+@@ -37,6 +37,11 @@ extern "C" {
+   /* Returns the cpu name as reported by LLVM. */
+   POCL_EXPORT
+   char *pocl_get_llvm_cpu_name ();
++
++  /* For distro builds, return the kernellib name based on the host CPU */
++  POCL_EXPORT
++  const char *pocl_get_distro_kernellib_name ();
++
+   /* Returns if the cpu supports FMA instruction (uses LLVM). */
+   int cpu_has_fma ();
+diff --git a/lib/CL/pocl_llvm_build.cc b/lib/CL/pocl_llvm_build.cc
+index ee1698ed..fad703ff 100644
+--- a/lib/CL/pocl_llvm_build.cc
++++ b/lib/CL/pocl_llvm_build.cc
+@@ -880,21 +880,17 @@ int pocl_llvm_link_program(cl_program program, unsigned device_i,
+ /* for "distro" style kernel libs, return which kernellib to use, at runtime */
+ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-const char *getX86KernelLibName() {
++const char *pocl_get_distro_kernellib_name() {
+   StringMap<bool> Features;
+   const char *res = NULL;
+   if (!llvm::sys::getHostCPUFeatures(Features)) {
+-    POCL_MSG_WARN ("getX86KernelLibName(): LLVM can't get host CPU flags!\n");
+-    /* getX86KernelLibName should only ever be enabled
+-       on x86-64, which always has sse2 */
+-    return "sse2";
++    POCL_ABORT("LLVM can't get host CPU flags!\n");
+   }
++#if defined(__x86_64__)
+   if (Features["sse2"])
+     res = "sse2";
+-  else
+-    POCL_ABORT("Pocl on x86_64 requires at least SSE2\n");
+   if (Features["ssse3"] && Features["cx16"])
+     res = "ssse3";
+   if (Features["sse4.1"] && Features["cx16"])
+@@ -912,6 +908,11 @@ const char *getX86KernelLibName() {
+     res = "avx2";
+   if (Features["avx512f"] )
+     res = "avx512";
++#endif
++
++  if (!res)
++    POCL_ABORT("Can't find a kernellib supported by the host CPU (%s)\n",
++               llvm::sys::getHostCPUName());
+   return res;
+ }
+@@ -976,7 +977,7 @@ static llvm::Module *getKernelLibrary(cl_device_id device,
+   if (is_host) {
+     kernellib += '-';
+ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-    kernellib += getX86KernelLibName();
++    kernellib += pocl_get_distro_kernellib_name();
+ #elif defined(HOST_CPU_FORCED)
+     kernellib += OCL_KERNEL_TARGET_CPU;
+ #else
+-- 
+2.20.1
+
diff --git a/patches/1010-use-a-more-generic-solution-for-pocl_get_distro_kern.patch b/patches/1010-use-a-more-generic-solution-for-pocl_get_distro_kern.patch
new file mode 100644 (file)
index 0000000..168ed7d
--- /dev/null
@@ -0,0 +1,132 @@
+From b9b431ccc27987649ea44e066caec2403a0e4d2d Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Wed, 23 Mar 2022 14:24:18 +0100
+Subject: [PATCH 1010/1017] use a more generic solution for
+ pocl_get_distro_kernellib_name()
+
+---
+ lib/CL/pocl_llvm_build.cc | 41 -----------------------------
+ lib/CL/pocl_llvm_utils.cc | 55 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 55 insertions(+), 41 deletions(-)
+
+diff --git a/lib/CL/pocl_llvm_build.cc b/lib/CL/pocl_llvm_build.cc
+index fad703ff..38fe1aa0 100644
+--- a/lib/CL/pocl_llvm_build.cc
++++ b/lib/CL/pocl_llvm_build.cc
+@@ -878,47 +878,6 @@ int pocl_llvm_link_program(cl_program program, unsigned device_i,
+   return CL_SUCCESS;
+ }
+-/* for "distro" style kernel libs, return which kernellib to use, at runtime */
+-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-const char *pocl_get_distro_kernellib_name() {
+-  StringMap<bool> Features;
+-  const char *res = NULL;
+-
+-  if (!llvm::sys::getHostCPUFeatures(Features)) {
+-    POCL_ABORT("LLVM can't get host CPU flags!\n");
+-  }
+-
+-#if defined(__x86_64__)
+-  if (Features["sse2"])
+-    res = "sse2";
+-  if (Features["ssse3"] && Features["cx16"])
+-    res = "ssse3";
+-  if (Features["sse4.1"] && Features["cx16"])
+-    res = "sse41";
+-  if (Features["avx"] && Features["cx16"] && Features["popcnt"])
+-    res = "avx";
+-  if (Features["avx"] && Features["cx16"] && Features["popcnt"] && Features["f16c"])
+-    res = "avx_f16c";
+-  if (Features["avx"] && Features["cx16"] && Features["popcnt"]
+-      && Features["xop"] && Features["fma4"])
+-    res = "avx_fma4";
+-  if (Features["avx"] && Features["avx2"] && Features["cx16"]
+-      && Features["popcnt"] && Features["lzcnt"] && Features["f16c"]
+-      && Features["fma"] && Features["bmi"] && Features["bmi2"])
+-    res = "avx2";
+-  if (Features["avx512f"] )
+-    res = "avx512";
+-#endif
+-
+-  if (!res)
+-    POCL_ABORT("Can't find a kernellib supported by the host CPU (%s)\n",
+-               llvm::sys::getHostCPUName());
+-
+-  return res;
+-}
+-#endif
+-
+-
+ /**
+  * Return the OpenCL C built-in function library bitcode
+  * for the given device.
+diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
+index bea50041..857773f3 100644
+--- a/lib/CL/pocl_llvm_utils.cc
++++ b/lib/CL/pocl_llvm_utils.cc
+@@ -143,6 +143,61 @@ char *pocl_get_llvm_cpu_name() {
+   return cpu_name;
+ }
++#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
++const struct kernellib_features {
++  const char *kernellib_name;
++  const char *features[12];
++} kernellib_feature_map[] = {
++// order the entries s.t. if a cpu matches multiple entries, the "best" match
++// comes last
++#if defined(__x86_64__)
++    "sse2",
++    {"sse2", NULL},
++    "ssse3",
++    {"sse2", "ssse3", "cx16", NULL},
++    "sse41",
++    {"sse2", "sse4.1", "cx16", NULL},
++    "avx",
++    {"sse2", "avx", "cx16", "popcnt", NULL},
++    "avx_f16c",
++    {"sse2", "avx", "cx16", "popcnt", "f16c", NULL},
++    "avx_fma4",
++    {"sse2", "avx", "cx16", "popcnt", "xop", "fma4", NULL},
++    "avx2",
++    {"sse2", "avx", "avx2", "cx16", "popcnt", "lzcnt", "f16c", "fma", "bmi",
++     "bmi2", NULL},
++    "avx512",
++    {"sse2", "avx512f", NULL},
++#endif
++    NULL,
++    {NULL}};
++
++/* for "distro" style kernel libs, return which kernellib to use, at runtime */
++const char *pocl_get_distro_kernellib_name() {
++  StringMap<bool> Features;
++
++  if (!llvm::sys::getHostCPUFeatures(Features))
++    POCL_ABORT("LLVM can't get host CPU flags!\n");
++
++  const kernellib_features *best_match = NULL;
++  for (const kernellib_features *kf = kernellib_feature_map; kf->kernellib_name;
++       ++kf) {
++    bool matches = true;
++    for (const char *const *f = kf->features; *f; ++f)
++      matches &= Features[*f];
++    if (matches) {
++      best_match = kf;
++    }
++  }
++
++  if (!best_match)
++    POCL_ABORT("Can't find a kernellib supported by the host CPU (%s)\n",
++               llvm::sys::getHostCPUName());
++
++  return best_match->kernellib_name;
++}
++#endif
++
+ int bitcode_is_triple(const char *bitcode, size_t size, const char *triple) {
+   std::string Triple;
+   if (getModuleTriple(bitcode, size, Triple) == 0)
+-- 
+2.20.1
+
diff --git a/patches/1011-add-pocl_get_distro_cpu_name.patch b/patches/1011-add-pocl_get_distro_cpu_name.patch
new file mode 100644 (file)
index 0000000..0d14054
--- /dev/null
@@ -0,0 +1,104 @@
+From 1cf0c5d358eb6444992c89ab7bde3864739985b3 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Thu, 7 Apr 2022 12:04:05 +0200
+Subject: [PATCH 1011/1017] add pocl_get_distro_cpu_name()
+
+in distro builds, map each kernellib_name to a specific llvm_cpu
+which is then used as compilation target instead of the native cpu
+
+this limits the possible code generation targets in distro builds
+in order to be able to run tests against all of them with a minimal
+number of different (physical) CPU models
+---
+ lib/CL/pocl_llvm.h        |  4 ++++
+ lib/CL/pocl_llvm_utils.cc | 29 +++++++++++++++++++++++++++++
+ 2 files changed, 33 insertions(+)
+
+diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h
+index 2f5f625f..be5a1a08 100644
+--- a/lib/CL/pocl_llvm.h
++++ b/lib/CL/pocl_llvm.h
+@@ -42,6 +42,10 @@ extern "C" {
+   POCL_EXPORT
+   const char *pocl_get_distro_kernellib_name ();
++  /* For distro builds, return the target cpu name for a kernellib name */
++  POCL_EXPORT
++  const char *pocl_get_distro_cpu_name (const char *kernellib_name);
++
+   /* Returns if the cpu supports FMA instruction (uses LLVM). */
+   int cpu_has_fma ();
+diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
+index 857773f3..7bdfb387 100644
+--- a/lib/CL/pocl_llvm_utils.cc
++++ b/lib/CL/pocl_llvm_utils.cc
+@@ -146,29 +146,39 @@ char *pocl_get_llvm_cpu_name() {
+ #ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+ const struct kernellib_features {
+   const char *kernellib_name;
++  const char *cpu_name;
+   const char *features[12];
+ } kernellib_feature_map[] = {
+ // order the entries s.t. if a cpu matches multiple entries, the "best" match
+ // comes last
+ #if defined(__x86_64__)
+     "sse2",
++    "athlon64",
+     {"sse2", NULL},
+     "ssse3",
++    "core2",
+     {"sse2", "ssse3", "cx16", NULL},
+     "sse41",
++    "penryn",
+     {"sse2", "sse4.1", "cx16", NULL},
+     "avx",
++    "sandybridge",
+     {"sse2", "avx", "cx16", "popcnt", NULL},
+     "avx_f16c",
++    "ivybridge",
+     {"sse2", "avx", "cx16", "popcnt", "f16c", NULL},
+     "avx_fma4",
++    "bdver1",
+     {"sse2", "avx", "cx16", "popcnt", "xop", "fma4", NULL},
+     "avx2",
++    "haswell",
+     {"sse2", "avx", "avx2", "cx16", "popcnt", "lzcnt", "f16c", "fma", "bmi",
+      "bmi2", NULL},
+     "avx512",
++    "skylake-avx512",
+     {"sse2", "avx512f", NULL},
+ #endif
++    NULL,
+     NULL,
+     {NULL}};
+@@ -196,6 +206,25 @@ const char *pocl_get_distro_kernellib_name() {
+   return best_match->kernellib_name;
+ }
++
++/* for "distro" style kernel libs, return which target cpu to use for a given
++ * kernellib */
++const char *pocl_get_distro_cpu_name(const char *kernellib_name) {
++  StringMap<bool> Features;
++
++  if (!llvm::sys::getHostCPUFeatures(Features))
++    POCL_ABORT("LLVM can't get host CPU flags!\n");
++
++  const kernellib_features *best_match = NULL;
++  for (const kernellib_features *kf = kernellib_feature_map; kf->kernellib_name;
++       ++kf) {
++    if (!strcmp(kernellib_name, kf->kernellib_name))
++      return kf->cpu_name;
++  }
++
++  POCL_ABORT("Can't find a cpu name matching the kernellib (%s)\n",
++             kernellib_name);
++}
+ #endif
+ int bitcode_is_triple(const char *bitcode, size_t size, const char *triple) {
+-- 
+2.20.1
+
diff --git a/patches/1012-_cl_device_id-add-const-char-kernellib_name.patch b/patches/1012-_cl_device_id-add-const-char-kernellib_name.patch
new file mode 100644 (file)
index 0000000..49550dc
--- /dev/null
@@ -0,0 +1,71 @@
+From e430db0b46eede7e7d06e40238c75173a66b116e Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Sat, 9 Apr 2022 15:28:42 +0200
+Subject: [PATCH 1012/1017] _cl_device_id: add const char* kernellib_name
+
+determine the value at the same time as llvm_cpu, if possible
+---
+ lib/CL/devices/common.c   | 8 +++++++-
+ lib/CL/pocl_cl.h          | 2 ++
+ lib/CL/pocl_llvm_build.cc | 6 ++----
+ 3 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c
+index 47fe0855..1481e627 100644
+--- a/lib/CL/devices/common.c
++++ b/lib/CL/devices/common.c
+@@ -1584,13 +1584,19 @@ pocl_init_default_device_infos (cl_device_id dev)
+ #ifdef ENABLE_LLVM
+   dev->llvm_target_triplet = OCL_KERNEL_TARGET;
+-#ifdef HOST_CPU_FORCED
++#if defined(KERNELLIB_HOST_DISTRO_VARIANTS)
++  dev->kernellib_name = pocl_get_distro_kernellib_name ();
++  dev->llvm_cpu = pocl_get_distro_cpu_name (dev->kernellib_name);
++#elif defined(HOST_CPU_FORCED)
++  dev->kernellib_name = OCL_KERNEL_TARGET_CPU;
+   dev->llvm_cpu = OCL_KERNEL_TARGET_CPU;
+ #else
++  dev->kernellib_name = NULL;
+   dev->llvm_cpu = pocl_get_llvm_cpu_name ();
+ #endif
+ #else /* No compiler, no CPU info */
++  dev->kernellib_name = NULL;
+   dev->llvm_cpu = NULL;
+   dev->llvm_target_triplet = "";
+ #endif
+diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
+index 461009b0..fc9f2253 100644
+--- a/lib/CL/pocl_cl.h
++++ b/lib/CL/pocl_cl.h
+@@ -963,7 +963,9 @@ struct _cl_device_id {
+   void *data;
+   const char* llvm_target_triplet; /* the llvm target triplet to use */
++  const char *kernellib_name;      /* the kernellib variant to use */
+   const char* llvm_cpu; /* the llvm CPU variant to use */
++
+   /* A running number (starting from zero) across all the device instances.
+      Used for indexing arrays in data structures with device specific
+      entries. */
+diff --git a/lib/CL/pocl_llvm_build.cc b/lib/CL/pocl_llvm_build.cc
+index 38fe1aa0..38de9802 100644
+--- a/lib/CL/pocl_llvm_build.cc
++++ b/lib/CL/pocl_llvm_build.cc
+@@ -935,10 +935,8 @@ static llvm::Module *getKernelLibrary(cl_device_id device,
+   kernellib += device->llvm_target_triplet;
+   if (is_host) {
+     kernellib += '-';
+-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
+-    kernellib += pocl_get_distro_kernellib_name();
+-#elif defined(HOST_CPU_FORCED)
+-    kernellib += OCL_KERNEL_TARGET_CPU;
++#if defined(KERNELLIB_HOST_DISTRO_VARIANTS) || defined(HOST_CPU_FORCED)
++    kernellib += device->kernellib_name;
+ #else
+     kernellib_fallback = kernellib;
+     kernellib_fallback += OCL_KERNEL_TARGET_CPU;
+-- 
+2.20.1
+
diff --git a/patches/1013-allow-overriding-kernellib_name-for-distro-builds-wi.patch b/patches/1013-allow-overriding-kernellib_name-for-distro-builds-wi.patch
new file mode 100644 (file)
index 0000000..69a14f7
--- /dev/null
@@ -0,0 +1,40 @@
+From bcacc61f6bd0b136ed8c79613dbbecf206c6a3bf Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Sat, 9 Apr 2022 16:30:15 +0200
+Subject: [PATCH 1013/1017] allow overriding kernellib_name for distro builds
+ with POCL_KERNELLIB_NAME
+
+the kernellib_name (and corresponding llvm_cpu) can be overridden
+to a target with a subset of the features supported by the current cpu
+
+this will allow running e.g. code generation and tests for sse2 (but no
+newer features) on a modern cpu
+---
+ lib/CL/pocl_llvm_utils.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
+index 7bdfb387..018bbb37 100644
+--- a/lib/CL/pocl_llvm_utils.cc
++++ b/lib/CL/pocl_llvm_utils.cc
+@@ -189,6 +189,8 @@ const char *pocl_get_distro_kernellib_name() {
+   if (!llvm::sys::getHostCPUFeatures(Features))
+     POCL_ABORT("LLVM can't get host CPU flags!\n");
++  const char *custom = pocl_get_string_option("POCL_KERNELLIB_NAME", NULL);
++
+   const kernellib_features *best_match = NULL;
+   for (const kernellib_features *kf = kernellib_feature_map; kf->kernellib_name;
+        ++kf) {
+@@ -197,6 +199,8 @@ const char *pocl_get_distro_kernellib_name() {
+       matches &= Features[*f];
+     if (matches) {
+       best_match = kf;
++      if (custom && !strcmp(custom, kf->kernellib_name))
++        break;
+     }
+   }
+-- 
+2.20.1
+
diff --git a/patches/1014-improve-grouping-of-ENABLE_HOST_CPU_DEVICES-specific.patch b/patches/1014-improve-grouping-of-ENABLE_HOST_CPU_DEVICES-specific.patch
new file mode 100644 (file)
index 0000000..49328b5
--- /dev/null
@@ -0,0 +1,168 @@
+From 66f8164c75dc59790021948a7e397b5de3fe9d44 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 10:33:22 +0100
+Subject: [PATCH 1014/1017] improve grouping of ENABLE_HOST_CPU_DEVICES
+ specific tests
+
+---
+ CMakeLists.txt   | 10 +++++---
+ cmake/LLVM.cmake | 62 ++++++++++++++++++++++--------------------------
+ 2 files changed, 36 insertions(+), 36 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b49d9955..95009331 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1783,8 +1783,6 @@ if (ENABLE_LLVM)
+   MESSAGE(STATUS "CLANG_HAS_64B_MATH: ${CLANG_HAS_64B_MATH}")
+   MESSAGE(STATUS "CLANG_HAS_128B_MATH: ${CLANG_HAS_128B_MATH}")
+   MESSAGE(STATUS "CLANG_NEEDS_RTLIB: ${CLANG_NEEDS_RTLIB}")
+-  MESSAGE(STATUS "CLANG_MARCH_FLAG: ${CLANG_MARCH_FLAG}")
+-  MESSAGE(STATUS "CLANG_TARGET_OPTION: ${CLANG_TARGET_OPTION}")
+   MESSAGE(STATUS "LLVM_VERSION: ${LLVM_VERSION}")
+   MESSAGE(STATUS "LLVM_LIB_IS_SHARED: ${LLVM_LIB_IS_SHARED}")
+   MESSAGE(STATUS "LLVM_HAS_RTTI: ${LLVM_HAS_RTTI}")
+@@ -1802,10 +1800,16 @@ if (ENABLE_LLVM)
+   MESSAGE(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
+   MESSAGE(STATUS "LLVM_ALL_TARGETS: ${LLVM_ALL_TARGETS}")
+   MESSAGE(STATUS "LLVM_HOST_TARGET: ${LLVM_HOST_TARGET}")
++  if(ENABLE_HOST_CPU_DEVICES)
++  MESSAGE(STATUS "CLANG_TARGET_OPTION: ${CLANG_TARGET_OPTION}")
++  MESSAGE(STATUS "CLANG_MARCH_FLAG: ${CLANG_MARCH_FLAG}")
+   MESSAGE(STATUS "LLC_TRIPLE: ${LLC_TRIPLE}")
++  MESSAGE(STATUS "LLC_HOST_CPU_AUTO: ${LLC_HOST_CPU_AUTO}")
+   MESSAGE(STATUS "LLC_HOST_CPU: ${LLC_HOST_CPU}")
+-  MESSAGE(STATUS "")
++  MESSAGE(STATUS "HOST_CPU_FORCED: ${HOST_CPU_FORCED}")
++  endif()
+ endif()
++MESSAGE(STATUS "")
+ MESSAGE(STATUS "MAX_EXTENDED_ALIGNMENT: ${MAX_EXTENDED_ALIGNMENT}")
+ MESSAGE(STATUS "OCL_KERNEL_TARGET: ${OCL_KERNEL_TARGET}")
+ MESSAGE(STATUS "OCL_KERNEL_TARGET_CPU: ${OCL_KERNEL_TARGET_CPU}")
+diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
+index 73d8b6e2..e4f61b41 100644
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -468,31 +468,6 @@ endmacro()
+ ####################################################################
+ ####################################################################
+-# The option for specifying the target changed; try the modern syntax
+-# first, and fall back to the old-style syntax if this failed
+-
+-if(NOT DEFINED CLANG_TARGET_OPTION AND ENABLE_HOST_CPU_DEVICES)
+-
+-  custom_try_compile_clangxx("" "return 0;" RES "--target=${LLVM_HOST_TARGET}")
+-  if(NOT RES)
+-    set(CLANG_TGT "--target=")
+-  else()
+-    #EXECUTE_PROCESS(COMMAND "${CLANG}" "-target ${LLVM_HOST_TARGET}" "-x" "c" "/dev/null" "-S" RESULT_VARIABLE RES)
+-    custom_try_compile_clangxx("" "return 0;" RES "-target ${LLVM_HOST_TARGET}")
+-    if(NOT RES)
+-      set(CLANG_TGT "-target ")
+-    else()
+-      message(FATAL_ERROR "Cannot determine Clang option to specify the target")
+-    endif()
+-  endif()
+-
+-  set(CLANG_TARGET_OPTION ${CLANG_TGT} CACHE INTERNAL "Clang option used to specify the target" )
+-
+-endif()
+-
+-####################################################################
+-####################################################################
+-
+ if(NOT DEFINED CLANG_NEEDS_RTLIB)
+   set(RT128 OFF)
+@@ -627,6 +602,31 @@ endif()
+ ####################################################################
++if(ENABLE_HOST_CPU_DEVICES)
++
++# The option for specifying the target changed; try the modern syntax
++# first, and fall back to the old-style syntax if this failed
++
++if(NOT DEFINED CLANG_TARGET_OPTION)
++
++  custom_try_compile_clangxx("" "return 0;" RES "--target=${LLVM_HOST_TARGET}")
++  if(NOT RES)
++    set(CLANG_TGT "--target=")
++  else()
++    #EXECUTE_PROCESS(COMMAND "${CLANG}" "-target ${LLVM_HOST_TARGET}" "-x" "c" "/dev/null" "-S" RESULT_VARIABLE RES)
++    custom_try_compile_clangxx("" "return 0;" RES "-target ${LLVM_HOST_TARGET}")
++    if(NOT RES)
++      set(CLANG_TGT "-target ")
++    else()
++      message(FATAL_ERROR "Cannot determine Clang option to specify the target")
++    endif()
++  endif()
++
++  set(CLANG_TARGET_OPTION ${CLANG_TGT} CACHE INTERNAL "Clang option used to specify the target" )
++
++endif()
++
++
+ # TODO: We need to set both target-triple and cpu-type when
+ # building, since the ABI depends on both. We can either add flags
+ # to all the scripts, or set the respective flags here in
+@@ -641,8 +641,7 @@ endif()
+ # depending on whether they are generated via clang or directly
+ # via llc.
+-
+-if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED LLC_TRIPLE)
++if(NOT DEFINED LLC_TRIPLE)
+   message(STATUS "Find out LLC target triple (for host ${LLVM_HOST_TARGET})")
+   set(_EMPTY_C_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/tripletfind.c")
+   file(WRITE "${_EMPTY_C_FILE}" "")
+@@ -661,7 +660,6 @@ if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED LLC_TRIPLE)
+   string(REPLACE "armv7l-" "armv7-" LLC_TRIPLE "${LLC_TRIPLE}")
+   set(LLC_TRIPLE "${LLC_TRIPLE}" CACHE INTERNAL "LLC_TRIPLE")
+-
+ endif()
+@@ -669,7 +667,7 @@ endif()
+ # targeted if you pass -mcpu=native to llc, so we could replace this auto-detection
+ # with just: set(LLC_HOST_CPU "native"), however, we can't do this at the moment
+ # because of the work-around for arm1176jz-s.
+-if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED LLC_HOST_CPU_AUTO)
++if(NOT DEFINED LLC_HOST_CPU_AUTO)
+   message(STATUS "Find out LLC host CPU with ${LLVM_LLC}")
+   execute_process(COMMAND ${LLVM_LLC} "--version" RESULT_VARIABLE RES_VAR OUTPUT_VARIABLE OUTPUT_VAR)
+   if(RES_VAR)
+@@ -689,8 +687,6 @@ if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED LLC_HOST_CPU_AUTO)
+   endif()
+ endif()
+-
+-
+ if((LLC_HOST_CPU_AUTO MATCHES "unknown") AND (NOT LLC_HOST_CPU))
+   message(FATAL_ERROR "LLVM could not recognize your CPU model automatically. Please run CMake with -DLLC_HOST_CPU=<cpu> (you can find valid names with: llc -mcpu=help)")
+ else()
+@@ -706,9 +702,7 @@ else()
+ endif()
+-####################################################################
+ # Some architectures have -march and -mcpu reversed
+-
+ if(NOT DEFINED CLANG_MARCH_FLAG)
+   message(STATUS "Checking clang -march vs. -mcpu flag")
+   custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU})
+@@ -727,6 +721,8 @@ if(NOT DEFINED CLANG_MARCH_FLAG)
+   set(CLANG_MARCH_FLAG ${CLANG_MARCH_FLAG} CACHE INTERNAL "Clang option used to specify the target cpu")
+ endif()
++endif(ENABLE_HOST_CPU_DEVICES)
++
+ ####################################################################
+ # This tests that we can actually link to the llvm libraries.
+-- 
+2.20.1
+
diff --git a/patches/1015-use-_LLC_HOST_CPU-as-internal-variable.patch b/patches/1015-use-_LLC_HOST_CPU-as-internal-variable.patch
new file mode 100644 (file)
index 0000000..2aa2585
--- /dev/null
@@ -0,0 +1,112 @@
+From b3e3ff223547cb6c66ea3c57e494d43506f3e8d3 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 11:05:45 +0100
+Subject: [PATCH 1015/1017] use _LLC_HOST_CPU as internal variable
+
+do not set LLC_HOST_CPU to LLC_HOST_CPU_AUTO as it will turn on
+HOST_CPU_FORCED on a subsequent cmake run
+---
+ CMakeLists.txt                  | 5 +++--
+ cmake/LLVM.cmake                | 9 +++++----
+ lib/kernel/host/CMakeLists.txt  | 2 +-
+ tests/regression/CMakeLists.txt | 2 +-
+ 4 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 95009331..4f8730d6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -484,7 +484,7 @@ if(ENABLE_LLVM)
+   if(INTEL_SDE_AVX512)
+     set(HOST_CPU_FORCED 1 CACHE INTERNAL "CPU is forced by user" FORCE)
+-    set(LLC_HOST_CPU "skylake-avx512" CACHE STRING "The Host CPU to use with llc" FORCE)
++    set(_LLC_HOST_CPU "skylake-avx512" CACHE STRING "The Host CPU to use with llc" FORCE)
+   endif()
+   endif()
+@@ -1210,7 +1210,7 @@ if(ENABLE_HOST_CPU_DEVICES)
+   # TODO OCL_KERNEL_TARGET -> CPU_TARGET_TRIPLE
+   # TODO OCL_KERNEL_TARGET_CPU -> OCL_KERNEL_TARGET_CPU
+   set(OCL_KERNEL_TARGET "${LLC_TRIPLE}") #The kernel target triplet.
+-  set(OCL_KERNEL_TARGET_CPU "${LLC_HOST_CPU}") #The kernel target CPU variant.
++  set(OCL_KERNEL_TARGET_CPU "${_LLC_HOST_CPU}") #The kernel target CPU variant.
+   set(BUILD_BASIC 1)
+   set(BUILD_PTHREAD 1)
+ endif()
+@@ -1806,6 +1806,7 @@ if (ENABLE_LLVM)
+   MESSAGE(STATUS "LLC_TRIPLE: ${LLC_TRIPLE}")
+   MESSAGE(STATUS "LLC_HOST_CPU_AUTO: ${LLC_HOST_CPU_AUTO}")
+   MESSAGE(STATUS "LLC_HOST_CPU: ${LLC_HOST_CPU}")
++  MESSAGE(STATUS "_LLC_HOST_CPU: ${_LLC_HOST_CPU}")
+   MESSAGE(STATUS "HOST_CPU_FORCED: ${HOST_CPU_FORCED}")
+   endif()
+ endif()
+diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
+index e4f61b41..a67363d1 100644
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -695,9 +695,10 @@ endif()
+ if((DEFINED LLC_HOST_CPU) AND (NOT LLC_HOST_CPU STREQUAL LLC_HOST_CPU_AUTO))
+   message(STATUS "Autodetected CPU ${LLC_HOST_CPU_AUTO} overriden by user to ${LLC_HOST_CPU}")
++  set(_LLC_HOST_CPU "${LLC_HOST_CPU}")
+   set(HOST_CPU_FORCED 1 CACHE INTERNAL "CPU is forced by user")
+ else()
+-  set(LLC_HOST_CPU "${LLC_HOST_CPU_AUTO}" CACHE STRING "The Host CPU to use with llc")
++  set(_LLC_HOST_CPU "${LLC_HOST_CPU_AUTO}")
+   set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
+ endif()
+@@ -705,11 +706,11 @@ endif()
+ # Some architectures have -march and -mcpu reversed
+ if(NOT DEFINED CLANG_MARCH_FLAG)
+   message(STATUS "Checking clang -march vs. -mcpu flag")
+-  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU})
++  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${_LLC_HOST_CPU})
+   if(NOT RES)
+     set(CLANG_MARCH_FLAG "-march=")
+   else()
+-    custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU})
++    custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${_LLC_HOST_CPU})
+     if(NOT RES)
+       set(CLANG_MARCH_FLAG "-mcpu=")
+     else()
+@@ -781,7 +782,7 @@ endif()
+ if(ENABLE_HOST_CPU_DEVICES AND NOT DEFINED ${CL_DISABLE_HALF})
+   set(CL_DISABLE_HALF 0)
+   message(STATUS "Checking fp16 support")
+-  custom_try_compile_clang_silent("__fp16 callfp16(__fp16 a) { return a * (__fp16)1.8; };" "__fp16 x=callfp16((__fp16)argc);" RESV ${CLANG_TARGET_OPTION}${LLC_TRIPLE} ${CLANG_MARCH_FLAG}${LLC_HOST_CPU})
++  custom_try_compile_clang_silent("__fp16 callfp16(__fp16 a) { return a * (__fp16)1.8; };" "__fp16 x=callfp16((__fp16)argc);" RESV ${CLANG_TARGET_OPTION}${LLC_TRIPLE} ${CLANG_MARCH_FLAG}${_LLC_HOST_CPU})
+   if(RESV)
+     set(CL_DISABLE_HALF 1)
+   endif()
+diff --git a/lib/kernel/host/CMakeLists.txt b/lib/kernel/host/CMakeLists.txt
+index ffb21428..2431c370 100644
+--- a/lib/kernel/host/CMakeLists.txt
++++ b/lib/kernel/host/CMakeLists.txt
+@@ -469,7 +469,7 @@ endfunction()
+ foreach(CPU_VARIANT IN LISTS KERNELLIB_HOST_CPU_VARIANTS)
+ if(CPU_VARIANT MATCHES "native")
+-  set(VARIANT "${LLC_HOST_CPU}")
++  set(VARIANT "${_LLC_HOST_CPU}")
+ else()
+   set(VARIANT "${CPU_VARIANT}")
+ endif()
+diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt
+index de7ffd0e..9fec67f8 100644
+--- a/tests/regression/CMakeLists.txt
++++ b/tests/regression/CMakeLists.txt
+@@ -94,7 +94,7 @@ if(LLVM_VERSION_MAJOR GREATER 9 AND LLVM_VERSION_MAJOR LESS 13)
+   # (sporadically?) segfaults on AMD CPUs
+   # in distro builds, we don't know whether we target a failing or a
+   # passing CPU during the tests
+-  if(X86_64 AND (KERNELLIB_HOST_DISTRO_VARIANTS OR LLC_HOST_CPU MATCHES "^znver.*"))
++  if(X86_64 AND (KERNELLIB_HOST_DISTRO_VARIANTS OR _LLC_HOST_CPU MATCHES "^znver.*"))
+     set_tests_properties("regression/test_llvm_segfault_issue_889" PROPERTIES DISABLED 1)
+   endif()
+ endif()
+-- 
+2.20.1
+
diff --git a/patches/1016-let-LLC_HOST_CPU-be-forced-HOST_CPU_FORCED-to-any-cp.patch b/patches/1016-let-LLC_HOST_CPU-be-forced-HOST_CPU_FORCED-to-any-cp.patch
new file mode 100644 (file)
index 0000000..572d1c1
--- /dev/null
@@ -0,0 +1,31 @@
+From c96e3b9e71dd8fb266b063b530859d1a93a09f6c Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 11:39:30 +0100
+Subject: [PATCH 1016/1017] let LLC_HOST_CPU be forced (HOST_CPU_FORCED) to any
+ cpu type
+
+do not special case LLC_HOST_CPU == LLC_HOST_CPU_AUTO
+---
+ cmake/LLVM.cmake | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
+index a67363d1..2b8b37cb 100644
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -693,8 +693,10 @@ else()
+   set(LLC_HOST_CPU_AUTO "${LLC_HOST_CPU_AUTO}" CACHE INTERNAL "Autodetected CPU")
+ endif()
+-if((DEFINED LLC_HOST_CPU) AND (NOT LLC_HOST_CPU STREQUAL LLC_HOST_CPU_AUTO))
+-  message(STATUS "Autodetected CPU ${LLC_HOST_CPU_AUTO} overriden by user to ${LLC_HOST_CPU}")
++if(DEFINED LLC_HOST_CPU)
++  if(NOT LLC_HOST_CPU STREQUAL LLC_HOST_CPU_AUTO)
++    message(STATUS "Autodetected CPU ${LLC_HOST_CPU_AUTO} overridden by user to ${LLC_HOST_CPU}")
++  endif()
+   set(_LLC_HOST_CPU "${LLC_HOST_CPU}")
+   set(HOST_CPU_FORCED 1 CACHE INTERNAL "CPU is forced by user")
+ else()
+-- 
+2.20.1
+
diff --git a/patches/1017-support-overriding-the-runtime-cpu-detection-with-PO.patch b/patches/1017-support-overriding-the-runtime-cpu-detection-with-PO.patch
new file mode 100644 (file)
index 0000000..47a0e8f
--- /dev/null
@@ -0,0 +1,36 @@
+From 46e44ab51cf5b105d194bb769c2ff0d48eb21b6f Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Tue, 15 Mar 2022 15:59:08 +0100
+Subject: [PATCH 1017/1017] support overriding the runtime cpu detection with
+ POCL_LLVM_CPU_NAME
+
+---
+ lib/CL/pocl_llvm_utils.cc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc
+index 018bbb37..6ab57924 100644
+--- a/lib/CL/pocl_llvm_utils.cc
++++ b/lib/CL/pocl_llvm_utils.cc
+@@ -122,7 +122,8 @@ static int getModuleTriple(const char *input_stream, size_t size,
+ }
+ char *pocl_get_llvm_cpu_name() {
+-  StringRef r = llvm::sys::getHostCPUName();
++  const char *custom = pocl_get_string_option("POCL_LLVM_CPU_NAME", NULL);
++  StringRef r = custom ? StringRef(custom) : llvm::sys::getHostCPUName();
+   // LLVM may return an empty string -- treat as generic
+   if (r.empty())
+@@ -132,7 +133,7 @@ char *pocl_get_llvm_cpu_name() {
+   if (r.str() == "generic" && strlen(OCL_KERNEL_TARGET_CPU)) {
+     POCL_MSG_WARN("LLVM does not recognize your cpu, trying to use "
+                    OCL_KERNEL_TARGET_CPU " for -target-cpu\n");
+-    r = llvm::StringRef(OCL_KERNEL_TARGET_CPU);
++    r = StringRef(OCL_KERNEL_TARGET_CPU);
+   }
+ #endif
+-- 
+2.20.1
+
diff --git a/patches/1018-drop-unused-POCL_ATOMIC_CAS.patch b/patches/1018-drop-unused-POCL_ATOMIC_CAS.patch
new file mode 100644 (file)
index 0000000..c1c8c1e
--- /dev/null
@@ -0,0 +1,31 @@
+From 98d848b03d082401d37ece778652b9f78a511e33 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Mon, 27 Jun 2022 13:49:53 +0200
+Subject: [PATCH 1/3] drop unused POCL_ATOMIC_CAS
+
+---
+ lib/CL/pocl_cl.h | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
+index 461009b0..0d8ce769 100644
+--- a/lib/CL/pocl_cl.h
++++ b/lib/CL/pocl_cl.h
+@@ -80,14 +80,10 @@ typedef pthread_t pocl_thread_t;
+ /* See: https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html */
+ #define POCL_ATOMIC_INC(x) __sync_add_and_fetch (&x, 1)
+ #define POCL_ATOMIC_DEC(x) __sync_sub_and_fetch (&x, 1)
+-#define POCL_ATOMIC_CAS(ptr, oldval, newval)                                  \
+-  __sync_val_compare_and_swap (ptr, oldval, newval)
+ #elif defined(_WIN32)
+ #define POCL_ATOMIC_INC(x) InterlockedIncrement64 (&x)
+ #define POCL_ATOMIC_DEC(x) InterlockedDecrement64 (&x)
+-#define POCL_ATOMIC_CAS(ptr, oldval, newval)                                  \
+-  InterlockedCompareExchange64 (ptr, newval, oldval)
+ #else
+ #error Need atomic_inc() builtin for this compiler
+ #endif
+-- 
+2.20.1
+
diff --git a/patches/1019-switch-from-__sync_add_and_fetch-to-__atomic_add_fet.patch b/patches/1019-switch-from-__sync_add_and_fetch-to-__atomic_add_fet.patch
new file mode 100644 (file)
index 0000000..c742a7d
--- /dev/null
@@ -0,0 +1,29 @@
+From 84bb6978ff4bdb298b109004d927e80a5dabf04a Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Mon, 27 Jun 2022 13:55:15 +0200
+Subject: [PATCH 2/3] switch from __sync_add_and_fetch to __atomic_add_fetch
+
+---
+ lib/CL/pocl_cl.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h
+index 0d8ce769..20119b51 100644
+--- a/lib/CL/pocl_cl.h
++++ b/lib/CL/pocl_cl.h
+@@ -77,9 +77,9 @@ typedef pthread_t pocl_thread_t;
+ #if defined(__GNUC__) || defined(__clang__)
+ /* These return the new value. */
+-/* See: https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html */
+-#define POCL_ATOMIC_INC(x) __sync_add_and_fetch (&x, 1)
+-#define POCL_ATOMIC_DEC(x) __sync_sub_and_fetch (&x, 1)
++/* See: https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gcc/_005f_005fatomic-Builtins.html */
++#define POCL_ATOMIC_INC(x) __atomic_add_fetch (&x, 1, __ATOMIC_SEQ_CST)
++#define POCL_ATOMIC_DEC(x) __atomic_sub_fetch (&x, 1, __ATOMIC_SEQ_CST)
+ #elif defined(_WIN32)
+ #define POCL_ATOMIC_INC(x) InterlockedIncrement64 (&x)
+-- 
+2.20.1
+
diff --git a/patches/1020-check-whether-64bit-atomics-require-latomic.patch b/patches/1020-check-whether-64bit-atomics-require-latomic.patch
new file mode 100644 (file)
index 0000000..813b005
--- /dev/null
@@ -0,0 +1,70 @@
+From a22d8c2321f42c3ad7235b60800895bae26d9566 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Mon, 27 Jun 2022 14:04:28 +0200
+Subject: [PATCH 3/3] check whether 64bit atomics require -latomic
+
+---
+ CMakeLists.txt        | 31 +++++++++++++++++++++++++++++++
+ lib/CL/CMakeLists.txt |  4 ++++
+ 2 files changed, 35 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 96ace837..0d71ea02 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -646,6 +646,37 @@ endif()
+ ######################################################################################
++function(check_64bit_atomics varname)
++    check_c_source_compiles("
++#include <stdint.h>
++uint64_t x = 0;
++int main()
++{
++  __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST);
++  __atomic_sub_fetch(&x, 1, __ATOMIC_SEQ_CST);
++  return x;
++}
++" ${varname})
++endfunction(check_64bit_atomics)
++
++# platforms w/o lockfree 64bit atomics need to link with -latomic
++if(UNIX)
++    check_64bit_atomics(HAVE_64BIT_ATOMICS_WITHOUT_LIB)
++    if(HAVE_64BIT_ATOMICS_WITHOUT_LIB)
++        set(HAVE_64BIT_ATOMICS_WITH_LIB FALSE)
++    else()
++        set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
++        list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
++        check_64bit_atomics(HAVE_64BIT_ATOMICS_WITH_LIB)
++        set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
++        if(NOT HAVE_64BIT_ATOMICS_WITH_LIB)
++            message(SEND_ERROR "Missing 64-bit atomic increment")
++        endif()
++    endif()
++endif()
++
++######################################################################################
++
+ if(UNIX AND ENABLE_LLVM AND HAVE_DLADDR)
+     option(ENABLE_RELOCATION "make libpocl relocatable" ON)
+ else()
+diff --git a/lib/CL/CMakeLists.txt b/lib/CL/CMakeLists.txt
+index 342cdac4..ed573409 100644
+--- a/lib/CL/CMakeLists.txt
++++ b/lib/CL/CMakeLists.txt
+@@ -242,6 +242,10 @@ if(HAVE_CLOCK_GETTIME AND CMAKE_SYSTEM_NAME MATCHES "Linux")
+   list(APPEND POCL_PRIVATE_LINK_LIST "rt")
+ endif()
++if(HAVE_64BIT_ATOMICS_WITH_LIB)
++  list(APPEND POCL_PRIVATE_LINK_LIST "atomic")
++endif()
++
+ list(APPEND POCL_PRIVATE_LINK_LIST ${LIBMATH} ${CMAKE_DL_LIBS} ${PTHREAD_LIBRARY})
+ # see lib/CMakeLists.txt
+-- 
+2.20.1
+
diff --git a/patches/2002-link-against-single-shared-libclang-cpp-when-buildin.patch b/patches/2002-link-against-single-shared-libclang-cpp-when-buildin.patch
new file mode 100644 (file)
index 0000000..cef1ecd
--- /dev/null
@@ -0,0 +1,37 @@
+From 4c98e36ab636dd799772e3c8a2d9ddaaebaf64e2 Mon Sep 17 00:00:00 2001
+From: Andreas Beckmann <anbe@debian.org>
+Date: Wed, 8 Apr 2020 01:33:12 +0200
+Subject: [PATCH 02/10] link against single shared libclang-cpp when building
+ with llvm 9, too
+
+---
+ cmake/LLVM.cmake | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
+index 51b051c2..cc66096d 100644
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -243,8 +243,8 @@ string(STRIP "${LLVM_SYSLIBS}" LLVM_SYSLIBS)
+ ####################################################################
+ # llvm-config does not include clang libs
+-if((9 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
+-  # For Clang 10+, link against a single shared library instead of multiple component shared
++if((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
++  # For Clang 9+, link against a single shared library instead of multiple component shared
+   # libraries.
+   if("${LLVM_LIBNAMES}" MATCHES "LLVMTCE")
+     set(CLANG_LIBNAMES clangTCE-cpp)
+@@ -261,7 +261,7 @@ endif()
+ foreach(LIBNAME ${CLANG_LIBNAMES})
+   find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}")
+   list(APPEND CLANG_LIBFILES "${C_LIBFILE_${LIBNAME}}")
+-  if(UNIX AND (NOT APPLE))
++  if(UNIX AND (NOT APPLE) AND (NOT ((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))))
+     set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,--exclude-libs,lib${LIBNAME}")
+   endif()
+ endforeach()
+-- 
+2.20.1
+
diff --git a/patches/blhc.patch b/patches/blhc.patch
new file mode 100644 (file)
index 0000000..9be92cf
--- /dev/null
@@ -0,0 +1,52 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: drop redundant pie flags to make blhc happy
+ pie is enabled by default on Debian
+Forwarded: not-needed
+
+--- a/cmake/Hardening.cmake
++++ b/cmake/Hardening.cmake
+@@ -53,13 +53,13 @@ function(processFlagsList target propert
+ endfunction(processFlagsList)
+ function(setupPIC target)
+-      set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON) # bad, doesn't work
++      #set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON) # bad, doesn't work
+       if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+               get_target_property(type ${target} TYPE)
+               if(type STREQUAL "EXECUTABLE")
+-                      list(APPEND HARDENING_PIC_COMPILE_FLAGS
+-                              "-fPIE"
+-                      )
++                      #list(APPEND HARDENING_PIC_COMPILE_FLAGS
++                      #       "-fPIE"
++                      #)
+               else()
+                       list(APPEND HARDENING_PIC_COMPILE_FLAGS
+                               "-fPIC"
+@@ -67,9 +67,9 @@ function(setupPIC target)
+               endif()
+               if(type STREQUAL "EXECUTABLE")
+                       # https://mropert.github.io/2018/02/02/pic_pie_sanitizers/
+-                      list(APPEND HARDENING_PIC_LINKER_FLAGS
+-                              "-Wl,-pie"
+-                      )
++                      #list(APPEND HARDENING_PIC_LINKER_FLAGS
++                      #       "-Wl,-pie"
++                      #)
+                       if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+                               message(STATUS "Working around Clang bug https://bugs.llvm.org/show_bug.cgi?id=44594 ...")
+                               list(APPEND HARDENING_PIC_LINKER_FLAGS
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -83,9 +83,9 @@ set(VERSION_STRING ${MAJOR_VERSION}.${MI
+ set(POCL_VERSION_BASE ${VERSION_STRING})
+ # required b/c SHARED libs defaults to ON while OBJECT defaults to OFF
+-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
++#set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ # CMake doesn't add "-pie" by default for executables (CMake issue #14983)
+-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
++#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+ enable_testing()
diff --git a/patches/distro.patch b/patches/distro.patch
new file mode 100644 (file)
index 0000000..b591a0f
--- /dev/null
@@ -0,0 +1,39 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: tune distro mode
+Forwarded: not-needed
+
+--- a/lib/kernel/host/CMakeLists.txt
++++ b/lib/kernel/host/CMakeLists.txt
+@@ -323,8 +323,8 @@ separate_arguments(DEVICE_C_FLAGS)
+ function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS)
+   if("${VARIANT}" STREQUAL "sse2")
+-    set(CLANG_F "${CLANG_MARCH_FLAG}athlon64")
+-    set(LLC_F "-mcpu=athlon64")
++    set(CLANG_F "${CLANG_MARCH_FLAG}x86-64")
++    set(LLC_F "-mcpu=x86-64")
+   elseif("${VARIANT}" STREQUAL "ssse3")
+     set(CLANG_F "${CLANG_MARCH_FLAG}core2")
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1171,6 +1171,9 @@ endif()
+ set(KERNELLIB_HOST_DISTRO_VARIANTS 0)
+ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
++  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
++    set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user")
++  endif()
+   if(HOST_CPU_FORCED)
+     message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one")
+   endif()
+@@ -1183,6 +1186,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL
+   else()
+     message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.")
+   endif()
++  if("${LLC_HOST_CPU}" STREQUAL "GENERIC")
++    list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU})
++  endif()
+   set(KERNELLIB_HOST_DISTRO_VARIANTS 1)
+ endif()
diff --git a/patches/fix-opencl.hpp-detection.patch b/patches/fix-opencl.hpp-detection.patch
new file mode 100644 (file)
index 0000000..60a41de
--- /dev/null
@@ -0,0 +1,40 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix opencl.hpp detection
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -979,15 +979,23 @@ endif()
+ # if ICD is disabled, we might as well compile with our own headers
+ if(OPENCL_H AND ENABLE_ICD)
+-  message(STATUS "OpenCL.h found (${OPENCL_H}) and ICD enabled, NOT installing our headers")
++  message(STATUS "opencl.h found (${OPENCL_H}) and ICD enabled, NOT installing our headers")
+   set(HAVE_OPENCL_H ON)
+   set(IOH OFF)
+ else()
+-  message(STATUS "OpenCL.h not found or ICD disabled, installing our headers")
++  message(STATUS "opencl.h not found or ICD disabled, installing our headers")
+   set(HAVE_OPENCL_H OFF)
+   set(IOH ON)
+ endif()
++if(OPENCL_HPP)
++  message(STATUS "opencl.hpp found (${OPENCL_HPP})")
++  set(HAVE_OPENCL_HPP ON)
++else()
++  message(STATUS "opencl.hpp not found")
++  set(HAVE_OPENCL_HPP OFF)
++endif()
++
+ if(NOT DEFINED INSTALL_OPENCL_HEADERS)
+   option(INSTALL_OPENCL_HEADERS "Install POCL's OpenCL headers. (Ones from Khronos should be installed instead)" ${IOH})
+ endif()
+@@ -1026,7 +1034,7 @@ macro(set_opencl_header_includes)
+   if(NOT HAVE_OPENCL_H)
+     include_directories("${CMAKE_SOURCE_DIR}/include")
+   endif()
+-  if(NOT OPENCL_CL2_HPP)
++  if(NOT HAVE_OPENCL_HPP)
+     include_directories("${CMAKE_SOURCE_DIR}/include/hpp")
+   endif()
+   include_directories("${CMAKE_SOURCE_DIR}/poclu")
diff --git a/patches/generic-cpu.patch b/patches/generic-cpu.patch
new file mode 100644 (file)
index 0000000..c3ea856
--- /dev/null
@@ -0,0 +1,72 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: add support for a GENERIC cpu type that uses llvm defaults
+Forwarded: not-needed
+
+--- a/lib/kernel/host/CMakeLists.txt
++++ b/lib/kernel/host/CMakeLists.txt
+@@ -481,6 +481,11 @@ else()
+   set(LLC_CPUFLAGS "-mcpu=${VARIANT}")
+ endif()
++if("${VARIANT}" STREQUAL "GENERIC")
++  set(CLANG_CPUFLAGS "")
++  set(LLC_CPUFLAGS "")
++endif()
++
+ separate_arguments(CLANG_CPUFLAGS)
+ separate_arguments(LLC_CPUFLAGS)
+ set(CLANG_FLAGS ${HOST_CLANG_FLAGS} ${CLANG_CPUFLAGS}
+--- a/lib/CL/devices/common.c
++++ b/lib/CL/devices/common.c
+@@ -1595,6 +1595,9 @@ pocl_init_default_device_infos (cl_devic
+   dev->llvm_cpu = pocl_get_llvm_cpu_name ();
+ #endif
++  if(dev->llvm_cpu && (!strcmp(dev->llvm_cpu, "GENERIC")))
++    dev->llvm_cpu = NULL;
++
+ #else /* No compiler, no CPU info */
+   dev->kernellib_name = NULL;
+   dev->llvm_cpu = NULL;
+--- a/lib/CL/pocl_llvm_build.cc
++++ b/lib/CL/pocl_llvm_build.cc
+@@ -941,8 +941,7 @@ static llvm::Module *getKernelLibrary(cl
+     kernellib_fallback = kernellib;
+     kernellib_fallback += OCL_KERNEL_TARGET_CPU;
+     kernellib_fallback += ".bc";
+-    if (device->llvm_cpu)
+-      kernellib += device->llvm_cpu;
++    kernellib += device->llvm_cpu ? device->llvm_cpu : "GENERIC";
+ #endif
+   }
+   kernellib += ".bc";
+--- a/cmake/LLVM.cmake
++++ b/cmake/LLVM.cmake
+@@ -708,17 +708,26 @@ endif()
+ # Some architectures have -march and -mcpu reversed
+ if(NOT DEFINED CLANG_MARCH_FLAG)
+   message(STATUS "Checking clang -march vs. -mcpu flag")
+-  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${_LLC_HOST_CPU})
++ if(LLC_HOST_CPU STREQUAL "GENERIC" AND NOT KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
++  set(CLANG_MARCH_FLAG "-None=")
++ else()
++  set(LLC_HOST_CPU_TEST "${_LLC_HOST_CPU}")
++  if(LLC_HOST_CPU STREQUAL "GENERIC")
++    set(LLC_HOST_CPU_TEST "${LLC_HOST_CPU_AUTO}")
++  endif()
++  custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU_TEST})
+   if(NOT RES)
+     set(CLANG_MARCH_FLAG "-march=")
+   else()
+     custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${_LLC_HOST_CPU})
++    custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU_TEST})
+     if(NOT RES)
+       set(CLANG_MARCH_FLAG "-mcpu=")
+     else()
+       message(FATAL_ERROR "Could not determine whether to use -march or -mcpu with clang")
+     endif()
+   endif()
++ endif()
+   message(STATUS "  Using ${CLANG_MARCH_FLAG}")
+   set(CLANG_MARCH_FLAG ${CLANG_MARCH_FLAG} CACHE INTERNAL "Clang option used to specify the target cpu")
diff --git a/patches/no-rc.patch b/patches/no-rc.patch
new file mode 100644 (file)
index 0000000..a2997f7
--- /dev/null
@@ -0,0 +1,15 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: this is not a release candidate
+Forwarded: not-needed
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -77,7 +77,7 @@ endif()
+ set(MAJOR_VERSION 3)
+ set(MINOR_VERSION 0)
+-set(VERSION_SUFFIX_FIXED_TEXT "-rc2")
++set(VERSION_SUFFIX_FIXED_TEXT "+debian")
+ set(VERSION_SUFFIX "${VERSION_SUFFIX_FIXED_TEXT}")
+ set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_SUFFIX})
+ set(POCL_VERSION_BASE ${VERSION_STRING})
diff --git a/patches/series b/patches/series
new file mode 100644 (file)
index 0000000..89117d8
--- /dev/null
@@ -0,0 +1,29 @@
+1001-poclcc-use-poclu_show_program_build_log.patch
+1002-check-CMAKE_LIBRARY_ARCHITECTURE-instead-of-CMAKE_SY.patch
+1003-llc-version-no-longer-exits-with-a-non-zero-return-c.patch
+1004-try-to-apply-the-LLVM-style-first.patch
+1005-no-using-namespace-in-headers.patch
+1006-always-use-runtime-determined-llvm_cpu-to-compute-bu.patch
+1007-force-kernellib-name-on-HOST_CPU_FORCED-too.patch
+1008-use-a-UTC-timestamp-for-POCL_BUILD_TIMESTAMP.patch
+1009-rename-getX86KernelLibName-to-pocl_get_distro_kernel.patch
+1010-use-a-more-generic-solution-for-pocl_get_distro_kern.patch
+1011-add-pocl_get_distro_cpu_name.patch
+1012-_cl_device_id-add-const-char-kernellib_name.patch
+1013-allow-overriding-kernellib_name-for-distro-builds-wi.patch
+1014-improve-grouping-of-ENABLE_HOST_CPU_DEVICES-specific.patch
+1015-use-_LLC_HOST_CPU-as-internal-variable.patch
+1016-let-LLC_HOST_CPU-be-forced-HOST_CPU_FORCED-to-any-cp.patch
+1017-support-overriding-the-runtime-cpu-detection-with-PO.patch
+1018-drop-unused-POCL_ATOMIC_CAS.patch
+1019-switch-from-__sync_add_and_fetch-to-__atomic_add_fet.patch
+1020-check-whether-64bit-atomics-require-latomic.patch
+
+2002-link-against-single-shared-libclang-cpp-when-buildin.patch
+test_structs_as_args.patch
+generic-cpu.patch
+distro.patch
+timeout.patch
+no-rc.patch
+fix-opencl.hpp-detection.patch
+blhc.patch
diff --git a/patches/test_structs_as_args.patch b/patches/test_structs_as_args.patch
new file mode 100644 (file)
index 0000000..14ee850
--- /dev/null
@@ -0,0 +1,76 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: HACK! regression/struct_kernel_arguments fails on i686
+ 141/143 Test  #85: regression/struct_kernel_arguments ..................................................***Failed  Error regular expression found in output. Regex=[FAIL]  4.58 sec
+ CMake Error at /build/pocl-1.4/cmake/run_test.cmake:34 (message):
+  FAIL: Test exited with nonzero code (1):
+  /build/pocl-1.4/obj-i686-linux-gnu/tests/regression/test_structs_as_args
+
+  STDOUT:
+
+  F(4: 0 != 5) F(5: -2147483648 != 6) F(6: 0 != 7) F(7: 0 != 8)
+
+  STDERR:
+
+
+
+ -- OK
+Bug: https://github.com/pocl/pocl/issues/801
+Bug: https://github.com/KhronosGroup/OpenCL-Headers/issues/149
+Forwarded: not-needed
+
+--- a/tests/regression/test_structs_as_args.cpp
++++ b/tests/regression/test_structs_as_args.cpp
+@@ -54,21 +54,33 @@ struct int_pair {
+     cl_long b;\r
+ };\r
\r
++// i386 has a default alignment of 4 even for 64-bit types\r
++#ifdef __i386__\r
++#define CL_LONG_ALIGNMENT __attribute__((aligned(8)))\r
++#define CL_DOUBLE_ALIGNMENT __attribute__((aligned(8)))\r
++#else\r
++#define CL_LONG_ALIGNMENT\r
++#define CL_DOUBLE_ALIGNMENT\r
++#endif\r
++\r
+ struct test_struct {\r
+     cl_int elementA;\r
+     cl_int elementB;\r
+-    cl_long elementC;\r
++    cl_long elementC CL_LONG_ALIGNMENT;\r
+     cl_char elementD;\r
+-    cl_long elementE;\r
++    cl_long elementE CL_LONG_ALIGNMENT;\r
+     cl_float elementF;\r
+     cl_short elementG;\r
+ #ifdef _CL_DISABLE_DOUBLE\r
+-    cl_long elementH;\r
++    cl_long elementH CL_LONG_ALIGNMENT;\r
+ #else\r
+-    cl_double elementH;\r
++    cl_double elementH CL_DOUBLE_ALIGNMENT;\r
+ #endif\r
+ };\r
\r
++#undef CL_LONG_ALIGNMENT\r
++#undef CL_DOUBLE_ALIGNMENT\r
++\r
+ static char\r
+ kernelSourceCode[] = \r
+ "typedef struct int_single {\n"\r
+--- a/tests/regression/CMakeLists.txt
++++ b/tests/regression/CMakeLists.txt
+@@ -272,6 +272,13 @@ add_test_pocl(NAME "regression/autolocal
+ add_test_pocl(NAME "regression/struct_kernel_arguments" COMMAND "test_structs_as_args")
++if(0)
++if(LLC_HOST_CPU STREQUAL "i686")
++  set_tests_properties("regression/struct_kernel_arguments"
++    PROPERTIES WILL_FAIL 1)
++endif()
++endif()
++
+ add_test_pocl(NAME "regression/vector_kernel_arguments" COMMAND "test_vectors_as_args")
+ set(TCE_TESTS "regression/barrier_between_two_for_loops_LOOPS"
diff --git a/patches/timeout.patch b/patches/timeout.patch
new file mode 100644 (file)
index 0000000..dedc879
--- /dev/null
@@ -0,0 +1,14 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: kill hanging tests after 30 minutes
+
+--- a/cmake/run_test.cmake
++++ b/cmake/run_test.cmake
+@@ -12,7 +12,7 @@ endif()
+ string(REPLACE "####" ";" test_cmd_separated "${test_cmd}")
+ execute_process(
+-  COMMAND ${test_cmd_separated}
++  COMMAND timeout -k 60 1800 ${test_cmd_separated}
+   RESULT_VARIABLE test_not_successful
+   OUTPUT_VARIABLE stdout
+   ERROR_VARIABLE stderr
diff --git a/pocl-doc.doc-base b/pocl-doc.doc-base
new file mode 100644 (file)
index 0000000..d4c905b
--- /dev/null
@@ -0,0 +1,8 @@
+Document: pocl-doc
+Title: Documentation for the pocl library
+Author: The pocl developers
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/pocl-doc/html/index.html
+Files: /usr/share/doc/pocl-doc/html/*.html
diff --git a/pocl-doc.docs b/pocl-doc.docs
new file mode 100644 (file)
index 0000000..7a69846
--- /dev/null
@@ -0,0 +1 @@
+build-doc/html
diff --git a/pocl-opencl-icd.docs b/pocl-opencl-icd.docs
new file mode 100644 (file)
index 0000000..724e084
--- /dev/null
@@ -0,0 +1,2 @@
+README
+TODO
diff --git a/pocl-opencl-icd.install b/pocl-opencl-icd.install
new file mode 100644 (file)
index 0000000..6549149
--- /dev/null
@@ -0,0 +1 @@
+etc/OpenCL/vendors/pocl.icd
diff --git a/pocl-opencl-icd.lintian-overrides b/pocl-opencl-icd.lintian-overrides
new file mode 100644 (file)
index 0000000..aca7cad
--- /dev/null
@@ -0,0 +1,2 @@
+# This is kind of a metapackage.
+package-contains-no-arch-dependent-files
diff --git a/pocl-source.install b/pocl-source.install
new file mode 100644 (file)
index 0000000..61d8db4
--- /dev/null
@@ -0,0 +1 @@
+build-source/pocl.tar.* usr/src
diff --git a/pocl-tests.install b/pocl-tests.install
new file mode 100644 (file)
index 0000000..7aed27a
--- /dev/null
@@ -0,0 +1,2 @@
+examples       usr/share/pocl-tests/
+tests          usr/share/pocl-tests/
diff --git a/pocl-tests.lintian-overrides b/pocl-tests.lintian-overrides
new file mode 100644 (file)
index 0000000..beebd9a
--- /dev/null
@@ -0,0 +1,3 @@
+script-not-executable [usr/share/pocl-tests/examples/*.sh]
+package-contains-documentation-outside-usr-share-doc [usr/share/pocl-tests/*/README]
+package-contains-documentation-outside-usr-share-doc [usr/share/pocl-tests/*.txt]
diff --git a/rules b/rules
new file mode 100755 (executable)
index 0000000..a7f46e3
--- /dev/null
+++ b/rules
@@ -0,0 +1,142 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
+
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/pkg-info.mk
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+
+LLVM_VERSION                    = $(shell sed -n -r '/^Build/,/^$$/s/.*llvm-([0-9]+)-dev.*/\1/p' debian/control)
+
+LLVM_ARCH-amd64                         = distro
+#LLVM_ARCH-amd64                        = x86-64
+#LLVM_ARCH-arm64                        = generic
+LLVM_ARCH-armel                         = arm946e-s            # arch=armv5te
+# armhf should rather be arch=armv7-a, e.g. cpu=cortex-a5 or similar with attr=+vfp3,+d16,+thumb2,-neon,-vfp4
+LLVM_ARCH-armhf                         = arm1156t2f-s
+LLVM_ARCH-hurd-i386             = $(LLVM_ARCH-i386)
+LLVM_ARCH-i386                  = i686                 # clang targets pentium4 by default
+LLVM_ARCH-kfreebsd-amd64        = $(LLVM_ARCH-amd64)
+LLVM_ARCH-kfreebsd-i386                 = $(LLVM_ARCH-i386)
+#LLVM_ARCH-mips                         = mips32r2 # guess
+#LLVM_ARCH-mips64el             = mips64r2 # guess
+#LLVM_ARCH-mipsel               = mips32r2 # guess
+#LLVM_ARCH-powerpc              = ppc
+#LLVM_ARCH-ppc64                        = ppc64 # guess
+#LLVM_ARCH-ppc64el              = ppc64le
+#LLVM_ARCH-s390x                        = z10
+#LLVM_ARCH-sparc64              = v8 # guess
+LLVM_ARCH-x32                   = $(LLVM_ARCH-amd64)
+
+LLC_HOST_CPU    = $(or $(patsubst pocl_cpu=%,%,$(filter pocl_cpu=%,$(DEB_BUILD_OPTIONS))),$(LLVM_ARCH-$(DEB_HOST_ARCH)),GENERIC)
+
+# NEON, optional for Debian, must not be used
+EXTRA_HOST_CLANG_FLAGS-armhf    = -mfpu=vfp3-d16
+# TODO: export KERNEL_LIB_OPT_FLAGS= -mattr=-neon,+d16,+vfp3,-vfp4,+v7,+aclass,+thumb2
+
+# doc for symbols:
+# http://www.eyrie.org/~eagle/journal/2012-01/008.html
+# main packaging script based on dh7 syntax
+%:
+       dh $@ --with pkgkde_symbolshelper
+
+getval                  = $(or $($1-$(DEB_HOST_ARCH)),$($1))
+var2flag                = $(if $(strip $(call getval,$1)),-D$1="$(call getval,$1)")
+POCL_CONFIGURE_FLAGS    =
+POCL_CONFIGURE_FLAGS   += -DENABLE_ICD=ON
+POCL_CONFIGURE_FLAGS   += -DWITH_LLVM_CONFIG=/usr/bin/llvm-config-$(LLVM_VERSION)
+POCL_CONFIGURE_FLAGS   += $(if $(filter distro,$(LLC_HOST_CPU)),-DLLC_HOST_CPU=GENERIC -DKERNELLIB_HOST_CPU_VARIANTS=distro,-DLLC_HOST_CPU=$(LLC_HOST_CPU))
+POCL_CONFIGURE_FLAGS   += $(call var2flag,EXTRA_HOST_CLANG_FLAGS)
+POCL_CONFIGURE_FLAGS   += -DPOCL_ICD_ABSOLUTE_PATH=OFF
+POCL_CONFIGURE_FLAGS   += -DHARDENING_ENABLE=ON
+POCL_CONFIGURE_FLAGS   += -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF
+ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf))
+POCL_CONFIGURE_FLAGS   += -DPRINTF_BUFFER_SIZE=4096
+endif
+
+execute_before_dh_auto_configure:
+       mkdir -p build-source
+       tar \
+               --owner=0 --group=0 \
+               --transform 's,^,pocl/,' \
+               --exclude=debian \
+               --exclude=build-source \
+               --sort=name \
+               --mtime=@$(SOURCE_DATE_EPOCH) \
+               --clamp-mtime \
+               --mode=u+rw,go+r,go-w,a-s \
+               -cf - * | xz > build-source/pocl.tar.xz
+
+execute_after_dh_auto_clean:
+       $(RM) -r build-source
+
+override_dh_auto_configure:
+       @echo Using LLC_HOST_CPU=$(LLC_HOST_CPU)
+       -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -version
+       -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -mattr=help
+       dh_auto_configure -- $(POCL_CONFIGURE_FLAGS)
+
+override_dh_auto_build-indep:
+ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
+       sphinx-build -N -b html doc/sphinx/source build-doc/html
+endif
+
+override_dh_shlibdeps:
+       dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/pocl -- --warnings=7
+
+override_dh_auto_test-indep:
+override_dh_auto_test-arch:
+       # Failure in testsuite is delayed until symbols handling
+       # and all files are logged.
+       $(RM) debian/stamp-failed-testsuite
+       $(RM) -r debian/kcache
+       @set -ex; for k in $$(sed -r -n '/KERNELLIB_HOST_CPU_VARIANTS/ { s/.*"(.*)".*/\1/; s/;/ /g; p }' obj-$(DEB_HOST_GNU_TYPE)/config.h) ; \
+               do echo TESTING $$k ; \
+               env POCL_KERNELLIB_NAME=$$k \
+               $(MAKE) -f debian/rules run-tests ; \
+       done
+
+run-tests:
+       mkdir debian/kcache
+       env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \
+               OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \
+               POCL_BUILDING=1 POCL_DEVICES=basic clinfo || touch debian/stamp-failed-testsuite
+       env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \
+               OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \
+               POCL_BUILDING=1 clinfo || touch debian/stamp-failed-testsuite
+       @set -ex; if ! env POCL_CACHE_DIR="$(CURDIR)/debian/kcache" dh_auto_test ; then \
+               echo "***** The testsuite has failed! *****" ; \
+               touch debian/stamp-failed-testsuite; \
+       fi
+       $(RM) -r debian/kcache
+
+run_dh_makeshlibs:
+       dh_makeshlibs
+
+delayed_check_dh_auto_test_result: run_dh_makeshlibs
+       @set -ex; if test -f debian/stamp-failed-testsuite ; then \
+               echo "***** The testsuite has failed! *****" ; \
+               exit 1 ; \
+       fi
+       @test -f obj-*/Testing/Temporary/LastTest.log && echo 'The testsuite has passed all tests.' || echo '*** The testsuite was *NOT* run! ***'
+
+override_dh_makeshlibs: run_dh_makeshlibs delayed_check_dh_auto_test_result
+
+override_dh_gencontrol:
+       dh_gencontrol -- \
+               -V'LLVM:Version=$(LLVM_VERSION)' \
+
+
+fix-symbols:
+       pkgkde-getbuildlogs
+       echo "pkgkde-symbolshelper batchpatch -v $(DEB_VERSION_EPOCH_UPSTREAM) pocl_$(DEB_DISTRIBUTION)_logs/pocl_$(DEB_VERSION)_*build"
diff --git a/salsa-ci.yml b/salsa-ci.yml
new file mode 100644 (file)
index 0000000..f4f0be7
--- /dev/null
@@ -0,0 +1,8 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+variables:
+  # build path is hard compiled into the binaries
+  SALSA_CI_REPROTEST_ARGS: --variations=-build_path
diff --git a/source/format b/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/source/lintian-overrides b/source/lintian-overrides
new file mode 100644 (file)
index 0000000..a309ffb
--- /dev/null
@@ -0,0 +1,6 @@
+# the examples directory only contains CMakeFiles for external testsuites
+package-does-not-install-examples [examples/]
+
+# test data
+very-long-line-length-in-source-file * > 512 [examples/*]
+very-long-line-length-in-source-file * > 512 [tests/*]
diff --git a/tests/control b/tests/control
new file mode 100644 (file)
index 0000000..a712608
--- /dev/null
@@ -0,0 +1,7 @@
+Test-Command: env POCL_DEVICES=basic clinfo
+Depends: clinfo, pocl-opencl-icd
+Restrictions: superficial
+
+Test-Command: clinfo
+Depends: clinfo, pocl-opencl-icd
+Restrictions: superficial
diff --git a/upstream/metadata b/upstream/metadata
new file mode 100644 (file)
index 0000000..dcb39aa
--- /dev/null
@@ -0,0 +1,4 @@
+Bug-Database: https://github.com/pocl/pocl/issues
+Bug-Submit: https://github.com/pocl/pocl/issues/new
+Repository: https://github.com/pocl/pocl.git
+Repository-Browse: https://github.com/pocl/pocl
diff --git a/watch b/watch
new file mode 100644 (file)
index 0000000..ec09000
--- /dev/null
+++ b/watch
@@ -0,0 +1,4 @@
+version=4
+opts="uversionmangle=s/-RC(\d*)/~rc$1/, filenamemangle=s/-RC(\d*)/~rc$1/;s%(?:^.*?/)?v?(\d[\d.\~rc]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \
+   https://github.com/pocl/pocl/releases \
+   (?:.*?/)?v?(\d[\d.RC-]*)\.tar\.gz debian uupdate