Blame SOURCES/glibc-rh1073667.patch

147e83
commit e39adf43c7d1979884dd304ed1250baf1f78fadc
147e83
Author: Andreas Schwab <schwab@suse.de>
147e83
Date:   Mon May 20 10:19:31 2013 +0200
147e83
147e83
    AArch64: Don't clobber argument for tail call to __sigjmp_save in sigsetjmp
147e83
147e83
diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
147e83
index cff81c7..10e0709 100644
147e83
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
147e83
+++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
147e83
@@ -44,8 +44,14 @@ ENTRY (__sigsetjmp)
147e83
 	stp	d10, d11, [x0, #JB_D10<<3]
147e83
 	stp	d12, d13, [x0, #JB_D12<<3]
147e83
 	stp	d14, d15, [x0, #JB_D14<<3]
147e83
-	mov	x1,  sp
147e83
-	str	x1,  [x0, #JB_SP<<3]
147e83
+	mov	x2,  sp
147e83
+	str	x2,  [x0, #JB_SP<<3]
147e83
+#if defined NOT_IN_libc && defined IS_IN_rtld
147e83
+	/* In ld.so we never save the signal mask */
147e83
+	mov	w0, #0
147e83
+	RET
147e83
+#else
147e83
 	b	C_SYMBOL_NAME(__sigjmp_save)
147e83
+#endif
147e83
 END (__sigsetjmp)
147e83
 hidden_def (__sigsetjmp)
147e83
diff --git glibc-2.17-c758a686/setjmp/Makefile glibc-2.17-c758a686/setjmp/Makefile
147e83
index 6124333..913359c 100644
147e83
--- glibc-2.17-c758a686/setjmp/Makefile
147e83
+++ glibc-2.17-c758a686/setjmp/Makefile
147e83
@@ -25,7 +25,8 @@ headers	:= setjmp.h bits/setjmp.h bits/setjmp2.h
147e83
 routines	:= setjmp sigjmp bsd-setjmp bsd-_setjmp \
147e83
 		   longjmp __longjmp jmp-unwind
147e83
 
147e83
-tests		:= tst-setjmp jmpbug bug269-setjmp
147e83
+tests		:= tst-setjmp jmpbug bug269-setjmp \
147e83
+		   tst-sigsetjmp
147e83
 
147e83
 
147e83
 include ../Rules
147e83
diff --git glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c
147e83
new file mode 100644
147e83
index 0000000..467c26a
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c
147e83
@@ -0,0 +1,44 @@
147e83
+/* Copyright (C) 2013 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+/* Test case for BZ #15493 */
147e83
+
147e83
+#include <stdlib.h>
147e83
+#include <signal.h>
147e83
+#include <setjmp.h>
147e83
+
147e83
+static int
147e83
+do_test (void)
147e83
+{
147e83
+  sigjmp_buf sj;
147e83
+  sigset_t m;
147e83
+
147e83
+  sigemptyset (&m);
147e83
+  sigprocmask (SIG_SETMASK, &m, NULL);
147e83
+  if (sigsetjmp (sj, 0) == 0)
147e83
+    {
147e83
+      sigaddset (&m, SIGUSR1);
147e83
+      sigprocmask (SIG_SETMASK, &m, NULL);
147e83
+      siglongjmp (sj, 1);
147e83
+      return EXIT_FAILURE;
147e83
+    }
147e83
+  sigprocmask (SIG_SETMASK, NULL, &m);
147e83
+  return sigismember (&m, SIGUSR1) ? EXIT_SUCCESS : EXIT_FAILURE;
147e83
+}
147e83
+
147e83
+#define TEST_FUNCTION do_test ()
147e83
+#include "../test-skeleton.c"