Basically, boost does not like mixing different compilers at build
and run time.

We build boost with gcc-4.2.1, which doesn't support __int128.

$ /usr/local/bin/egcc -dM -E - < /dev/null | grep SIZEOF_INT128
#define __SIZEOF_INT128__ 16
$ /usr/bin/cc -dM -E - < /dev/null | grep SIZEOF_INT128
$

This results in a /usr/local/include/boost/config/user.hpp missing
the "BOOST_HAS_INT128" define.

When building something which depends on boost using a newer compiler
(gcc-4.9, clang), the following happens:

the code snippet from /usr/local/include/boost/config/compiler/{clang,gcc}.hpp

---8<---

#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
#  define BOOST_HAS_INT128
#endif

---8<---

reactivates __int128 support.

But the code into /usr/local/include/boost/config/suffix.hpp:

---8<---

#if defined(BOOST_HAS_INT128) && defined(__cplusplus)
namespace boost{
#  ifdef __GNUC__
   __extension__ typedef __int128 int128_type;
   __extension__ typedef unsigned __int128 uint128_type;
#  else
   typedef __int128 int128_type;
   typedef unsigned __int128 uint128_type;
#  endif
}
#endif

---8<---

is never reached, because /usr/local/include/boost/config/user.hpp
lacks "#define BOOST_HAS_INT128".

And thus the big boom below:

---8<---

In file included from web_connection_base.cpp:44:
In file included from ../include/libtorrent/web_connection_base.hpp:46:
In file included from /usr/local/include/boost/smart_ptr.hpp:28:
In file included from /usr/local/include/boost/make_shared.hpp:15:
In file included from /usr/local/include/boost/smart_ptr/make_shared.hpp:15:
In file included from 
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:18:
In file included from 
/usr/local/include/boost/type_traits/type_with_alignment.hpp:18:
In file included from /usr/local/include/boost/type_traits/is_pod.hpp:14:
In file included from /usr/local/include/boost/type_traits/is_scalar.hpp:12:
In file included from /usr/local/include/boost/type_traits/is_arithmetic.hpp:13:
/usr/local/include/boost/type_traits/is_integral.hpp:72:53: error: no member 
named 'int128_type' in namespace 'boost'
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true)
                                             ~~~~~~~^
/usr/local/include/boost/type_traits/detail/bool_trait_def.hpp:182:41: note: 
expanded from macro 'BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1'
    BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const volatile,value) \
                                        ^~
/usr/local/include/boost/type_traits/detail/bool_trait_def.hpp:97:26: note: 
expanded from macro 'BOOST_TT_AUX_BOOL_TRAIT_SPEC1'
template<> struct trait< sp > \
                         ^~
In file included from web_connection_base.cpp:44:
In file included from ../include/libtorrent/web_connection_base.hpp:46:
In file included from /usr/local/include/boost/smart_ptr.hpp:28:
In file included from /usr/local/include/boost/make_shared.hpp:15:
In file included from /usr/local/include/boost/smart_ptr/make_shared.hpp:15:
In file included from 
/usr/local/include/boost/smart_ptr/make_shared_object.hpp:18:
In file included from 
/usr/local/include/boost/type_traits/type_with_alignment.hpp:18:
In file included from /usr/local/include/boost/type_traits/is_pod.hpp:14:
In file included from /usr/local/include/boost/type_traits/is_scalar.hpp:12:
In file included from /usr/local/include/boost/type_traits/is_arithmetic.hpp:13:
/usr/local/include/boost/type_traits/is_integral.hpp:73:53: error: no member 
named 'uint128_type' in namespace 'boost'
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true)
                                             ~~~~~~~^
/usr/local/include/boost/type_traits/detail/bool_trait_def.hpp:179:41: note: 
expanded from macro 'BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1'
    BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
                                        ^~
/usr/local/include/boost/type_traits/detail/bool_trait_def.hpp:97:26: note: 
expanded from macro 'BOOST_TT_AUX_BOOL_TRAIT_SPEC1'
template<> struct trait< sp > \
                         ^~

---8<---

So, I've chosen to use the lowest common denominator, as per the
following diff:

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
retrieving revision 1.57
diff -u -p -u -p -r1.57 Makefile
--- Makefile    27 May 2016 22:35:40 -0000      1.57
+++ Makefile    31 May 2016 07:41:54 -0000
@@ -5,7 +5,7 @@ ONLY_FOR_ARCHS= ${GCC4_ARCHS}
 COMMENT=       free peer-reviewed portable C++ source libraries
 
 VERSION=       1.58.0
-REVISION=      1
+REVISION=      2
 DISTNAME=      boost_${VERSION:S/./_/g}
 PKGNAME=       boost-${VERSION}
 CATEGORIES=    devel
Index: patches/patch-boost_config_compiler_clang_hpp
===================================================================
RCS file: patches/patch-boost_config_compiler_clang_hpp
diff -N patches/patch-boost_config_compiler_clang_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_config_compiler_clang_hpp       31 May 2016 07:41:54 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- boost/config/compiler/clang.hpp.orig       Tue Mar 24 19:27:48 2015
++++ boost/config/compiler/clang.hpp    Mon May 30 09:10:59 2016
+@@ -60,7 +60,7 @@
+ // Only re-enable this for nvcc if you're absolutely sure
+ // of the circumstances under which it's supported:
+ //
+-#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
++#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) && 
!defined(__OpenBSD__)
+ #  define BOOST_HAS_INT128
+ #endif
+ 
Index: patches/patch-boost_config_compiler_gcc_hpp
===================================================================
RCS file: patches/patch-boost_config_compiler_gcc_hpp
diff -N patches/patch-boost_config_compiler_gcc_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_config_compiler_gcc_hpp 31 May 2016 07:41:54 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- boost/config/compiler/gcc.hpp.orig Tue Mar 24 19:27:48 2015
++++ boost/config/compiler/gcc.hpp      Mon May 30 09:11:23 2016
+@@ -140,7 +140,7 @@
+ // Only re-enable this for nvcc if you're absolutely sure
+ // of the circumstances under which it's supported:
+ //
+-#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
++#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) && 
!defined(__OpenBSD__)
+ #  define BOOST_HAS_INT128
+ #endif
+ 

Reply via email to