summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <peter.x.liu@external.atlascopco.com>2017-08-30 17:15:28 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2017-09-07 10:59:20 +0200
commitffc78c155c36c657c4648ee303f108b164fef4b8 (patch)
tree59e7d2b3227887cbb038e224a4b282066612dfe5
parent7c6a47177c1c9e61fc3e26098277786563c575af (diff)
downloadmeta-openembedded-ffc78c155c36c657c4648ee303f108b164fef4b8.tar.gz
json-spirit: link to libatomic
In commit ac2a6d2b5d69937577effcb8bb2149651bac0176: [ json-spirit: Add -latomic to LDFLAGS ] I added '-latomic' to LDFLAGS, which worked for clang 3.9 but it does not work for clang 5.0, seems the linking order matters for clang 5.0, it should be after -ljson_spirit. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch64
-rw-r--r--meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb3
2 files changed, 65 insertions, 2 deletions
diff --git a/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch b/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch
new file mode 100644
index 000000000..4c8c7b98d
--- /dev/null
+++ b/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch
@@ -0,0 +1,64 @@
1From bbac9ac3e391253bc1f90cf0f70a2ce1aac9511f Mon Sep 17 00:00:00 2001
2From: Ming Liu <liu.ming50@gmail.com>
3Date: Wed, 30 Aug 2017 16:50:56 +0200
4Subject: [PATCH] Link to libatomic
5
6This is needed for clang compiler.
7
8Upstream-Status: Pending
9
10Signed-off-by: Ming Liu <liu.ming50@gmail.com>
11---
12 json_demo/CMakeLists.txt | 2 +-
13 json_headers_only_demo/CMakeLists.txt | 2 +-
14 json_map_demo/CMakeLists.txt | 2 +-
15 json_test/CMakeLists.txt | 2 +-
16 4 files changed, 4 insertions(+), 4 deletions(-)
17
18diff --git a/json_demo/CMakeLists.txt b/json_demo/CMakeLists.txt
19index b1d3c6a..0dfd308 100644
20--- a/json_demo/CMakeLists.txt
21+++ b/json_demo/CMakeLists.txt
22@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
23 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
24
25 ADD_EXECUTABLE(json_demo ${JSON_DEMO_SRCS})
26-TARGET_LINK_LIBRARIES(json_demo json_spirit)
27+TARGET_LINK_LIBRARIES(json_demo json_spirit -latomic)
28
29diff --git a/json_headers_only_demo/CMakeLists.txt b/json_headers_only_demo/CMakeLists.txt
30index a3c787a..6eae11e 100644
31--- a/json_headers_only_demo/CMakeLists.txt
32+++ b/json_headers_only_demo/CMakeLists.txt
33@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
34 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
35
36 ADD_EXECUTABLE(json_headers_only_demo ${JSON_HEADERS_ONLY_DEMO_SRCS})
37-TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit)
38+TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit -latomic)
39
40diff --git a/json_map_demo/CMakeLists.txt b/json_map_demo/CMakeLists.txt
41index 599006a..e3e45e8 100644
42--- a/json_map_demo/CMakeLists.txt
43+++ b/json_map_demo/CMakeLists.txt
44@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
45 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
46
47 ADD_EXECUTABLE(json_map_demo ${JSON_MAP_DEMO_SRCS})
48-TARGET_LINK_LIBRARIES(json_map_demo json_spirit)
49+TARGET_LINK_LIBRARIES(json_map_demo json_spirit -latomic)
50
51diff --git a/json_test/CMakeLists.txt b/json_test/CMakeLists.txt
52index 38ffa7f..1ec1365 100644
53--- a/json_test/CMakeLists.txt
54+++ b/json_test/CMakeLists.txt
55@@ -11,5 +11,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
56 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
57
58 ADD_EXECUTABLE(json_test ${JSON_TEST_SRCS})
59-TARGET_LINK_LIBRARIES(json_test json_spirit)
60+TARGET_LINK_LIBRARIES(json_test json_spirit -latomic)
61
62--
632.7.4
64
diff --git a/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb b/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb
index 2f456bf64..c7c1ad1ec 100644
--- a/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb
+++ b/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb
@@ -11,14 +11,13 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=278ef6183dec4aae1524fccc4b0113c9"
11 11
12SRC_URI = "file://json_spirit_v${PV}.zip \ 12SRC_URI = "file://json_spirit_v${PV}.zip \
13 file://0001-Adjust-the-cmake-files.patch \ 13 file://0001-Adjust-the-cmake-files.patch \
14 file://0001-Link-to-libatomic.patch \
14" 15"
15 16
16S = "${WORKDIR}/json_spirit_v${PV}" 17S = "${WORKDIR}/json_spirit_v${PV}"
17 18
18DEPENDS = "boost" 19DEPENDS = "boost"
19 20
20LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
21
22inherit cmake 21inherit cmake
23 22
24FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake" 23FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake"