From 8c32e90f438b92b4f52b3e942fb60eacd5bec842 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 12 Apr 2023 15:30:04 -0700 Subject: xilinx-standalone.inc: Remove security_flags.inc Inclusion of security_flags.inc lead to a number of problems with the baremetal distributions: *ARM v8* aarch64-xilinx-elf-ld: testA53.elf: error: PHDR segment not covered by LOAD segment aarch64-xilinx-elf-ld: warning: testA53.elf has a LOAD segment with RWX permissions *ARM v7* arm-xilinx-eabi-ld: .../aarch32-xilinx-eabi/usr/lib/thumb/v7-a+fp/hard/crtbegin.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC The configuration that works: export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now" export CPPFLAGS="" Configuration that provides the warnings/errors: export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed " export CPPFLAGS="" The LDFLAGS was introdued by the security_flags.inc, the SECURITY_CFLGAS:class-target ?= "" and SECURITY_LDFLAGS:class-target ?= "" was supposed to prevent this, however the cross compiler is built in the cross or canadian-cross or other context and NOT target. Additionally the SDK environment is configured in the nativesdk environment, so the default values may not match the configured (target) compiler and CFLAGS. Removing security_flags.inc resolves both of these issues, as the security flags don't really do anything on a baremetal configuration, by default, anyway. Signed-off-by: Mark Hatle --- meta-xilinx-standalone/conf/distro/xilinx-standalone.inc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'meta-xilinx-standalone') diff --git a/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc b/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc index 4b51dd1b..f86a5971 100644 --- a/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc +++ b/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc @@ -39,12 +39,8 @@ TOOLCHAIN_HOST_TASK:append:sdkmingw32 = " nativesdk-mingw-w64-winpthreads" # do so. DISABLE_STATIC:class-target ?= "" -SECURITY_CFLAGS:class-target ?= "" -SECURITY_LDFLAGS:class-target ?= "" - require conf/distro/include/no-static-libs.inc require conf/distro/include/yocto-uninative.inc -require conf/distro/include/security_flags.inc INHERIT += "uninative" BB_SIGNATURE_HANDLER ?= "OEEquivHash" -- cgit v1.2.3-54-g00ecf