lwp/lwp-2.6-no-longjmp_chk.patch

35 lines
1.0 KiB
Diff

diff -ur lwp-2.6~/src/lwp_ucontext.c lwp-2.6/src/lwp_ucontext.c
--- lwp-2.6~/src/lwp_ucontext.c 2010-03-17 16:32:51.000000000 -0400
+++ lwp-2.6/src/lwp_ucontext.c 2010-04-01 11:38:55.495718223 -0400
@@ -21,9 +21,6 @@
#include <string.h>
#include <unistd.h>
-/* avoid breaking longjmp stack switching */
-#undef _FORTIFY_SOURCE
-#define _FORTIFY_SOURCE 0
#include "lwp_ucontext.h"
/* Some architectures have a stack that grows up instead of down */
diff -ur lwp-2.6~/src/lwp_ucontext.h lwp-2.6/src/lwp_ucontext.h
--- lwp-2.6~/src/lwp_ucontext.h 2008-12-09 15:13:12.000000000 -0500
+++ lwp-2.6/src/lwp_ucontext.h 2010-04-01 11:38:36.160841037 -0400
@@ -21,7 +21,17 @@
#include <config.h>
#endif
+/* work around longjmp_chk */
+#ifdef __USE_FORTIFY_LEVEL
+#define LWP_SAVE_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
+#undef __USE_FORTIFY_LEVEL
#include <setjmp.h>
+#define __USE_FORTIFY_LEVEL LWP_SAVE_USE_FORTIFY_LEVEL
+#undef LWP_SAVE_USE_FORTIFY_LEVEL
+#else
+#include <setjmp.h>
+#endif
+
#include <signal.h>
#include "lwp_stacktrace.h"