[Buildroot] [git commit] ipmiutil: fix stack protector test

Peter Korsgaard peter at korsgaard.com
Tue Oct 27 21:10:09 UTC 2015


commit: http://git.buildroot.net/buildroot/commit/?id=9d90d4e8237cdc2c17c2e606fab27cdccf8c373f
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Add a patch that corrects detection of toolchain stack protector support when
libssp is missing.

Fixes:
http://autobuild.buildroot.net/results/497/497d2739c27ce0dcf91bdf2f87c02fc169ba9071/
http://autobuild.buildroot.net/results/f71/f71a4bbca2505fcacb396bcc643c7152d87b5283/
http://autobuild.buildroot.net/results/85d/85da63d49086f8cc62e2c67632dfdc39d7702169/

and more.

Signed-off-by: Baruch Siach <baruch at tkos.co.il>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 ...003-configure.ac-fix-stack-protector-test.patch |   45 ++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/package/ipmiutil/0003-configure.ac-fix-stack-protector-test.patch b/package/ipmiutil/0003-configure.ac-fix-stack-protector-test.patch
new file mode 100644
index 0000000..d6ad604
--- /dev/null
+++ b/package/ipmiutil/0003-configure.ac-fix-stack-protector-test.patch
@@ -0,0 +1,45 @@
+From: Baruch Siach <baruch at tkos.co.il>
+Date: Tue, 27 Oct 2015 13:58:24 +0200
+Subject: [PATCH] configure.ac: fix stack protector test
+
+gcc does not generate stack protection check code for function that does not
+use its stack. Some toolchain (most notable uClibc based) accept the
+-fstack-protector option, but don't provide libssp. The current test will
+incorrectly identify this case, leading to link failures like:
+
+ipmiutil.o: In function `main':
+ipmiutil.c:(.text.startup+0x1c0): undefined reference to
+`__stack_chk_fail_local'
+ialarms.o: In function `get_alarms_picmg':
+ialarms.c:(.text+0x1c5): undefined reference to `__stack_chk_fail_local'
+ialarms.o: In function `.L46':
+ialarms.c:(.text+0x362): undefined reference to `__stack_chk_fail_local'
+ialarms.o: In function `get_enc_leds':
+ialarms.c:(.text+0x45f): undefined reference to `__stack_chk_fail_local'
+
+Add stack usage code to the test to correctly identify missing libssp.
+
+Patch status: sent upstream
+(http://sourceforge.net/p/ipmiutil/mailman/message/34572536/)
+
+Signed-off-by: Baruch Siach <baruch at tkos.co.il>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 41b6ea89167a..f3f60fb9ff69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -334,7 +334,7 @@ else
+         rm -f $tmpc $tmpo >/dev/null 2>&1
+ 	echo $ECHO_N "checking compile fortify flags ... $ECHO_C"
+ 	cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
+-	echo "int main() { return(1); }" >$tmpc
++	echo "int main() { alloca(100); return(1); }" >$tmpc
+ 	$CC -o $tmpo $cfhard $tmpc  >/dev/null 2>&1
+ 	if test $? -ne 0 ; then
+ 	   cfhard=
+-- 
+2.6.1
+


More information about the buildroot mailing list