27 Jan 2012 08:59
Fix FS#12559: sigaltstack threads fortify failure
<mailer <at> svn.rockbox.org>
2012-01-27 07:59:10 GMT
2012-01-27 07:59:10 GMT
commit f4954c4a9bda0edbdc8e93314b713c036c4ebfdd
Author: Boris Gjenero <boris.gjenero <at> gmail.com>
Date: Thu Jan 26 20:33:28 2012 -0500
Fix FS#12559: sigaltstack threads fortify failure
Ubuntu defines _FORTIFY_SOURCE=2, which causes glibc longjmp() to check sp
when gcc optimization is enabled. The check does not allow longjmp() to be
used for switching threads and results in a "longjmp causes uninitialized
stack frame" error. This disables the check.
Change-Id: Idb8877b43ce711df880ca88875ba5477445a577a
diff --git a/firmware/thread.c b/firmware/thread.c
index 5e543c5..4c15fcc 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
<at> <at> -19,6 +19,15 <at> <at>
*
****************************************************************************/
#include "config.h"
+
+#ifdef HAVE_SIGALTSTACK_THREADS
+/*
+ * The sp check in glibc __longjmp_chk() will cause
+ * a fatal error when switching threads via longjmp().
+ */
+#undef _FORTIFY_SOURCE
+#endif
+
(Continue reading)
RSS Feed