[pocl] 03/04: work around clang failing to find sys/cdefs.h on !linux

Andreas Beckmann anbe at moszumanska.debian.org
Fri May 27 09:24:45 UTC 2016


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

anbe pushed a commit to branch master
in repository pocl.

commit 805dc15c7bc5114393dcad7776c630268e5cbe3a
Author: Andreas Beckmann <anbe at debian.org>
Date:   Fri May 27 00:51:37 2016 +0000

    work around clang failing to find sys/cdefs.h on !linux
---
 debian/changelog                      |  6 ++++
 debian/patches/find-sys-cdefs-h.patch | 59 +++++++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 debian/rules                          |  1 +
 4 files changed, 67 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index abf0149..daf7fa0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pocl (0.11-5) UNRELEASED; urgency=medium
+
+  * Work around clang failing to find sys/cdefs.h on !linux.
+
+ -- Andreas Beckmann <anbe at falla.debian.org>  Fri, 27 May 2016 00:48:55 +0000
+
 pocl (0.11-4) unstable; urgency=medium
 
   * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'.
diff --git a/debian/patches/find-sys-cdefs-h.patch b/debian/patches/find-sys-cdefs-h.patch
new file mode 100644
index 0000000..4c48cab
--- /dev/null
+++ b/debian/patches/find-sys-cdefs-h.patch
@@ -0,0 +1,59 @@
+Author: Andreas Beckmann <anbe at debian.org>
+Description: work around clang failing to find sys/cdefs.h
+ see #806241 for the clang-3.6 bug
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -709,6 +709,43 @@ else
+ fi
+ AC_MSG_RESULT(${CLANG_TARGET_OPTION}TARGET)
+ 
++HOST_CLANG_CPPFLAGS=
++
++old_CC=$CC
++CC=$CLANG
++old_CFLAGS=$CFLAGS
++old_LDFLAGS=$LDFLAGS
++old_LIBS=$LIBS
++AC_LANG_PUSH([C])
++
++AC_MSG_CHECKING([Clang flags for compiling features.h])
++success=no
++
++for candidate in "" "-I/usr/include/$DEB_HOST_MULTIARCH"
++do
++  CFLAGS="${CLANG_TARGET_OPTION}$host $HOST_CLANG_CPPFLAGS $candidate"
++  AC_COMPILE_IFELSE(
++    [AC_LANG_PROGRAM(
++      [[ #include <features.h> ]],
++      [[ ]]
++    )],
++    [AC_MSG_RESULT(${candidate:-none})
++     HOST_CLANG_CPPFLAGS="$HOST_CLANG_CPPFLAGS $candidate"
++     success=yes
++     break
++    ],[])
++done
++
++if test x$success != xyes ; then
++  AC_MSG_ERROR([Clang cannot compile features.h])
++fi
++
++AC_LANG_POP([C])
++CC=$old_CC
++CFLAGS=$old_CFLAGS
++LDFLAGS=$old_LDFLAGS
++LIBS=$old_LIBS
++
+ # Check for a functioning clang++. It is needed to compile faster math 
+ # builtins from vecmathlib.
+ LLVM_PROG_WARN([CLANGXX], [clang++])
+@@ -844,7 +881,7 @@ else
+ fi
+ AC_MSG_RESULT($LD_SHARED)
+ 
+-HOST_CLANG_FLAGS=""
++HOST_CLANG_FLAGS="$HOST_CLANG_CPPFLAGS"
+ HOST_LLC_FLAGS="-relocation-model=pic"
+ HOST_AS_FLAGS=""
+ HOST_LD_FLAGS="$LD_SHARED"
diff --git a/debian/patches/series b/debian/patches/series
index 9e9dcc2..751fd6c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ llvm-system-libs.patch
 fix-image-args.patch
 typos.patch
 fix-tests-i386.patch
+find-sys-cdefs-h.patch
diff --git a/debian/rules b/debian/rules
index 90ed6d9..6bc1001 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,6 +20,7 @@ LLVM_VERSION=3.6
 # package maintainers to append LDFLAGS
 #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
+export DEB_HOST_MULTIARCH
 DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 LLVM_ARCH=$(shell sed < debian/supported-archs \
 	-e '/^DEB_ARCH: $(DEB_HOST_ARCH)$$/,/^ *$$/p;d' \

-- 
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