public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h
@ 2017-11-07 22:38 H.J. Lu
  2017-11-08  8:11 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2017-11-07 22:38 UTC (permalink / raw)
  To: GNU C Library

Verify that sizes, alignments and field offsets of jmp_buf as well as
sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
Since jmp_buf is target specific, jmp_buf-macros.h is added for each
target.  The new target must provides its own jmp_buf-macros.h.

Tested with build-many-glibcs.py.

OK for master?

H.J.
---
	* setjmp/Makefile (tests): Add tst-jmp_buf.
	* setjmp/tst-jmp_buf.c: New file.
	* sysdeps/aarch64/jmp_buf-macros.h: Likewise.
	* sysdeps/alpha/jmp_buf-macros.h: Likewise.
	* sysdeps/arm/jmp_buf-macros.h: Likewise.
	* sysdeps/hppa/jmp_buf-macros.h: Likewise.
	* sysdeps/i386/jmp_buf-macros.h: Likewise.
	* sysdeps/ia64/jmp_buf-macros.h: Likewise.
	* sysdeps/m68k/jmp_buf-macros.h: Likewise.
	* sysdeps/microblaze/jmp_buf-macros.h: Likewise.
	* sysdeps/mips/mips32/jmp_buf-macros.h: Likewise.
	* sysdeps/mips/mips64/n32/jmp_buf-macros.h: Likewise.
	* sysdeps/mips/mips64/n64/jmp_buf-macros.h: Likewise.
	* sysdeps/nios2/jmp_buf-macros.h: Likewise.
	* sysdeps/powerpc/powerpc32/jmp_buf-macros.h: Likewise.
	* sysdeps/powerpc/powerpc64/jmp_buf-macros.h: Likewise.
	* sysdeps/s390/s390-32/jmp_buf-macros.h: Likewise.
	* sysdeps/s390/s390-64/jmp_buf-macros.h: Likewise.
	* sysdeps/sh/jmp_buf-macros.h: Likewise.
	* sysdeps/sparc/sparc32/jmp_buf-macros.h: Likewise.
	* sysdeps/sparc/sparc64/jmp_buf-macros.h: Likewise.
	* sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h: Likewise.
	* sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h: Likewise.
	* sysdeps/tile/tilepro/jmp_buf-macros.h: Likewise.
	* sysdeps/x86_64/64/jmp_buf-macros.h: Likewise.
	* sysdeps/x86_64/x32/jmp_buf-macros.h: Likewise.
---
 setjmp/Makefile                               |  2 +-
 setjmp/tst-jmp_buf.c                          | 60 +++++++++++++++++++++++++++
 sysdeps/aarch64/jmp_buf-macros.h              |  6 +++
 sysdeps/alpha/jmp_buf-macros.h                |  6 +++
 sysdeps/arm/jmp_buf-macros.h                  |  6 +++
 sysdeps/hppa/jmp_buf-macros.h                 |  6 +++
 sysdeps/i386/jmp_buf-macros.h                 |  6 +++
 sysdeps/ia64/jmp_buf-macros.h                 |  6 +++
 sysdeps/m68k/jmp_buf-macros.h                 |  6 +++
 sysdeps/microblaze/jmp_buf-macros.h           |  6 +++
 sysdeps/mips/mips32/jmp_buf-macros.h          |  6 +++
 sysdeps/mips/mips64/n32/jmp_buf-macros.h      |  6 +++
 sysdeps/mips/mips64/n64/jmp_buf-macros.h      |  6 +++
 sysdeps/nios2/jmp_buf-macros.h                |  6 +++
 sysdeps/powerpc/powerpc32/jmp_buf-macros.h    |  6 +++
 sysdeps/powerpc/powerpc64/jmp_buf-macros.h    |  6 +++
 sysdeps/s390/s390-32/jmp_buf-macros.h         |  6 +++
 sysdeps/s390/s390-64/jmp_buf-macros.h         |  6 +++
 sysdeps/sh/jmp_buf-macros.h                   |  6 +++
 sysdeps/sparc/sparc32/jmp_buf-macros.h        |  6 +++
 sysdeps/sparc/sparc64/jmp_buf-macros.h        |  6 +++
 sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h |  6 +++
 sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h |  6 +++
 sysdeps/tile/tilepro/jmp_buf-macros.h         |  6 +++
 sysdeps/x86_64/64/jmp_buf-macros.h            |  6 +++
 sysdeps/x86_64/x32/jmp_buf-macros.h           |  6 +++
 26 files changed, 205 insertions(+), 1 deletion(-)
 create mode 100644 setjmp/tst-jmp_buf.c
 create mode 100644 sysdeps/aarch64/jmp_buf-macros.h
 create mode 100644 sysdeps/alpha/jmp_buf-macros.h
 create mode 100644 sysdeps/arm/jmp_buf-macros.h
 create mode 100644 sysdeps/hppa/jmp_buf-macros.h
 create mode 100644 sysdeps/i386/jmp_buf-macros.h
 create mode 100644 sysdeps/ia64/jmp_buf-macros.h
 create mode 100644 sysdeps/m68k/jmp_buf-macros.h
 create mode 100644 sysdeps/microblaze/jmp_buf-macros.h
 create mode 100644 sysdeps/mips/mips32/jmp_buf-macros.h
 create mode 100644 sysdeps/mips/mips64/n32/jmp_buf-macros.h
 create mode 100644 sysdeps/mips/mips64/n64/jmp_buf-macros.h
 create mode 100644 sysdeps/nios2/jmp_buf-macros.h
 create mode 100644 sysdeps/powerpc/powerpc32/jmp_buf-macros.h
 create mode 100644 sysdeps/powerpc/powerpc64/jmp_buf-macros.h
 create mode 100644 sysdeps/s390/s390-32/jmp_buf-macros.h
 create mode 100644 sysdeps/s390/s390-64/jmp_buf-macros.h
 create mode 100644 sysdeps/sh/jmp_buf-macros.h
 create mode 100644 sysdeps/sparc/sparc32/jmp_buf-macros.h
 create mode 100644 sysdeps/sparc/sparc64/jmp_buf-macros.h
 create mode 100644 sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h
 create mode 100644 sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h
 create mode 100644 sysdeps/tile/tilepro/jmp_buf-macros.h
 create mode 100644 sysdeps/x86_64/64/jmp_buf-macros.h
 create mode 100644 sysdeps/x86_64/x32/jmp_buf-macros.h

diff --git a/setjmp/Makefile b/setjmp/Makefile
index ca80b8ea13..857e0b8d0f 100644
--- a/setjmp/Makefile
+++ b/setjmp/Makefile
@@ -28,7 +28,7 @@ routines	:= setjmp sigjmp bsd-setjmp bsd-_setjmp \
 		   longjmp __longjmp jmp-unwind
 
 tests		:= tst-setjmp jmpbug bug269-setjmp tst-setjmp-fp \
-		   tst-sigsetjmp tst-setjmp-static
+		   tst-sigsetjmp tst-setjmp-static tst-jmp_buf
 tests-static	:= tst-setjmp-static
 
 
