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
This commit is contained in:
Boris Gjenero 2012-01-26 20:33:28 -05:00
parent 1230a45a65
commit f4954c4a9b

View file

@ -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 <stdbool.h>
#include <stdio.h>
#include "thread.h"