[OE-core] [PATCH 2/4 v3] security_flags.inc: disable -fstack-protector-XXX for valgrind

Khem Raj raj.khem at gmail.com
Fri Dec 18 05:55:42 UTC 2015


> On Dec 17, 2015, at 9:48 PM, Andre McCurdy <armccurdy at gmail.com> wrote:
> 
> On Thu, Dec 17, 2015 at 9:16 PM, Khem Raj <raj.khem at gmail.com> wrote:
>> 
>>> On Dec 17, 2015, at 8:42 PM, Andre McCurdy <armccurdy at gmail.com> wrote:
>>> 
>>> Valgrind (v3.11.0) expects to build with stack protection disabled
>>> and includes -fno-stack-protector in its default CFLAGS. However, the
>>> CFLAGS provided by OE are included on the compiler command line after
>>> the defaults so any -fstack-protector-all / -fstack-protector-strong
>>> option provided by security_flags.inc will cause problems.
>>> 
>>> | .../build-bcm97425vms/tmp/work/mips32el-rdk-linux/valgrind/3.11.0-r0/valgrind-3.11.0/coregrind/m_mallocfree.c:892: undefined reference to `__stack_chk_guard'
>>> | .../build-bcm97425vms/tmp/work/mips32el-rdk-linux/valgrind/3.11.0-r0/valgrind-3.11.0/coregrind/m_mallocfree.c:947: undefined reference to `__stack_chk_fail'
>>> 
>>> Signed-off-by: Andre McCurdy <armccurdy at gmail.com>
>>> ---
>>> meta/conf/distro/include/security_flags.inc | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc
>>> index 14ac0bf..1795750 100644
>>> --- a/meta/conf/distro/include/security_flags.inc
>>> +++ b/meta/conf/distro/include/security_flags.inc
>>> @@ -84,7 +84,7 @@ SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
>>> SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
>>> SECURITY_CFLAGS_pn-tcl = "${SECURITY_NO_PIE_CFLAGS}"
>>> SECURITY_CFLAGS_pn-tiff = "${SECURITY_NO_PIE_CFLAGS}"
>>> -SECURITY_CFLAGS_pn-valgrind = "${SECURITY_NO_PIE_CFLAGS}"
>>> +SECURITY_CFLAGS_pn-valgrind = “"
>> 
>> Can we instead add -lssp to LDFLAGS ?
> 
> Probably. Valgrind deliberately adds -fno-stack-protector to it's own
> CFLAGS though, so by forcing it to use the stack protector you would
> be going against the wishes of the Valgrind developers.

I think you are right in this case.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151217/b6f2e438/attachment-0002.sig>


More information about the Openembedded-core mailing list