[pocl] 09/17: set POCL_DEVICE_ADDRESS_BITS before using it

Andreas Beckmann anbe at moszumanska.debian.org
Sun Nov 26 03:19:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository pocl.

commit 15e49861aac54ad445284659e76215dc0faa81d4
Author: Andreas Beckmann <anbe at debian.org>
Date:   Thu Nov 23 04:10:48 2017 +0100

    set POCL_DEVICE_ADDRESS_BITS before using it
---
 debian/changelog                                   |  2 +
 debian/patches/series                              |  1 +
 .../set-POCL_DEVICE_ADDRESS_BITS-before-use.patch  | 45 ++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3f64dac..36e4a55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ pocl (0.13-10) UNRELEASED; urgency=medium
   * 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.
 
  -- Andreas Beckmann <anbe at debian.org>  Tue, 31 Oct 2017 19:29:32 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index bbab446..0ca7feb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,4 +5,5 @@ typos.patch
 fix-tests-i386.patch
 find-sys-cdefs-h.patch
 glibc-2.23.patch
+set-POCL_DEVICE_ADDRESS_BITS-before-use.patch
 libstdc++-7-dev.patch
diff --git a/debian/patches/set-POCL_DEVICE_ADDRESS_BITS-before-use.patch b/debian/patches/set-POCL_DEVICE_ADDRESS_BITS-before-use.patch
new file mode 100644
index 0000000..caae3d5
--- /dev/null
+++ b/debian/patches/set-POCL_DEVICE_ADDRESS_BITS-before-use.patch
@@ -0,0 +1,45 @@
+Author: Andreas Beckmann <anbe at debian.org>
+Description: set POCL_DEVICE_ADDRESS_BITS before using it
+ otherwise i386 is misdetected as x86_64
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -32,6 +32,18 @@ set(VERSION_SUFFIX "")
+ set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_SUFFIX})
+ set(POCL_VERSION ${VERSION_STRING})
+ 
++##########################################################
++
++# POCL_DEVICE_ADDRESS_BITS
++# TODO rename to HOST addess bits
++if(CMAKE_SIZEOF_VOID_P EQUAL 8)
++  set(POCL_DEVICE_ADDRESS_BITS 64)
++elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
++  set(POCL_DEVICE_ADDRESS_BITS 32)
++else()
++  message(FATAL_ERROR "Cannot figure out POCL_DEVICE_ADDRESS_BITS")
++endif()
++
+ ##################################################################################
+ 
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
+@@ -836,19 +848,6 @@ endif()
+ 
+ ##########################################################
+ 
+-# POCL_DEVICE_ADDRESS_BITS
+-# TODO rename to HOST addess bits
+-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+-  set(POCL_DEVICE_ADDRESS_BITS 64)
+-elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+-  set(POCL_DEVICE_ADDRESS_BITS 32)
+-else()
+-  message(FATAL_ERROR "Cannot figure out POCL_DEVICE_ADDRESS_BITS")
+-endif()
+-
+-
+-##########################################################
+-
+ 
+ # cmake docs:
+ # SOVERSION: What version number is this target.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/pocl.git



More information about the Pkg-opencl-commits mailing list