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

Martin Kelly mkelly at xevo.com
Tue Mar 28 22:18:22 UTC 2017


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!



More information about the Openembedded-devel mailing list