diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-06-10 07:51:58 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-08 13:34:45 +0100 |
commit | c91314ec160420a320007d552cec6c7da4d54833 (patch) | |
tree | 3e9dc67899c1661dde55711bdbe0c97c6987c6ed /meta/conf | |
parent | a12d9164ead57569269ad6d3e21332e95f73c04f (diff) | |
download | poky-c91314ec160420a320007d552cec6c7da4d54833.tar.gz |
gcc: Introduce a knob to configure gcc to default to PIE
GCCPIE flag which is empty by default adds "--enable-default-pie"
configure option for harderned distros
We do not require to add -fpie -pie flag externally anymore
(From OE-Core rev: 1c7e195c94764d680a12a49b870f04cd58860f81)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf')
-rw-r--r-- | meta/conf/distro/include/security_flags.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc index 38164d08b8..f2eb224a77 100644 --- a/meta/conf/distro/include/security_flags.inc +++ b/meta/conf/distro/include/security_flags.inc | |||
@@ -5,6 +5,8 @@ | |||
5 | # From a Yocto Project perspective, this file is included and tested | 5 | # From a Yocto Project perspective, this file is included and tested |
6 | # in the DISTRO="poky-lsb" configuration. | 6 | # in the DISTRO="poky-lsb" configuration. |
7 | 7 | ||
8 | GCCPIE ?= "--enable-default-pie" | ||
9 | |||
8 | # _FORTIFY_SOURCE requires -O1 or higher, so disable in debug builds as they use | 10 | # _FORTIFY_SOURCE requires -O1 or higher, so disable in debug builds as they use |
9 | # -O0 which then results in a compiler warning. | 11 | # -O0 which then results in a compiler warning. |
10 | lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}" | 12 | lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}" |
@@ -12,7 +14,7 @@ lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE | |||
12 | # Error on use of format strings that represent possible security problems | 14 | # Error on use of format strings that represent possible security problems |
13 | SECURITY_STRINGFORMAT ?= "-Wformat -Wformat-security -Werror=format-security" | 15 | SECURITY_STRINGFORMAT ?= "-Wformat -Wformat-security -Werror=format-security" |
14 | 16 | ||
15 | SECURITY_CFLAGS ?= "-fstack-protector-strong -pie -fpie ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" | 17 | SECURITY_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" |
16 | SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" | 18 | SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" |
17 | 19 | ||
18 | SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now" | 20 | SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now" |