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

Martin Kelly mkelly at xevo.com
Tue Mar 28 20:55:41 UTC 2017


On 03/28/2017 01:47 PM, Khem Raj wrote:
>
>
> On 3/28/17 1:37 PM, Andre McCurdy wrote:
>> On Tue, Mar 28, 2017 at 12:33 PM, Martin Kelly <martin at xevo.com> wrote:
>>> From: Martin Kelly <mkelly at xevo.com>
>>>
>>> I tried turning on the Yocto security flags and hit a compilation
>>> error due to gtest not compiling. Adding -fPIC fixes the issue.
>>
>> Since gtest only creates static libraries, compiling everything with
>> -fPIC might not be the correct solution.
>
> it still is going to be linked with a PIE binary then it should be PIC
>

Yes, I should probably clarify that gtest itself compiles just fine, but 
the failure occurs when you try to link against it. As an example from 
the AGL project, dlt-daemon fails to link with security flags turned on, 
with an error message indicating that -fPIC should be added.

More context here:
https://gerrit.automotivelinux.org/gerrit/#/c/8935/


More information about the Openembedded-devel mailing list