fix uclibc build with security_flags.inc
v2 cover fix uclibc build with security_flags.inc
v2 adds a new patch to fixup CFLAGS with _remove instead of oe_filter_out, which fixes CFLAGS circular reference build failures introduced in v1 when building for ARM.
Andre McCurdy (4):
uclibc.inc: remove unused UCLIBC_EXTRA_LDFLAGS uclibc.inc: fixup CFLAGS with _remove instead of oe_filter_out uclibc.inc: avoid immediate expansion for UCLIBC_EXTRA_CFLAGS security_flags.inc: clear SECURITY_CFLAGS for uclibc
meta/conf/distro/include/security_flags.inc | 2 ++ meta/recipes-core/uclibc/uclibc.inc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/4 uclibc.inc: remove unused UCLIBC_EXTRA_LDFLAGS
--- meta/recipes-core/uclibc/uclibc.inc | 1 - 1 file changed, 1 deletion(-)
meta/recipes-core/uclibc/uclibc.inc +0 -1
@@ -59,7 +59,6 @@ export V="2" # CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" -UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}" do_compile_prepend () { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
Signature · 1 line
1.9.1
Re: [PATCH 1/4] uclibc.inc: remove unused UCLIBC_EXTRA_LDFLAGS
Quoted 10 lines · Andre McCurdy
Signed-off-by Andre McCurdy <[email protected]>--- meta/recipes-core/uclibc/uclibc.inc | 1 - 1 file changed, 1 deletion(-)meta/recipes-core/uclibc/uclibc.inc +0
-0
meta/recipes-core/uclibc/uclibc.inc export V="2" · line 62
Quoted 5 lines
meta/recipes-core/uclibc/uclibc.inc +0
-1@@ -59,7 +59,6 @@ export V="2" # CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" -UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}"
those variables are part of .config so please make sure that they are really redundant and dont make into .config
Quoted 10 lines
meta/recipes-core/uclibc/uclibc.inc +0
-1do_compile_prepend () { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS --1.9.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 1/4] uclibc.inc: remove unused UCLIBC_EXTRA_LDFLAGS
Quoted 6 lines · Khem Raj
Quoted 5 lines · Andre McCurdy
Signed-off-by Andre McCurdy <[email protected]>--- meta/recipes-core/uclibc/uclibc.inc | 1 - 1 file changed, 1 deletion(-)
Quoted 13 lines
meta/recipes-core/uclibc/uclibc.inc export V="2" · line 62
Quoted 10 lines
meta/recipes-core/uclibc/uclibc.inc +0
-1@@ -59,7 +59,6 @@ export V="2" # CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" -UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}"those variables are part of .config so please make sure that they are really redundant and dont make into .config
UCLIBC_EXTRA_LDFLAGS isn't used anywhere in the recipe and it's not exported via the run.do_configure or run.do_compile scripts, so I think it safe to remove. It's not part of uclibc's .config file.
UCLIBC_EXTRA_CFLAGS is used in the recipe and does need to stay.
Quoted 10 lines
Quoted 10 lines
meta/recipes-core/uclibc/uclibc.inc +0
-1do_compile_prepend () { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS --1.9.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
PATCH v2 2/4 uclibc.inc: fixup CFLAGS with _remove instead of oe_filter_out
In reply to Andre McCurdyNo functional change, but _remove is slightly cleaner and clearer.
--- meta/recipes-core/uclibc/uclibc.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/uclibc/uclibc.inc +2 -1
@@ -57,7 +57,8 @@ export V="2" # -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860 # -CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" +CFLAGS_remove_arm = "-fno-omit-frame-pointer" + UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" do_compile_prepend () {
Signature · 1 line
1.9.1
PATCH v2 3/4 uclibc.inc: avoid immediate expansion for UCLIBC_EXTRA_CFLAGS
In reply to Andre McCurdyIf immediate variable expansion is used, then UCLIBC_EXTRA_CFLAGS can sometimes be derived from a partially expanded value of CFLAGS.
One specific problem case occurs when security_flags.inc is used: CFLAGS is evaluated before the SECURITY_CFLAGS_pn-uclibc over-ride has been applied and therefore UCLIBC_EXTRA_CFLAGS ends up being based on the default SECURITY_CFLAGS instead of the uclibc specific value.
--- meta/recipes-core/uclibc/uclibc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/uclibc/uclibc.inc +1 -1
@@ -59,7 +59,7 @@ export V="2" # CFLAGS_remove_arm = "-fno-omit-frame-pointer" -UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" +UCLIBC_EXTRA_CFLAGS = "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" do_compile_prepend () { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
Signature · 1 line
1.9.1
PATCH v2 4/4 security_flags.inc: clear SECURITY_CFLAGS for uclibc
In reply to Andre McCurdyuclibc fails to build when security_flags.inc is used.
| i686-rdk-linux-uclibc-gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/build-vbox32/tmp/sysroots/vbox32-tcbootstrap -Wl,-EL -Wl,--sort-common -Wl,--sort-section=alignment -m32 -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,now -Wl,--hash-style=gnu -Wl,-z,defs -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.34-git.so -Wl,--whole-archive libc/libc_so.a -Wl,--no-whole-archive ./lib/interp.os ./lib/ld-uClibc.so.0 ./lib/uclibc_nonshared.a /build-vbox32/tmp/sysroots/vbox32-tcbootstrap/usr/lib/i686-rdk-linux-uclibc/4.9.3/libgcc.a | libc/libc_so.a(sigaction.os): In function `__libc_sigaction': | /build-vbox32/tmp/work/core2-32-rdk-linux-uclibc/uclibc/0.9.33+gitAUTOINC+48a0006012-r9/git/libc/sysdeps/linux/i386/sigaction.c:37: undefined reference to `__stack_chk_guard' | /build-vbox32/tmp/work/core2-32-rdk-linux-uclibc/uclibc/0.9.33+gitAUTOINC+48a0006012-r9/git/libc/sysdeps/linux/i386/sigaction.c:49: undefined reference to `__stack_chk_fail_local' | collect2: error: ld returned 1 exit status | make: *** [lib/libc.so] Error 1
Clearing SECURITY_CFLAGS completely may not be the best approach, but it's the approach taken for glibc, so try it for uclibc too.
--- meta/conf/distro/include/security_flags.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/conf/distro/include/security_flags.inc +2 -0
@@ -84,6 +84,8 @@ SECURITY_CFLAGS_pn-python-smartpm = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-tcl = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-tiff = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-uclibc = "" +SECURITY_CFLAGS_pn-uclibc-initial = "" SECURITY_CFLAGS_pn-valgrind = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-webkit-gtk = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-zlib = "${SECURITY_NO_PIE_CFLAGS}"
Signature · 1 line
1.9.1