diff --git a/setjmp/tst-jmp_buf.c b/setjmp/tst-jmp_buf.c
new file mode 100644
index 0000000000..1b25d85876
--- /dev/null
+++ b/setjmp/tst-jmp_buf.c
@@ -0,0 +1,60 @@
+/* Check jmp_buf sizes, alignments and offsets.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <setjmp.h>
+#include <stddef.h>
+#include <jmp_buf-macros.h>
+
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+
+static int
+do_test (void)
+{
+#define TEST_SIZE(type, size) \
+  _Static_assert (sizeof (type) == size, \
+		  "size of " #type " != " \
+		  STR (size))
+#define TEST_ALIGN(type, align) \
+  _Static_assert (__alignof__ (type) == align , \
+		  "align of " #type " != " \
+		  STR (align))
+#define TEST_OFFSET(type, member, offset) \
+  _Static_assert (offsetof (type, member) == offset, \
+		  "offset of " #member " field of " #type " != " \
+		  STR (offset))
+
+  /* Check if jmp_buf have the expected sizes.  */
+  TEST_SIZE (jmp_buf, JMP_BUF_SIZE);
+  TEST_SIZE (sigjmp_buf, SIGJMP_BUF_SIZE);
+
+  /* Check if jmp_buf have the expected alignments.  */
+  TEST_ALIGN (jmp_buf, JMP_BUF_ALIGN);
+  TEST_ALIGN (sigjmp_buf, SIGJMP_BUF_ALIGN);
+
+  /* Check if internal fields in jmp_buf have the expected offsets.  */
+  TEST_OFFSET (struct __jmp_buf_tag, __mask_was_saved,
+	       MASK_WAS_SAVED_OFFSET);
+  TEST_OFFSET (struct __jmp_buf_tag, __saved_mask,
+	       SAVED_MASK_OFFSET);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/aarch64/jmp_buf-macros.h b/sysdeps/aarch64/jmp_buf-macros.h
new file mode 100644
index 0000000000..608a7ad1f7
--- /dev/null
+++ b/sysdeps/aarch64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 312
+#define SIGJMP_BUF_SIZE 312
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 176
+#define SAVED_MASK_OFFSET 184
diff --git a/sysdeps/alpha/jmp_buf-macros.h b/sysdeps/alpha/jmp_buf-macros.h
new file mode 100644
index 0000000000..b595173e6f
--- /dev/null
+++ b/sysdeps/alpha/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 272
+#define SIGJMP_BUF_SIZE 272
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 136
+#define SAVED_MASK_OFFSET 144
diff --git a/sysdeps/arm/jmp_buf-macros.h b/sysdeps/arm/jmp_buf-macros.h
new file mode 100644
index 0000000000..eb64802525
--- /dev/null
+++ b/sysdeps/arm/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 260
diff --git a/sysdeps/hppa/jmp_buf-macros.h b/sysdeps/hppa/jmp_buf-macros.h
new file mode 100644
index 0000000000..6ede0d6af7
--- /dev/null
+++ b/sysdeps/hppa/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 172
diff --git a/sysdeps/i386/jmp_buf-macros.h b/sysdeps/i386/jmp_buf-macros.h
new file mode 100644
index 0000000000..554bbed309
--- /dev/null
+++ b/sysdeps/i386/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 156
+#define SIGJMP_BUF_SIZE 156
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 24
+#define SAVED_MASK_OFFSET 28
diff --git a/sysdeps/ia64/jmp_buf-macros.h b/sysdeps/ia64/jmp_buf-macros.h
new file mode 100644
index 0000000000..41788657ec
--- /dev/null
+++ b/sysdeps/ia64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 704
+#define SIGJMP_BUF_SIZE 704
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 560
+#define SAVED_MASK_OFFSET 568
diff --git a/sysdeps/m68k/jmp_buf-macros.h b/sysdeps/m68k/jmp_buf-macros.h
new file mode 100644
index 0000000000..2f62ecb4b3
--- /dev/null
+++ b/sysdeps/m68k/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 2
+#define SIGJMP_BUF_ALIGN 2
+#define MASK_WAS_SAVED_OFFSET 156
+#define SAVED_MASK_OFFSET 160
diff --git a/sysdeps/microblaze/jmp_buf-macros.h b/sysdeps/microblaze/jmp_buf-macros.h
new file mode 100644
index 0000000000..9c435f7967
--- /dev/null
+++ b/sysdeps/microblaze/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 216
+#define SIGJMP_BUF_SIZE 216
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 84
+#define SAVED_MASK_OFFSET 88
diff --git a/sysdeps/mips/mips32/jmp_buf-macros.h b/sysdeps/mips/mips32/jmp_buf-macros.h
new file mode 100644
index 0000000000..d46d69ecbd
--- /dev/null
+++ b/sysdeps/mips/mips32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 240
+#define SIGJMP_BUF_SIZE 240
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 104
+#define SAVED_MASK_OFFSET 108
diff --git a/sysdeps/mips/mips64/n32/jmp_buf-macros.h b/sysdeps/mips/mips64/n32/jmp_buf-macros.h
new file mode 100644
index 0000000000..ed0f1232de
--- /dev/null
+++ b/sysdeps/mips/mips64/n32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 152
+#define SAVED_MASK_OFFSET 156
diff --git a/sysdeps/mips/mips64/n64/jmp_buf-macros.h b/sysdeps/mips/mips64/n64/jmp_buf-macros.h
new file mode 100644
index 0000000000..38b5b0636a
--- /dev/null
+++ b/sysdeps/mips/mips64/n64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 176
diff --git a/sysdeps/nios2/jmp_buf-macros.h b/sysdeps/nios2/jmp_buf-macros.h
new file mode 100644
index 0000000000..1cb9cab420
--- /dev/null
+++ b/sysdeps/nios2/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 172
+#define SIGJMP_BUF_SIZE 172
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 40
+#define SAVED_MASK_OFFSET 44
diff --git a/sysdeps/powerpc/powerpc32/jmp_buf-macros.h b/sysdeps/powerpc/powerpc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..11b0a8bb00
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 592
+#define SIGJMP_BUF_SIZE 592
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 448
+#define SAVED_MASK_OFFSET 452
diff --git a/sysdeps/powerpc/powerpc64/jmp_buf-macros.h b/sysdeps/powerpc/powerpc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..d3e0d4e146
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 656
+#define SIGJMP_BUF_SIZE 656
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 512
+#define SAVED_MASK_OFFSET 520
diff --git a/sysdeps/s390/s390-32/jmp_buf-macros.h b/sysdeps/s390/s390-32/jmp_buf-macros.h
new file mode 100644
index 0000000000..0f29ff90d0
--- /dev/null
+++ b/sysdeps/s390/s390-32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 188
+#define SIGJMP_BUF_SIZE 188
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 56
+#define SAVED_MASK_OFFSET 60
diff --git a/sysdeps/s390/s390-64/jmp_buf-macros.h b/sysdeps/s390/s390-64/jmp_buf-macros.h
new file mode 100644
index 0000000000..4e5f348eaf
--- /dev/null
+++ b/sysdeps/s390/s390-64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 280
+#define SIGJMP_BUF_SIZE 280
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 144
+#define SAVED_MASK_OFFSET 152
diff --git a/sysdeps/sh/jmp_buf-macros.h b/sysdeps/sh/jmp_buf-macros.h
new file mode 100644
index 0000000000..b2bc30db5d
--- /dev/null
+++ b/sysdeps/sh/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 192
+#define SIGJMP_BUF_SIZE 192
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 60
+#define SAVED_MASK_OFFSET 64
diff --git a/sysdeps/sparc/sparc32/jmp_buf-macros.h b/sysdeps/sparc/sparc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..388533f88a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 144
+#define SIGJMP_BUF_SIZE 144
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 12
+#define SAVED_MASK_OFFSET 16
diff --git a/sysdeps/sparc/sparc64/jmp_buf-macros.h b/sysdeps/sparc/sparc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..e86afd7b3d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 640
+#define SIGJMP_BUF_SIZE 640
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 496
+#define SAVED_MASK_OFFSET 504
diff --git a/sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h b/sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h
new file mode 100644
index 0000000000..eb64802525
--- /dev/null
+++ b/sysdeps/tile/tilegx/tilegx32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 260
diff --git a/sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h b/sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h
new file mode 100644
index 0000000000..685f9b8236
--- /dev/null
+++ b/sysdeps/tile/tilegx/tilegx64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 264
diff --git a/sysdeps/tile/tilepro/jmp_buf-macros.h b/sysdeps/tile/tilepro/jmp_buf-macros.h
new file mode 100644
index 0000000000..411e62a047
--- /dev/null
+++ b/sysdeps/tile/tilepro/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 260
+#define SIGJMP_BUF_SIZE 260
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 128
+#define SAVED_MASK_OFFSET 132
diff --git a/sysdeps/x86_64/64/jmp_buf-macros.h b/sysdeps/x86_64/64/jmp_buf-macros.h
new file mode 100644
index 0000000000..3ae63ab5c5
--- /dev/null
+++ b/sysdeps/x86_64/64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 72
diff --git a/sysdeps/x86_64/x32/jmp_buf-macros.h b/sysdeps/x86_64/x32/jmp_buf-macros.h
new file mode 100644
index 0000000000..2fa8e9ec38
--- /dev/null
+++ b/sysdeps/x86_64/x32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 68
-- 
2.13.6

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h
  2017-11-07 22:38 [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h H.J. Lu
@ 2017-11-08  8:11 ` Andreas Schwab
  2017-11-08 18:25   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2017-11-08  8:11 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library, H.J. Lu

On Nov 07 2017, "H.J. Lu" <hongjiu.lu@intel.com> wrote:

> Verify that sizes, alignments and field offsets of jmp_buf as well as
> sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
> Since jmp_buf is target specific, jmp_buf-macros.h is added for each
> target.  The new target must provides its own jmp_buf-macros.h.
>
> Tested with build-many-glibcs.py.
>
> OK for master?
>
> H.J.
> ---
> 	* setjmp/Makefile (tests): Add tst-jmp_buf.
> 	* setjmp/tst-jmp_buf.c: New file.

How about putting the tests in include/setjmp.h?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h
  2017-11-08  8:11 ` Andreas Schwab
@ 2017-11-08 18:25   ` H.J. Lu
  2017-11-09  8:38     ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2017-11-08 18:25 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

On Wed, Nov 8, 2017 at 12:11 AM, Andreas Schwab <schwab@suse.de> wrote:
> On Nov 07 2017, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
>
>> Verify that sizes, alignments and field offsets of jmp_buf as well as
>> sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
>> Since jmp_buf is target specific, jmp_buf-macros.h is added for each
>> target.  The new target must provides its own jmp_buf-macros.h.
>>
>> Tested with build-many-glibcs.py.
>>
>> OK for master?
>>
>> H.J.
>> ---
>>       * setjmp/Makefile (tests): Add tst-jmp_buf.
>>       * setjmp/tst-jmp_buf.c: New file.
>
> How about putting the tests in include/setjmp.h?
>

Here is the updated patch.  Tested with build-many-glibcs.py.

Any comments or objections?

Thanks.

-- 
H.J.

[-- Attachment #2: 0001-Add-jmp_buf-macros.h.patch --]
[-- Type: text/x-patch, Size: 17632 bytes --]

From 2e223a989e32f0f95048dbabee0638d49faca6a0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 6 Nov 2017 15:54:04 -0800
Subject: [PATCH 1/2] Add jmp_buf-macros.h

Verify that sizes, alignments and field offsets of jmp_buf as well as
sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
Since jmp_buf is target specific, jmp_buf-macros.h is added for each
Linux target.  A new target must provides its own jmp_buf-macros.h.

TODO: Hurd needs to provide a jmp_buf-macros.h.

Tested with build-many-glibcs.py.

	* include/setjmp.h [!_ISOMAC]: Include <stddef.h> and
	<jmp_buf-macros.h>.
	[!_ISOMAC] (STR_HELPER): New.
	[!_ISOMAC] (STR): Likewise.
	[!_ISOMAC] (TEST_SIZE): Likewise.
	[!_ISOMAC] (TEST_ALIGN): Likewise.
	[!_ISOMAC] (TEST_OFFSET): Likewise.
	[!_ISOMAC] Add _Static_assert to check sizes, alignments and
	field offsets of jmp_buf as well as sigjmp_buf.
	* sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
---
 include/setjmp.h                                   | 34 ++++++++++++++++++++++
 sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h   |  6 ++++
 sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h     |  6 ++++
 sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h       |  6 ++++
 sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h      |  6 ++++
 sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h      |  6 ++++
 sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h      |  6 ++++
 sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h      |  6 ++++
 .../unix/sysv/linux/microblaze/jmp_buf-macros.h    |  6 ++++
 .../unix/sysv/linux/mips/mips32/jmp_buf-macros.h   |  6 ++++
 .../sysv/linux/mips/mips64/n32/jmp_buf-macros.h    |  6 ++++
 .../sysv/linux/mips/mips64/n64/jmp_buf-macros.h    |  6 ++++
 sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h     |  6 ++++
 .../sysv/linux/powerpc/powerpc32/jmp_buf-macros.h  |  6 ++++
 .../sysv/linux/powerpc/powerpc64/jmp_buf-macros.h  |  6 ++++
 .../unix/sysv/linux/s390/s390-32/jmp_buf-macros.h  |  6 ++++
 .../unix/sysv/linux/s390/s390-64/jmp_buf-macros.h  |  6 ++++
 sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h        |  6 ++++
 .../unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h |  6 ++++
 .../unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h |  6 ++++
 .../linux/tile/tilegx/tilegx32/jmp_buf-macros.h    |  6 ++++
 .../linux/tile/tilegx/tilegx64/jmp_buf-macros.h    |  6 ++++
 .../unix/sysv/linux/tile/tilepro/jmp_buf-macros.h  |  6 ++++
 sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h |  6 ++++
 .../unix/sysv/linux/x86_64/x32/jmp_buf-macros.h    |  6 ++++
 25 files changed, 178 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h

diff --git a/include/setjmp.h b/include/setjmp.h
index c234287515..f1b19f5ceb 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -31,6 +31,40 @@ libc_hidden_proto (__sigsetjmp)
 # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
 extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden;
 # endif
+
+/* Check jmp_buf sizes, alignments and offsets.  */
+# include <stddef.h>
+# include <jmp_buf-macros.h>
+
+# define STR_HELPER(x) #x
+# define STR(x) STR_HELPER(x)
+
+# define TEST_SIZE(type, size) \
+  _Static_assert (sizeof (type) == size, \
+		  "size of " #type " != " \
+		  STR (size))
+# define TEST_ALIGN(type, align) \
+  _Static_assert (__alignof__ (type) == align , \
+		  "align of " #type " != " \
+		  STR (align))
+# define TEST_OFFSET(type, member, offset) \
+  _Static_assert (offsetof (type, member) == offset, \
+		  "offset of " #member " field of " #type " != " \
+		  STR (offset))
+
+/* Check if jmp_buf have the expected sizes.  */
+TEST_SIZE (jmp_buf, JMP_BUF_SIZE);
+TEST_SIZE (sigjmp_buf, SIGJMP_BUF_SIZE);
+
+/* Check if jmp_buf have the expected alignments.  */
+TEST_ALIGN (jmp_buf, JMP_BUF_ALIGN);
+TEST_ALIGN (sigjmp_buf, SIGJMP_BUF_ALIGN);
+
+/* Check if internal fields in jmp_buf have the expected offsets.  */
+TEST_OFFSET (struct __jmp_buf_tag, __mask_was_saved,
+	     MASK_WAS_SAVED_OFFSET);
+TEST_OFFSET (struct __jmp_buf_tag, __saved_mask,
+	     SAVED_MASK_OFFSET);
 #endif
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h
new file mode 100644
index 0000000000..608a7ad1f7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 312
+#define SIGJMP_BUF_SIZE 312
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 176
+#define SAVED_MASK_OFFSET 184
diff --git a/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h
new file mode 100644
index 0000000000..b595173e6f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 272
+#define SIGJMP_BUF_SIZE 272
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 136
+#define SAVED_MASK_OFFSET 144
diff --git a/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h
new file mode 100644
index 0000000000..eb64802525
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 260
diff --git a/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h
new file mode 100644
index 0000000000..6ede0d6af7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 172
diff --git a/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h
new file mode 100644
index 0000000000..554bbed309
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 156
+#define SIGJMP_BUF_SIZE 156
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 24
+#define SAVED_MASK_OFFSET 28
diff --git a/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h
new file mode 100644
index 0000000000..41788657ec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 704
+#define SIGJMP_BUF_SIZE 704
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 560
+#define SAVED_MASK_OFFSET 568
diff --git a/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h
new file mode 100644
index 0000000000..2f62ecb4b3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 2
+#define SIGJMP_BUF_ALIGN 2
+#define MASK_WAS_SAVED_OFFSET 156
+#define SAVED_MASK_OFFSET 160
diff --git a/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h
new file mode 100644
index 0000000000..9c435f7967
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 216
+#define SIGJMP_BUF_SIZE 216
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 84
+#define SAVED_MASK_OFFSET 88
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h
new file mode 100644
index 0000000000..d46d69ecbd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 240
+#define SIGJMP_BUF_SIZE 240
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 104
+#define SAVED_MASK_OFFSET 108
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h
new file mode 100644
index 0000000000..ed0f1232de
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 288
+#define SIGJMP_BUF_SIZE 288
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 152
+#define SAVED_MASK_OFFSET 156
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h
new file mode 100644
index 0000000000..38b5b0636a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 304
+#define SIGJMP_BUF_SIZE 304
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 168
+#define SAVED_MASK_OFFSET 176
diff --git a/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h
new file mode 100644
index 0000000000..1cb9cab420
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 172
+#define SIGJMP_BUF_SIZE 172
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 40
+#define SAVED_MASK_OFFSET 44
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..11b0a8bb00
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 592
+#define SIGJMP_BUF_SIZE 592
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 448
+#define SAVED_MASK_OFFSET 452
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..d3e0d4e146
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 656
+#define SIGJMP_BUF_SIZE 656
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 512
+#define SAVED_MASK_OFFSET 520
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h
new file mode 100644
index 0000000000..0f29ff90d0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 188
+#define SIGJMP_BUF_SIZE 188
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 56
+#define SAVED_MASK_OFFSET 60
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h
new file mode 100644
index 0000000000..4e5f348eaf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 280
+#define SIGJMP_BUF_SIZE 280
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 144
+#define SAVED_MASK_OFFSET 152
diff --git a/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h
new file mode 100644
index 0000000000..b2bc30db5d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 192
+#define SIGJMP_BUF_SIZE 192
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 60
+#define SAVED_MASK_OFFSET 64
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h
new file mode 100644
index 0000000000..388533f88a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 144
+#define SIGJMP_BUF_SIZE 144
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 12
+#define SAVED_MASK_OFFSET 16
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h
new file mode 100644
index 0000000000..e86afd7b3d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 640
+#define SIGJMP_BUF_SIZE 640
+#define JMP_BUF_ALIGN 16
+#define SIGJMP_BUF_ALIGN 16
+#define MASK_WAS_SAVED_OFFSET 496
+#define SAVED_MASK_OFFSET 504
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h
new file mode 100644
index 0000000000..eb64802525
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 260
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h
new file mode 100644
index 0000000000..685f9b8236
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 392
+#define SIGJMP_BUF_SIZE 392
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 256
+#define SAVED_MASK_OFFSET 264
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h
new file mode 100644
index 0000000000..411e62a047
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 260
+#define SIGJMP_BUF_SIZE 260
+#define JMP_BUF_ALIGN 4
+#define SIGJMP_BUF_ALIGN 4
+#define MASK_WAS_SAVED_OFFSET 128
+#define SAVED_MASK_OFFSET 132
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h
new file mode 100644
index 0000000000..3ae63ab5c5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 72
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h
new file mode 100644
index 0000000000..2fa8e9ec38
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h
@@ -0,0 +1,6 @@
+#define JMP_BUF_SIZE 200
+#define SIGJMP_BUF_SIZE 200
+#define JMP_BUF_ALIGN 8
+#define SIGJMP_BUF_ALIGN 8
+#define MASK_WAS_SAVED_OFFSET 64
+#define SAVED_MASK_OFFSET 68
-- 
2.13.6


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h
  2017-11-08 18:25   ` H.J. Lu
@ 2017-11-09  8:38     ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2017-11-09  8:38 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

LGTM.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-09  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 22:38 [PATCH 1/2] Add tst-jmp_buf.c and jmp_buf-macros.h H.J. Lu
2017-11-08  8:11 ` Andreas Schwab
2017-11-08 18:25   ` H.J. Lu
2017-11-09  8:38     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).