[3dprinter-general] Bug#877380: tbb: fix __TBB_EXCEPTION_PTR_PRESENT for armel

Adrian Bunk bunk at debian.org
Sun Oct 1 08:12:45 UTC 2017


Source: tbb
Version: 2017~U7-6
Severity: serious
Tags: patch
Control: affects -1 src:slic3r-prusa

The latest slic3r-prusa upload FTBFS on armel:

https://buildd.debian.org/status/logs.php?pkg=slic3r-prusa&arch=armel

...
In file included from /usr/include/tbb/tbb_stddef.h:95:0,
                 from /usr/include/tbb/tbb_machine.h:117,
                 from /usr/include/tbb/atomic.h:32,
                 from /<<BUILDDIR>>/slic3r-prusa-1.37.1+dfsg2/xs/src/slic3r/GUI/../../libslic3r/Print.hpp:19,
                 from /<<BUILDDIR>>/slic3r-prusa-1.37.1+dfsg2/xs/src/slic3r/GUI/3DScene.cpp:9:
/usr/include/tbb/tbb_config.h:450:10: error: #error Current runtime does not support std::exception_ptr. Set TBB_USE_CAPTURED_EXCEPTION and make sure that your code is ready to catch tbb::captured_exception.
         #error Current runtime does not support std::exception_ptr. Set TBB_USE_CAPTURED_EXCEPTION and make sure that your code is ready to catch tbb::captured_exception.
          ^~~~~


This error is no longer correct with gcc >= 7, fix attached.

The severity might seem inflated, but this needs an RC bug
affecting slic3r-prusa somewhere.
-------------- next part --------------
Description: __TBB_EXCEPTION_PTR_PRESENT fix for armel
 exception_ptr in GCC >= 7 no longer requires atomic instructions.
Author: Adrian Bunk <bunk at debian.org>

--- tbb-2017~U7.orig/include/tbb/tbb_config.h
+++ tbb-2017~U7/include/tbb/tbb_config.h
@@ -226,8 +226,9 @@
     #define __TBB_IMPLICIT_MOVE_PRESENT                     (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600)
     /** __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 here is a substitution for _GLIBCXX_ATOMIC_BUILTINS_4, which is a prerequisite
         for exception_ptr but cannot be used in this file because it is defined in a header, not by the compiler.
-        If the compiler has no atomic intrinsics, the C++ library should not expect those as well. **/
-    #define __TBB_EXCEPTION_PTR_PRESENT                     (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40404 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+        GCC >= 7 has exception_ptr even without atomic instructions:
+        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735#c11 **/
+    #define __TBB_EXCEPTION_PTR_PRESENT                     (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40404 && (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 || (__TBB_GCC_VERSION >= 70000)))
     #define __TBB_STATIC_ASSERT_PRESENT                     (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)
     #define __TBB_CPP11_TUPLE_PRESENT                       (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)
     #define __TBB_INITIALIZER_LISTS_PRESENT                 (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)


More information about the 3dprinter-general mailing list