summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/boost
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/boost
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/boost')
-rw-r--r--meta/recipes-support/boost/bjam-native_1.56.0.bb15
-rw-r--r--meta/recipes-support/boost/boost-1.56.0.inc19
-rw-r--r--meta/recipes-support/boost/boost.inc182
-rw-r--r--meta/recipes-support/boost/boost/0001-Added-support-for-extending-operations-to-GCC-atomic.patch412
-rw-r--r--meta/recipes-support/boost/boost/arm-intrinsics.patch55
-rw-r--r--meta/recipes-support/boost/boost_1.56.0.bb7
6 files changed, 690 insertions, 0 deletions
diff --git a/meta/recipes-support/boost/bjam-native_1.56.0.bb b/meta/recipes-support/boost/bjam-native_1.56.0.bb
new file mode 100644
index 0000000000..d85d1a96cb
--- /dev/null
+++ b/meta/recipes-support/boost/bjam-native_1.56.0.bb
@@ -0,0 +1,15 @@
1include boost-${PV}.inc
2
3SUMMARY = "Portable Boost.Jam build tool for boost"
4SECTION = "devel"
5
6inherit native
7
8do_compile() {
9 ./bootstrap.sh --with-toolset=gcc
10}
11
12do_install() {
13 install -d ${D}${bindir}/
14 install -c -m 755 bjam ${D}${bindir}/
15}
diff --git a/meta/recipes-support/boost/boost-1.56.0.inc b/meta/recipes-support/boost/boost-1.56.0.inc
new file mode 100644
index 0000000000..24c32b4c6f
--- /dev/null
+++ b/meta/recipes-support/boost/boost-1.56.0.inc
@@ -0,0 +1,19 @@
1# The Boost web site provides free peer-reviewed portable
2# C++ source libraries. The emphasis is on libraries which
3# work well with the C++ Standard Library. The libraries are
4# intended to be widely useful, and are in regular use by
5# thousands of programmers across a broad spectrum of applications.
6HOMEPAGE = "http://www.boost.org/"
7LICENSE = "BSL-1.0 & MIT & Python-2.0"
8LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
9
10BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}"
11BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
12BOOST_P = "boost_${BOOST_VER}"
13
14SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2"
15
16SRC_URI[md5sum] = "a744cf167b05d72335f27c88115f211d"
17SRC_URI[sha256sum] = "134732acaf3a6e7eba85988118d943f0fa6b7f0850f65131fff89823ad30ff1d"
18
19S = "${WORKDIR}/${BOOST_P}"
diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
new file mode 100644
index 0000000000..069b1c8eab
--- /dev/null
+++ b/meta/recipes-support/boost/boost.inc
@@ -0,0 +1,182 @@
1SUMMARY = "Free peer-reviewed portable C++ source libraries"
2SECTION = "libs"
3DEPENDS = "bjam-native zlib bzip2"
4
5ARM_INSTRUCTION_SET = "arm"
6
7BOOST_LIBS = "\
8 date_time \
9 filesystem \
10 graph \
11 iostreams \
12 program_options \
13 regex \
14 serialization \
15 signals \
16 system \
17 test \
18 thread \
19 "
20
21# optional boost-python library
22PACKAGECONFIG ??= ""
23PACKAGECONFIG[python] = ",,python"
24BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
25inherit python-dir
26PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
27
28# Make a package for each library, plus -dev
29PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
30python __anonymous () {
31 packages = []
32 extras = []
33 for lib in d.getVar('BOOST_LIBS', True).split( ):
34 pkg = "boost-%s" % lib.replace("_", "-")
35 extras.append("--with-%s" % lib)
36 packages.append(pkg)
37 if not d.getVar("FILES_%s" % pkg, True):
38 d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
39 d.setVar("BOOST_PACKAGES", " ".join(packages))
40 d.setVar("BJAM_EXTRA", " ".join(extras))
41}
42
43# Override the contents of specific packages
44FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
45 ${libdir}/libboost_wserialization*.so.*"
46FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
47 ${libdir}/libboost_unit_test_framework*.so.*"
48
49# -dev last to pick up the remaining stuff
50PACKAGES += "${PN}-dev ${PN}-staticdev"
51FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
52FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
53
54# "boost" is a metapackage which pulls in all boost librabries
55PACKAGES += "${PN}"
56RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
57RRECOMMENDS_${PN}_class-native = ""
58ALLOW_EMPTY_${PN} = "1"
59
60# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
61TARGET_CC_ARCH += " ${LDFLAGS}"
62
63# Oh yippee, a new build system, it's sooo cooool I could eat my own
64# foot. inlining=on lets the compiler choose, I think. At least this
65# stuff is documented...
66# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
67# objcopy will be invoked, and that won't work. Building debug apparently
68# requires hacking gcc-tools.jam
69#
70# Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
71# Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just
72# standing there, waiting, but the truely terrifying thing is what they carry
73# in their hands. At first sight each seems to bear the same thing, but it is
74# not so for the forms in their grasp are ever so slightly different one from
75# the other. Each is twisted in some grotesque way from the other to make each
76# an unspeakable perversion impossible to perceive without the onset of madness.
77# True insanity awaits anyone who perceives all of these horrors together.
78#
79# Quotation marks, there might be an easier way to do this, but I can't find
80# it. The problem is that the user.hpp configuration file must receive a
81# pre-processor macro defined as the appropriate string - complete with "'s
82# around it. (<> is a possibility here but the danger to that is that the
83# failure case interprets the < and > as shell redirections, creating
84# random files in the source tree.)
85#
86#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
87#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
88SQD = '"'
89EQD = '\"'
90#boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
91BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
92
93BJAM_TOOLS = "--ignore-site-config \
94 '-sTOOLS=gcc' \
95 '-sGCC=${CC} '${BJAM_CONF} \
96 '-sGXX=${CXX} '${BJAM_CONF} \
97 '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
98 '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
99 '-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
100 '-sPYTHON_VERSION=${PYTHON_BASEVERSION}' \
101 '-sPYTHON_ROOT=${PYTHON_ROOT}' \
102 '--layout=system' \
103 "
104
105# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j
106# https://svn.boost.org/trac/boost/ticket/7634
107def get_boost_parallel_make(bb, d):
108 pm = d.getVar('PARALLEL_MAKE', True)
109 if pm:
110 # look for '-j' and throw other options (e.g. '-l') away
111 # because they might have different meaning in bjam
112 pm = pm.split()
113 while pm:
114 v = None
115 opt = pm.pop(0)
116 if opt == '-j':
117 v = pm.pop(0)
118 elif opt.startswith('-j'):
119 v = opt[2:].strip()
120 else:
121 v = None
122
123 if v:
124 v = min(64, int(v))
125 return '-j' + str(v)
126
127 return ""
128
129BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}"
130BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \
131 ${BJAM_TOOLS} \
132 -sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/user-config.jam \
133 --builddir=${S}/${TARGET_SYS} \
134 --disable-icu \
135 ${BJAM_EXTRA}'
136
137# Native compilation of bzip2 isn't working
138BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
139
140do_boostconfig() {
141 cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
142
143 # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
144 if ! grep -qe "^using gcc : 4.3.1" ${S}/tools/build/example/user-config.jam
145 then
146 echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam
147 fi
148
149 echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam
150
151 CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
152 sed -i '/^using python/d' project-config.jam
153}
154
155addtask do_boostconfig after do_patch before do_configure
156
157do_compile() {
158 set -ex
159 bjam ${BJAM_OPTS} --prefix=${prefix} \
160 --exec-prefix=${exec_prefix} \
161 --libdir=${libdir} \
162 --includedir=${includedir}
163}
164
165do_install() {
166 set -ex
167 bjam ${BJAM_OPTS} \
168 --libdir=${D}${libdir} \
169 --includedir=${D}${includedir} \
170 install
171 for lib in ${BOOST_LIBS}; do
172 if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
173 ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
174 fi
175 if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
176 ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
177 fi
178 done
179
180}
181
182BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/boost/boost/0001-Added-support-for-extending-operations-to-GCC-atomic.patch b/meta/recipes-support/boost/boost/0001-Added-support-for-extending-operations-to-GCC-atomic.patch
new file mode 100644
index 0000000000..feece81532
--- /dev/null
+++ b/meta/recipes-support/boost/boost/0001-Added-support-for-extending-operations-to-GCC-atomic.patch
@@ -0,0 +1,412 @@
1From 415db7054723291042e4ff1ffa8fdd5bc8b07163 Mon Sep 17 00:00:00 2001
2From: Andrey Semashev <andrey.semashev@gmail.com>
3Date: Sat, 27 Sep 2014 20:40:09 +0400
4Subject: [PATCH] Added support for extending operations to GCC atomic backend.
5
6Fix for #10446. Some platforms (e.g. Raspberry Pi) only support atomic ops of some particular size but not less. Use extending arithmetic operations for these platforms. Also, make sure bools are always treated as 8-bit values, even if the actual type is larger. This makes its use in atomic<>, atomic_flag and lock pool more consistent.
7
8Upstream-Status: Backport [https://svn.boost.org/trac/boost/ticket/10446]
9Signed-off-by: Peter A. Bigot <pab@pabigot.com>
10
11---
12 include/boost/atomic/capabilities.hpp | 1 +
13 include/boost/atomic/detail/atomic_template.hpp | 2 +-
14 include/boost/atomic/detail/caps_gcc_atomic.hpp | 82 +++++------
15 include/boost/atomic/detail/ops_gcc_atomic.hpp | 184 +++++++++++++++++++++---
16 4 files changed, 206 insertions(+), 63 deletions(-)
17
18diff --git a/include/boost/atomic/capabilities.hpp b/include/boost/atomic/capabilities.hpp
19index 658dd22..05bbb0f 100644
20--- a/include/boost/atomic/capabilities.hpp
21+++ b/include/boost/atomic/capabilities.hpp
22@@ -142,6 +142,7 @@
23 #define BOOST_ATOMIC_ADDRESS_LOCK_FREE BOOST_ATOMIC_POINTER_LOCK_FREE
24
25 #ifndef BOOST_ATOMIC_BOOL_LOCK_FREE
26+// We store bools in 1-byte storage in all backends
27 #define BOOST_ATOMIC_BOOL_LOCK_FREE BOOST_ATOMIC_INT8_LOCK_FREE
28 #endif
29
30diff --git a/include/boost/atomic/detail/atomic_template.hpp b/include/boost/atomic/detail/atomic_template.hpp
31index 4fd6d79..bc3922a 100644
32--- a/include/boost/atomic/detail/atomic_template.hpp
33+++ b/include/boost/atomic/detail/atomic_template.hpp
34@@ -234,7 +234,7 @@ class base_atomic< bool, int >
35 {
36 private:
37 typedef bool value_type;
38- typedef atomics::detail::operations< storage_size_of< value_type >::value, false > operations;
39+ typedef atomics::detail::operations< 1u, false > operations;
40
41 protected:
42 typedef value_type value_arg_type;
43diff --git a/include/boost/atomic/detail/caps_gcc_atomic.hpp b/include/boost/atomic/detail/caps_gcc_atomic.hpp
44index 8299ad0..f4e7a70 100644
45--- a/include/boost/atomic/detail/caps_gcc_atomic.hpp
46+++ b/include/boost/atomic/detail/caps_gcc_atomic.hpp
47@@ -29,66 +29,48 @@
48 #define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1
49 #endif
50
51-#if __GCC_ATOMIC_BOOL_LOCK_FREE == 2
52-#define BOOST_ATOMIC_FLAG_LOCK_FREE 2
53-#else
54-#define BOOST_ATOMIC_FLAG_LOCK_FREE 0
55-#endif
56-#if __GCC_ATOMIC_CHAR_LOCK_FREE == 2
57-#define BOOST_ATOMIC_CHAR_LOCK_FREE 2
58-#else
59-#define BOOST_ATOMIC_CHAR_LOCK_FREE 0
60-#endif
61-#if __GCC_ATOMIC_CHAR16_T_LOCK_FREE == 2
62-#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2
63-#else
64-#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 0
65-#endif
66-#if __GCC_ATOMIC_CHAR32_T_LOCK_FREE == 2
67-#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2
68+#if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) && (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT))
69+#define BOOST_ATOMIC_INT128_LOCK_FREE 2
70 #else
71-#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 0
72+#define BOOST_ATOMIC_INT128_LOCK_FREE 0
73 #endif
74-#if __GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2
75-#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2
76+
77+#if __GCC_ATOMIC_LLONG_LOCK_FREE == 2
78+#define BOOST_ATOMIC_LLONG_LOCK_FREE 2
79 #else
80-#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 0
81+#define BOOST_ATOMIC_LLONG_LOCK_FREE BOOST_ATOMIC_INT128_LOCK_FREE
82 #endif
83-#if __GCC_ATOMIC_SHORT_LOCK_FREE == 2
84-#define BOOST_ATOMIC_SHORT_LOCK_FREE 2
85+
86+#if __GCC_ATOMIC_LONG_LOCK_FREE == 2
87+#define BOOST_ATOMIC_LONG_LOCK_FREE 2
88 #else
89-#define BOOST_ATOMIC_SHORT_LOCK_FREE 0
90+#define BOOST_ATOMIC_LONG_LOCK_FREE BOOST_ATOMIC_LLONG_LOCK_FREE
91 #endif
92+
93 #if __GCC_ATOMIC_INT_LOCK_FREE == 2
94 #define BOOST_ATOMIC_INT_LOCK_FREE 2
95 #else
96-#define BOOST_ATOMIC_INT_LOCK_FREE 0
97-#endif
98-#if __GCC_ATOMIC_LONG_LOCK_FREE == 2
99-#define BOOST_ATOMIC_LONG_LOCK_FREE 2
100-#else
101-#define BOOST_ATOMIC_LONG_LOCK_FREE 0
102+#define BOOST_ATOMIC_INT_LOCK_FREE BOOST_ATOMIC_LONG_LOCK_FREE
103 #endif
104-#if __GCC_ATOMIC_LLONG_LOCK_FREE == 2
105-#define BOOST_ATOMIC_LLONG_LOCK_FREE 2
106+
107+#if __GCC_ATOMIC_SHORT_LOCK_FREE == 2
108+#define BOOST_ATOMIC_SHORT_LOCK_FREE 2
109 #else
110-#define BOOST_ATOMIC_LLONG_LOCK_FREE 0
111+#define BOOST_ATOMIC_SHORT_LOCK_FREE BOOST_ATOMIC_INT_LOCK_FREE
112 #endif
113-#if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) && (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT))
114-#define BOOST_ATOMIC_INT128_LOCK_FREE 2
115+
116+#if __GCC_ATOMIC_CHAR_LOCK_FREE == 2
117+#define BOOST_ATOMIC_CHAR_LOCK_FREE 2
118 #else
119-#define BOOST_ATOMIC_INT128_LOCK_FREE 0
120+#define BOOST_ATOMIC_CHAR_LOCK_FREE BOOST_ATOMIC_SHORT_LOCK_FREE
121 #endif
122+
123 #if __GCC_ATOMIC_POINTER_LOCK_FREE == 2
124 #define BOOST_ATOMIC_POINTER_LOCK_FREE 2
125 #else
126 #define BOOST_ATOMIC_POINTER_LOCK_FREE 0
127 #endif
128-#if __GCC_ATOMIC_BOOL_LOCK_FREE == 2
129-#define BOOST_ATOMIC_BOOL_LOCK_FREE 2
130-#else
131-#define BOOST_ATOMIC_BOOL_LOCK_FREE 0
132-#endif
133+
134
135 #define BOOST_ATOMIC_INT8_LOCK_FREE BOOST_ATOMIC_CHAR_LOCK_FREE
136
137@@ -128,6 +110,24 @@
138 #define BOOST_ATOMIC_INT64_LOCK_FREE 0
139 #endif
140
141+
142+#if __GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2
143+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2
144+#elif BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 8
145+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE BOOST_ATOMIC_INT64_LOCK_FREE
146+#elif BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 4
147+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE BOOST_ATOMIC_INT32_LOCK_FREE
148+#elif BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 2
149+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE BOOST_ATOMIC_INT16_LOCK_FREE
150+#elif BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 1
151+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE BOOST_ATOMIC_INT8_LOCK_FREE
152+#else
153+#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 0
154+#endif
155+
156+#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE BOOST_ATOMIC_INT32_LOCK_FREE
157+#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE BOOST_ATOMIC_INT16_LOCK_FREE
158+
159 #define BOOST_ATOMIC_THREAD_FENCE 2
160 #define BOOST_ATOMIC_SIGNAL_FENCE 2
161
162diff --git a/include/boost/atomic/detail/ops_gcc_atomic.hpp b/include/boost/atomic/detail/ops_gcc_atomic.hpp
163index 2297791..2e4c37b 100644
164--- a/include/boost/atomic/detail/ops_gcc_atomic.hpp
165+++ b/include/boost/atomic/detail/ops_gcc_atomic.hpp
166@@ -24,6 +24,15 @@
167 #include <boost/atomic/detail/ops_cas_based.hpp>
168 #endif
169
170+#if __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE || __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE ||\
171+ __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE || __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE ||\
172+ __GCC_ATOMIC_CHAR_LOCK_FREE != BOOST_ATOMIC_CHAR_LOCK_FREE || __GCC_ATOMIC_BOOL_LOCK_FREE != BOOST_ATOMIC_BOOL_LOCK_FREE ||\
173+ __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE
174+// There are platforms where we need to use larger storage types
175+#include <boost/atomic/detail/int_sizes.hpp>
176+#include <boost/atomic/detail/ops_extending_cas_based.hpp>
177+#endif
178+
179 #ifdef BOOST_HAS_PRAGMA_ONCE
180 #pragma once
181 #endif
182@@ -154,73 +163,206 @@ struct gcc_atomic_operations
183 }
184 };
185
186-#if BOOST_ATOMIC_INT8_LOCK_FREE > 0
187+#if BOOST_ATOMIC_INT128_LOCK_FREE > 0
188+#if defined(__clang__) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B)
189+
190+// Workaround for clang bug: http://llvm.org/bugs/show_bug.cgi?id=19149
191+// Clang 3.4 does not implement 128-bit __atomic* intrinsics even though it defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
192 template< bool Signed >
193-struct operations< 1u, Signed > :
194- public gcc_atomic_operations< typename make_storage_type< 1u, Signed >::type >
195+struct operations< 16u, Signed > :
196+ public cas_based_operations< gcc_dcas_x86_64< Signed > >
197 {
198 };
199+
200+#else
201+
202+template< bool Signed >
203+struct operations< 16u, Signed > :
204+ public gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >
205+{
206+};
207+
208+#endif
209 #endif
210
211-#if BOOST_ATOMIC_INT16_LOCK_FREE > 0
212+
213+#if BOOST_ATOMIC_INT64_LOCK_FREE > 0
214+#if defined(__clang__) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B)
215+
216+// Workaround for clang bug http://llvm.org/bugs/show_bug.cgi?id=19355
217 template< bool Signed >
218-struct operations< 2u, Signed > :
219- public gcc_atomic_operations< typename make_storage_type< 2u, Signed >::type >
220+struct operations< 8u, Signed > :
221+ public cas_based_operations< gcc_dcas_x86< Signed > >
222+{
223+};
224+
225+#elif (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 8 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
226+ (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 8 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
227+ (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 8 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
228+ (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 8 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
229+ (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 8 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
230+
231+#define BOOST_ATOMIC_DETAIL_INT64_EXTENDED
232+
233+template< bool Signed >
234+struct operations< 8u, Signed > :
235+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 8u, Signed >
236 {
237 };
238+
239+#else
240+
241+template< bool Signed >
242+struct operations< 8u, Signed > :
243+ public gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >
244+{
245+};
246+
247+#endif
248 #endif
249
250 #if BOOST_ATOMIC_INT32_LOCK_FREE > 0
251+#if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 4 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
252+ (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 4 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
253+ (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 4 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
254+ (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 4 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
255+ (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 4 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
256+
257+#define BOOST_ATOMIC_DETAIL_INT32_EXTENDED
258+
259+#if !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
260+
261+template< bool Signed >
262+struct operations< 4u, Signed > :
263+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 4u, Signed >
264+{
265+};
266+
267+#else // !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
268+
269+template< bool Signed >
270+struct operations< 4u, Signed > :
271+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 4u, Signed >
272+{
273+};
274+
275+#endif // !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
276+
277+#else
278+
279 template< bool Signed >
280 struct operations< 4u, Signed > :
281 public gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >
282 {
283 };
284+
285+#endif
286 #endif
287
288-#if BOOST_ATOMIC_INT64_LOCK_FREE > 0
289-#if defined(__clang__) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B)
290+#if BOOST_ATOMIC_INT16_LOCK_FREE > 0
291+#if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 2 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
292+ (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 2 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
293+ (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 2 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
294+ (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 2 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
295+ (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 2 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE)
296+
297+#define BOOST_ATOMIC_DETAIL_INT16_EXTENDED
298+
299+#if !defined(BOOST_ATOMIC_DETAIL_INT32_EXTENDED)
300
301-// Workaround for clang bug http://llvm.org/bugs/show_bug.cgi?id=19355
302 template< bool Signed >
303-struct operations< 8u, Signed > :
304- public cas_based_operations< gcc_dcas_x86< Signed > >
305+struct operations< 2u, Signed > :
306+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >, 2u, Signed >
307+{
308+};
309+
310+#elif !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
311+
312+template< bool Signed >
313+struct operations< 2u, Signed > :
314+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 2u, Signed >
315 {
316 };
317
318 #else
319
320 template< bool Signed >
321-struct operations< 8u, Signed > :
322- public gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >
323+struct operations< 2u, Signed > :
324+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 2u, Signed >
325+{
326+};
327+
328+#endif
329+
330+#else
331+
332+template< bool Signed >
333+struct operations< 2u, Signed > :
334+ public gcc_atomic_operations< typename make_storage_type< 2u, Signed >::type >
335 {
336 };
337
338 #endif
339 #endif
340
341-#if BOOST_ATOMIC_INT128_LOCK_FREE > 0
342-#if defined(__clang__) && defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B)
343+#if BOOST_ATOMIC_INT8_LOCK_FREE > 0
344+#if (BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 1 && __GCC_ATOMIC_LLONG_LOCK_FREE != BOOST_ATOMIC_LLONG_LOCK_FREE) ||\
345+ (BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 1 && __GCC_ATOMIC_LONG_LOCK_FREE != BOOST_ATOMIC_LONG_LOCK_FREE) ||\
346+ (BOOST_ATOMIC_DETAIL_SIZEOF_INT == 1 && __GCC_ATOMIC_INT_LOCK_FREE != BOOST_ATOMIC_INT_LOCK_FREE) ||\
347+ (BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 1 && __GCC_ATOMIC_SHORT_LOCK_FREE != BOOST_ATOMIC_SHORT_LOCK_FREE) ||\
348+ (BOOST_ATOMIC_DETAIL_SIZEOF_WCHAR_T == 1 && __GCC_ATOMIC_WCHAR_T_LOCK_FREE != BOOST_ATOMIC_WCHAR_T_LOCK_FREE) ||\
349+ (__GCC_ATOMIC_CHAR_LOCK_FREE != BOOST_ATOMIC_CHAR_LOCK_FREE) ||\
350+ (__GCC_ATOMIC_BOOL_LOCK_FREE != BOOST_ATOMIC_BOOL_LOCK_FREE)
351+
352+#if !defined(BOOST_ATOMIC_DETAIL_INT16_EXTENDED)
353
354-// Workaround for clang bug: http://llvm.org/bugs/show_bug.cgi?id=19149
355-// Clang 3.4 does not implement 128-bit __atomic* intrinsics even though it defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
356 template< bool Signed >
357-struct operations< 16u, Signed > :
358- public cas_based_operations< gcc_dcas_x86_64< Signed > >
359+struct operations< 1u, Signed > :
360+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 2u, Signed >::type >, 1u, Signed >
361+{
362+};
363+
364+#elif !defined(BOOST_ATOMIC_DETAIL_INT32_EXTENDED)
365+
366+template< bool Signed >
367+struct operations< 1u, Signed > :
368+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 4u, Signed >::type >, 1u, Signed >
369+{
370+};
371+
372+#elif !defined(BOOST_ATOMIC_DETAIL_INT64_EXTENDED)
373+
374+template< bool Signed >
375+struct operations< 1u, Signed > :
376+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 8u, Signed >::type >, 1u, Signed >
377 {
378 };
379
380 #else
381
382 template< bool Signed >
383-struct operations< 16u, Signed > :
384- public gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >
385+struct operations< 1u, Signed > :
386+ public extending_cas_based_operations< gcc_atomic_operations< typename make_storage_type< 16u, Signed >::type >, 1u, Signed >
387+{
388+};
389+
390+#endif
391+
392+#else
393+
394+template< bool Signed >
395+struct operations< 1u, Signed > :
396+ public gcc_atomic_operations< typename make_storage_type< 1u, Signed >::type >
397 {
398 };
399
400 #endif
401 #endif
402
403+#undef BOOST_ATOMIC_DETAIL_INT16_EXTENDED
404+#undef BOOST_ATOMIC_DETAIL_INT32_EXTENDED
405+#undef BOOST_ATOMIC_DETAIL_INT64_EXTENDED
406+
407 BOOST_FORCEINLINE void thread_fence(memory_order order) BOOST_NOEXCEPT
408 {
409 __atomic_thread_fence(atomics::detail::convert_memory_order_to_gcc(order));
410--
4111.8.5.5
412
diff --git a/meta/recipes-support/boost/boost/arm-intrinsics.patch b/meta/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 0000000000..fe85c69a82
--- /dev/null
+++ b/meta/recipes-support/boost/boost/arm-intrinsics.patch
@@ -0,0 +1,55 @@
1Upstream-Status: Backport
2
38/17/2010 - rebased to 1.44 by Qing He <qing.he@intel.com>
4
5diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp
6index b6359b5..78b1cc2 100644
7--- a/boost/smart_ptr/detail/atomic_count_sync.hpp
8+++ b/boost/smart_ptr/detail/atomic_count_sync.hpp
9@@ -33,17 +33,46 @@ public:
10
11 long operator++()
12 {
13+#ifdef __ARM_ARCH_7A__
14+ int v1, tmp;
15+ asm volatile ("1: \n\t"
16+ "ldrex %0, %1 \n\t"
17+ "add %0 ,%0, #1 \n\t"
18+ "strex %2, %0, %1 \n\t"
19+ "cmp %2, #0 \n\t"
20+ "bne 1b \n\t"
21+ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
22+ );
23+#else
24 return __sync_add_and_fetch( &value_, 1 );
25+#endif
26 }
27
28 long operator--()
29 {
30+#ifdef __ARM_ARCH_7A__
31+ int v1, tmp;
32+ asm volatile ("1: \n\t"
33+ "ldrex %0, %1 \n\t"
34+ "sub %0 ,%0, #1 \n\t"
35+ "strex %2, %0, %1 \n\t"
36+ "cmp %2, #0 \n\t"
37+ "bne 1b \n\t"
38+ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
39+ );
40+ return value_;
41+#else
42 return __sync_add_and_fetch( &value_, -1 );
43+#endif
44 }
45
46 operator long() const
47 {
48+#if __ARM_ARCH_7A__
49+ return value_;
50+#else
51 return __sync_fetch_and_add( &value_, 0 );
52+#endif
53 }
54
55 private:
diff --git a/meta/recipes-support/boost/boost_1.56.0.bb b/meta/recipes-support/boost/boost_1.56.0.bb
new file mode 100644
index 0000000000..dcc77bb87e
--- /dev/null
+++ b/meta/recipes-support/boost/boost_1.56.0.bb
@@ -0,0 +1,7 @@
1include boost-${PV}.inc
2include boost.inc
3
4SRC_URI += "\
5 file://arm-intrinsics.patch \
6 file://0001-Added-support-for-extending-operations-to-GCC-atomic.patch;striplevel=2 \
7"