On Tue, Mar 28, 2017 at 2:17 PM, Martin Kelly <[email protected]> wrote:
> On 03/28/2017 02:05 PM, Andre McCurdy wrote:
>> On Tue, Mar 28, 2017 at 1:55 PM, Martin Kelly <[email protected]> wrote:
>>> 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 <[email protected]> wrote:
>>>>>> From: Martin Kelly <[email protected]>
>>>>>>
>>>>>> 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
>>
>> Wouldn't compiling all gtest objects with -fpie work in that case too?
>
> I am no expert in this, but from the gcc manpage, it looks like -fPIE will
> work only when linking with executables, while -fPIC will work in either
> case.

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?

> Thus I suppose it depends on whether we want to support linking gtest
> against a library.

If gtest needs to support linking against an .so then it would need
-fPIC, regardless of any security flags. That seems like a separate
question.
-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to