[oe] [meta-oe][PATCH] gtest: add -fPIC

Andre McCurdy armccurdy at gmail.com
Tue Mar 28 23:34:12 UTC 2017


On Tue, Mar 28, 2017 at 4:14 PM, Khem Raj <raj.khem at gmail.com> wrote:
>
> On Tue, Mar 28, 2017 at 3:14 PM Martin Kelly <mkelly at xevo.com> wrote:
>>
>> On 03/28/2017 02:32 PM, Andre McCurdy wrote:
>> >
>> > Right. So the question is if security flags are enabled (and therefore
>> > -fpie is passed into the gtest build via CFLAGS) then why do you see
>> > an issue?
>> >
>>
>> Looking at this more, I see that I hit the issue in dlt-daemon because
>> it was trying to compile a shared version of gtest, resulting in this
>> error:
>>
>> command:
>> [snip]-g++  -fPIC [snip] -shared -o libgtest.so [snip]
>>
>> out:
>> [snip]/ld: CMakeFiles/gtest.dir/src/gtest-all.cc.o: relocation
>> R_X86_64_PC32 against symbol
>> `_ZTVN7testing8internal17TestEventRepeaterE' can not be used when making
>> a shared object; recompile with -fPIC
>>
>> However, looking at the gtest version in meta-oe, I see only static
>> libraries, as you say. Thus unless we start building shared versions of
>> gtest, it looks like this patch is applicable to dlt-daemon but not
>> gtest, so we can drop it. Thanks!
>
>
> Is there any reason not to build shared version though ?

The cmake build defaults to static libs but support for shared libs
seems to be there too. Maybe just try it and see...

>>
>>
>



More information about the Openembedded-devel mailing list