diff options
Diffstat (limited to 'poky/meta/conf/distro/include/security_flags.inc')
-rw-r--r-- | poky/meta/conf/distro/include/security_flags.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poky/meta/conf/distro/include/security_flags.inc b/poky/meta/conf/distro/include/security_flags.inc index 4e64eb99f..f996ca9be 100644 --- a/poky/meta/conf/distro/include/security_flags.inc +++ b/poky/meta/conf/distro/include/security_flags.inc @@ -10,7 +10,9 @@ GCCPIE ?= "--enable-default-pie" # _FORTIFY_SOURCE requires -O1 or higher, so disable in debug builds as they use # -O0 which then results in a compiler warning. -lcl_maybe_fortify ?= "${@oe.utils.conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}" +OPTLEVEL = "${@bb.utils.filter('SELECTED_OPTIMIZATION', '-O0 -O1 -O2 -O3 -Ofast -Og -Os -Oz -O', d)}" + +lcl_maybe_fortify ?= "${@oe.utils.conditional('OPTLEVEL','-O0','','${OPTLEVEL} -D_FORTIFY_SOURCE=2',d)}" # Error on use of format strings that represent possible security problems SECURITY_STRINGFORMAT ?= "-Wformat -Wformat-security -Werror=format-security" |