summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPhil Blundell <pb@pbcl.net>2013-11-14 14:41:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-12 17:00:18 +0000
commita8008ea07b8d852a3b67fd2a4059669b56cb8e2a (patch)
tree5706cabef85012c66789b22b959147e5b56df5f1 /meta
parentfbe8b3ce1f8ce174708f5a8c329c3fd85acac885 (diff)
downloadpoky-a8008ea07b8d852a3b67fd2a4059669b56cb8e2a.tar.gz
boost: Add patch to avoid undefined references to boost::atomic::lockpool::get_lock_for()
Boost::thread uses functions from boost::atomic but doesn't actually link with libboost_atomic. This works fine on platforms where BOOST_ATOMIC_FLAG_LOCK_FREE is true but will lead to undefined symbol references otherwise. Fix this by applying a patch from the upstream bug tracker to add the missing library linkage. (From OE-Core master rev: 1ffc27173576589191b037d111ecb59d94631de0) (From OE-Core rev: 306fd06c7687340a0d4eb90e9aba9dc8669db07c) Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/boost/boost_1.54.0.bb1
-rw-r--r--meta/recipes-support/boost/files/boost-1.54.0-thread-link_atomic.patch59
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-support/boost/boost_1.54.0.bb b/meta/recipes-support/boost/boost_1.54.0.bb
index 3cf88fa3c1..9e7a60a805 100644
--- a/meta/recipes-support/boost/boost_1.54.0.bb
+++ b/meta/recipes-support/boost/boost_1.54.0.bb
@@ -3,4 +3,5 @@ include boost.inc
3 3
4SRC_URI += "file://arm-intrinsics.patch \ 4SRC_URI += "file://arm-intrinsics.patch \
5 file://glibc.patch \ 5 file://glibc.patch \
6 file://boost-1.54.0-thread-link_atomic.patch \
6 " 7 "
diff --git a/meta/recipes-support/boost/files/boost-1.54.0-thread-link_atomic.patch b/meta/recipes-support/boost/files/boost-1.54.0-thread-link_atomic.patch
new file mode 100644
index 0000000000..62af3d1aa3
--- /dev/null
+++ b/meta/recipes-support/boost/files/boost-1.54.0-thread-link_atomic.patch
@@ -0,0 +1,59 @@
1Link boost_thread with boost_atomic to avoid undefined references to
2boost::atomic::detail::lock_pool::get_lock_for().
3
4From https://svn.boost.org/trac/boost/ticket/9041
5
6Phil Blundell <pb@pbcl.net>
7Upstream-Status: Backport
8
9diff -Nurp boost_1_54_0/libs/thread/build/has_atomic_flag_lockfree_test.cpp boost_1_54_0.pm/libs/thread/build/has_atomic_flag_lockfree_test.cpp
10--- boost_1_54_0/libs/thread/build/has_atomic_flag_lockfree_test.cpp 1970-01-01 01:00:00.000000000 +0100
11+++ boost_1_54_0.pm/libs/thread/build/has_atomic_flag_lockfree_test.cpp 2013-08-23 19:51:52.706329968 +0200
12@@ -0,0 +1,14 @@
13+// Copyright (c) 2013, Petr Machata, Red Hat Inc.
14+//
15+// Use modification and distribution are subject to the boost Software
16+// License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
17+
18+#include "../../../boost/atomic.hpp"
19+#include "../../../boost/static_assert.hpp"
20+
21+int
22+main(int argc, char *argv[])
23+{
24+ BOOST_STATIC_ASSERT(BOOST_ATOMIC_FLAG_LOCK_FREE);
25+ return 0;
26+}
27diff -Nurp boost_1_54_0/libs/thread/build/Jamfile.v2 boost_1_54_0.pm/libs/thread/build/Jamfile.v2
28--- boost_1_54_0/libs/thread/build/Jamfile.v2 2013-06-15 12:35:45.000000000 +0200
29+++ boost_1_54_0.pm/libs/thread/build/Jamfile.v2 2013-08-23 19:52:30.018613408 +0200
30@@ -36,6 +36,7 @@ import os ;
31 import feature ;
32 import indirect ;
33 import path ;
34+import configure ;
35
36 project boost/thread
37 : source-location ../src
38@@ -140,6 +141,8 @@ local rule default_threadapi ( )
39 feature.feature threadapi : pthread win32 : propagated ;
40 feature.set-default threadapi : [ default_threadapi ] ;
41
42+exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;
43+
44 rule tag ( name : type ? : property-set )
45 {
46 local result = $(name) ;
47@@ -248,6 +251,12 @@ rule requirements ( properties * )
48 {
49 local result ;
50
51+ if ! [ configure.builds has_atomic_flag_lockfree
52+ : $(properties) : "lockfree boost::atomic_flag" ]
53+ {
54+ result += <library>/boost/atomic//boost_atomic ;
55+ }
56+
57 if <threadapi>pthread in $(properties)
58 {
59 result += <define>BOOST_THREAD_POSIX ;