From f4954c4a9bda0edbdc8e93314b713c036c4ebfdd Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Thu, 26 Jan 2012 20:33:28 -0500 Subject: 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 --- firmware/thread.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'firmware/thread.c') 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 @@ * ****************************************************************************/ #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 + #include #include #include "thread.h" -- cgit v1.2.3