[oe] [meta-oe] [PATCH] json-spirit: Add -latomic to LDFLAGS

Khem Raj raj.khem at gmail.com
Fri Aug 11 16:01:49 UTC 2017


On Fri, Aug 11, 2017 at 8:52 AM, Randy MacLeod
<randy.macleod at windriver.com> wrote:
> On 2017-08-10 11:58 AM, Khem Raj wrote:
>>
>> On Thu, Aug 10, 2017 at 8:36 AM, Ming Liu <liu.ming50 at gmail.com> wrote:
>>>
>>> Hi, Khem:
>>>
>>> I added that since I observed the error only on a armv5e machine, error
>>> did
>>> not show up on cortexa8/x86_64 machines, so I attempted to guess that
>>> option
>>> would not be always needed, for instance, if some ARCH support atomic
>>> instructions.
>>
>>
>> We should add it for armv5 alone then, for other arches, gcc does provide
>> needed atomics.
>
>
> Is that a design decision for the armv5 BSP or gcc or is it a bug?

Its just missing implementation and applications should have detected that
in configure and taken actions accordingly.

> A pointer to what code determines that would be nice if easy.
>
> ../Randy
>
>>
>>>
>>> //Ming Liu
>>>
>>> 2017-08-10 17:19 GMT+02:00 Khem Raj <raj.khem at gmail.com>:
>>>>
>>>>
>>>> On 8/10/17 8:12 AM, liu.ming50 at gmail.com wrote:
>>>>>
>>>>> From: Ming Liu <peter.x.liu at external.atlascopco.com>
>>>>>
>>>>> This fixes following errors when compiling with clang:
>>>>> | ../json_spirit/libjson_spirit.so.4.0.8: error: undefined reference to
>>>>> '__atomic_load_4'
>>>>> | ../json_spirit/libjson_spirit.so.4.0.8: error: undefined reference to
>>>>> '__atomic_compare_exchange_4'
>>>>> | ../json_spirit/libjson_spirit.so.4.0.8: error: undefined reference to
>>>>> '__atomic_fetch_sub_4'
>>>>> | ../json_spirit/libjson_spirit.so.4.0.8: error: undefined reference to
>>>>> '__atomic_fetch_add_4'
>>>>>
>>>>> Signed-off-by: Ming Liu <peter.x.liu at external.atlascopco.com>
>>>>> ---
>>>>>   meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb | 2 ++
>>>>>   1 file changed, 2 insertions(+)
>>>>>
>>>>> 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 53bbf7e..2f456bf 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
>>>>> @@ -17,6 +17,8 @@ S = "${WORKDIR}/json_spirit_v${PV}"
>>>>>
>>>>>   DEPENDS = "boost"
>>>>>
>>>>> +LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
>>>>
>>>>
>>>> Do we need --as-needed
>>>>
>>>>> +
>>>>>   inherit cmake
>>>>>
>>>>>   FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake"
>>>>>
>>>>
>>>>
>>>
>
>
> --
> # Randy MacLeod. SMTS, Linux, Wind River
> Direct: 613.963.1350 | 350 Terry Fox Drive, Suite 200, Ottawa, ON, Canada,
> K2K 2W5



More information about the Openembedded-devel mailing list