All of lore.kernel.org
 help / color / mirror / Atom feed
From: liu.ming50@gmail.com
To: openembedded-devel@lists.openembedded.org
Cc: Ming Liu <peter.x.liu@external.atlascopco.com>
Subject: [meta-oe] [PATCH] json-spirit: link to libatomic
Date: Wed, 30 Aug 2017 17:15:28 +0200	[thread overview]
Message-ID: <1504106128-26607-1-git-send-email-liu.ming50@gmail.com> (raw)

From: Ming Liu <peter.x.liu@external.atlascopco.com>

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>
---
 .../json-spirit/0001-Link-to-libatomic.patch       | 64 ++++++++++++++++++++++
 .../json-spirit/json-spirit_4.08.bb                |  3 +-
 2 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch

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 0000000..4c8c7b9
--- /dev/null
+++ b/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Link-to-libatomic.patch
@@ -0,0 +1,64 @@
+From bbac9ac3e391253bc1f90cf0f70a2ce1aac9511f Mon Sep 17 00:00:00 2001
+From: Ming Liu <liu.ming50@gmail.com>
+Date: Wed, 30 Aug 2017 16:50:56 +0200
+Subject: [PATCH] Link to libatomic
+
+This is needed for clang compiler.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <liu.ming50@gmail.com>
+---
+ json_demo/CMakeLists.txt              | 2 +-
+ json_headers_only_demo/CMakeLists.txt | 2 +-
+ json_map_demo/CMakeLists.txt          | 2 +-
+ json_test/CMakeLists.txt              | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/json_demo/CMakeLists.txt b/json_demo/CMakeLists.txt
+index b1d3c6a..0dfd308 100644
+--- a/json_demo/CMakeLists.txt
++++ b/json_demo/CMakeLists.txt
+@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ 
+ ADD_EXECUTABLE(json_demo ${JSON_DEMO_SRCS})
+-TARGET_LINK_LIBRARIES(json_demo json_spirit)
++TARGET_LINK_LIBRARIES(json_demo json_spirit -latomic)
+ 
+diff --git a/json_headers_only_demo/CMakeLists.txt b/json_headers_only_demo/CMakeLists.txt
+index a3c787a..6eae11e 100644
+--- a/json_headers_only_demo/CMakeLists.txt
++++ b/json_headers_only_demo/CMakeLists.txt
+@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ 
+ ADD_EXECUTABLE(json_headers_only_demo ${JSON_HEADERS_ONLY_DEMO_SRCS})
+-TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit)
++TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit -latomic)
+ 
+diff --git a/json_map_demo/CMakeLists.txt b/json_map_demo/CMakeLists.txt
+index 599006a..e3e45e8 100644
+--- a/json_map_demo/CMakeLists.txt
++++ b/json_map_demo/CMakeLists.txt
+@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ 
+ ADD_EXECUTABLE(json_map_demo ${JSON_MAP_DEMO_SRCS})
+-TARGET_LINK_LIBRARIES(json_map_demo json_spirit)
++TARGET_LINK_LIBRARIES(json_map_demo json_spirit -latomic)
+ 
+diff --git a/json_test/CMakeLists.txt b/json_test/CMakeLists.txt
+index 38ffa7f..1ec1365 100644
+--- a/json_test/CMakeLists.txt
++++ b/json_test/CMakeLists.txt
+@@ -11,5 +11,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ 
+ ADD_EXECUTABLE(json_test ${JSON_TEST_SRCS})
+-TARGET_LINK_LIBRARIES(json_test json_spirit)
++TARGET_LINK_LIBRARIES(json_test json_spirit -latomic)
+ 
+-- 
+2.7.4
+
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 2f456bf..c7c1ad1 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"
 
 SRC_URI = "file://json_spirit_v${PV}.zip \
            file://0001-Adjust-the-cmake-files.patch \
+           file://0001-Link-to-libatomic.patch \
 "
 
 S = "${WORKDIR}/json_spirit_v${PV}"
 
 DEPENDS = "boost"
 
-LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
-
 inherit cmake
 
 FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake"
-- 
2.7.4



                 reply	other threads:[~2017-08-30 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504106128-26607-1-git-send-email-liu.ming50@gmail.com \
    --to=liu.ming50@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=peter.x.liu@external.atlascopco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.