[med-svn] [jellyfish1] 11/12: Fix FTBFS with clang (thanks for the patch to Martin Steghöfer)

Andreas Tille tille at debian.org
Tue Nov 17 07:42:31 UTC 2015


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

tille pushed a commit to tag debian/2.1.4-1
in repository jellyfish1.

commit a569eef805898d869e3e98733eeabf143db56c54
Author: Andreas Tille <tille at debian.org>
Date:   Thu Oct 9 13:03:22 2014 +0200

    Fix FTBFS with clang (thanks for the patch to Martin Steghöfer)
---
 debian/changelog                       |  2 ++
 debian/patches/clang-compilation.patch | 56 ++++++++++++++++++++++++++++++++++
 debian/patches/series                  |  1 +
 3 files changed, 59 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d75dcfc..ba6259d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ jellyfish (2.1.4-1) UNRELEASED; urgency=medium
   * Split libjellyfish and libjellyfish-dev packages up from single
     package, add jellyfish-examples package containing test suite
   * Add autopkgtest
+  * Fix FTBFS with clang (thanks for the patch to Martin Steghöfer)
+    Closes: #749136
 
  -- Andreas Tille <tille at debian.org>  Sat, 04 Oct 2014 19:06:43 +0200
 
diff --git a/debian/patches/clang-compilation.patch b/debian/patches/clang-compilation.patch
new file mode 100644
index 0000000..d9bd7f0
--- /dev/null
+++ b/debian/patches/clang-compilation.patch
@@ -0,0 +1,56 @@
+Description: Fix compilation using the "clang" compiler
+ This fixes 2 issues with the clang compilation:
+ 1.) The length of the array defined locally in array::_get_val
+ cannot be detected to be constant by a standard C++ compiler.
+ GCC's g++ accepts the code anyway because of its ample support
+ for variable-length arrays (VLAs). Clang doesn't support VLAs
+ for non-POD (Plain Old Type) types. Starting from version 3.5,
+ however, it is able to detect the constant nature of the value
+ used (using non-standard language features, too) and therefore
+ doesn't need LVAs here. However, clang compilers before 3.5 as
+ well as compilers that support only pure C++ need this patching.
+ 2.) The clang compiler warns about the "register" keyword being
+ deprecated in C++11. As the Jellyfish build system treats
+ warnings as errors, this breaks the build with clang. I suggest
+ to remove the keyword instead of silencing the warning because
+ most modern compilers (e.g. the recent versions of GCC, clang
+ and Visual Studio) ignore the keyword in their optimization
+ algorithms anyway.
+Author: Martin Steghöfer <martin at steghoefer.eu>
+Forwarded: https://github.com/gmarcais/Jellyfish/pull/21
+Bug-Debian: http://bugs.debian.org/749136
+
+--- a/include/jellyfish/large_hash_array.hpp
++++ b/include/jellyfish/large_hash_array.hpp
+@@ -444,7 +444,7 @@
+   bool get_key_id(const key_type& key, size_t* id, key_type& tmp_key, const word** w, const offset_t** o, const size_t oid) const {
+     // This static_assert makes clang++ happy
+     static_assert(std::is_pod<prefetch_info>::value, "prefetch_info must be a POD");
+-    prefetch_info info_ary[prefetch_buffer::capacity()];
++    prefetch_info info_ary[prefetch_buffer::capacityConstant];
+     prefetch_buffer buffer(info_ary);
+     warm_up_cache(buffer, oid);
+ 
+--- a/include/jellyfish/simple_circular_buffer.hpp
++++ b/include/jellyfish/simple_circular_buffer.hpp
+@@ -106,6 +106,7 @@
+     class pre_alloc : public base<T, pre_alloc<T, capa> > {
+       typedef base<T, pre_alloc<T, capa> > super;
+     public:
++      static const int capacityConstant = capa;
+       explicit pre_alloc(T* data) : super(data) { }
+       static int capacity() { return capa; }
+     };
+--- a/include/jellyfish/rectangular_binary_matrix.hpp
++++ b/include/jellyfish/rectangular_binary_matrix.hpp
+@@ -261,8 +261,8 @@
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wuninitialized"
+ #endif
+-    register xmm_t acc  = acc ^ acc; // Set acc to 0
+-    register xmm_t load = load ^ load;
++    xmm_t acc  = acc ^ acc; // Set acc to 0
++    xmm_t load = load ^ load;
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index a640172..a0de765 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 fix_yaggo_syntax.patch
+clang-compilation.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/jellyfish1.git



More information about the debian-med-commit mailing list