summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Gjenero <boris.gjenero@gmail.com>2012-01-26 20:33:28 -0500
committerBoris Gjenero <boris.gjenero@gmail.com>2012-01-26 20:33:28 -0500
commitf4954c4a9bda0edbdc8e93314b713c036c4ebfdd (patch)
tree48c0cb9a170bfae34a13f673c2c0cca28de30bf8
parent1230a45a6581e3799b8c4a4d0310a3e61933a7c3 (diff)
downloadrockbox-f4954c4a9bda0edbdc8e93314b713c036c4ebfdd.tar.gz
rockbox-f4954c4a9bda0edbdc8e93314b713c036c4ebfdd.zip
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
-rw-r--r--firmware/thread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index 5e543c558a..4c15fcc294 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -19,6 +19,15 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22
23#ifdef HAVE_SIGALTSTACK_THREADS
24/*
25 * The sp check in glibc __longjmp_chk() will cause
26 * a fatal error when switching threads via longjmp().
27 */
28#undef _FORTIFY_SOURCE
29#endif
30
22#include <stdbool.h> 31#include <stdbool.h>
23#include <stdio.h> 32#include <stdio.h>
24#include "thread.h" 33#include "thread.h"