]> code.ossystems Code Review - openembedded-core.git/commitdiff
tclibc: For newlib and baremetal disable some security features
authorNathan Rossi <nathan@nathanrossi.com>
Mon, 10 Sep 2018 12:44:13 +0000 (12:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Sep 2018 08:05:29 +0000 (09:05 +0100)
With GCCPIE being enabled by default with security_flags.inc the
compiler will by default attempt to compile and link programs as PIE.
The targets that use newlib and baremetal in general do not support PIE
or are otherwise unable to use it due to how embedded targets are
compiled and executed. As such it makes sense to disable PIE by default
for these libc's in order to prevent build failures.

For baremetal tclibc there are no libc features or implementation as
such there is no implementation for the strong stack protector by
default.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/conf/distro/include/tclibc-baremetal.inc
meta/conf/distro/include/tclibc-newlib.inc

index 1bf44c8591daa76300c12422b7a0c9b59e4426d1..b00917913f05dd8ac550efc2ecc1c68450a8b65f 100644 (file)
@@ -28,3 +28,9 @@ TOOLCHAIN_HOST_TASK ?= "packagegroup-cross-canadian-${MACHINE}"
 TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_TARGET_TASK ?= "libgcc-dev"
 TOOLCHAIN_NEED_CONFIGSITE_CACHE_remove = "virtual/${MLPREFIX}libc zlib ncurses"
+
+# disable stack protector by default (no-libc, no protector implementation)
+SECURITY_STACK_PROTECTOR_libc-baremetal = ""
+# disable pie security flags by default
+SECURITY_CFLAGS_libc-baremetal = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS_libc-baremetal = ""
index dc631d8ada6642c16847b4b4837d95ebd61e3ba9..896c0b16d78aab9bfa3b6378b6ecce3db2ad2e74 100644 (file)
@@ -42,3 +42,7 @@ TARGET_OS_arm = "eabi"
 TOOLCHAIN_HOST_TASK ?= "packagegroup-cross-canadian-${MACHINE}"
 TOOLCHAIN_TARGET_TASK ?= "${LIBC_DEPENDENCIES}"
 TOOLCHAIN_NEED_CONFIGSITE_CACHE_remove = "zlib ncurses"
+
+# disable pie security flags by default
+SECURITY_CFLAGS_libc-newlib = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS_libc-newlib = ""