diff --git a/bits/wordsize.h b/bits/wordsize.h
index 9ef0e85..2ebecd6 100644
--- a/bits/wordsize.h
+++ b/bits/wordsize.h
@@ -1 +1,28 @@
Â #error "This file must be written based on the data type sizes of the target"
+
+/* The following entries are a template for what defines should be in the
+Â Â Â wordsize.h header file for a target.Â Â */
+
+/* Bits per word (size of CPU register).Â Â */
+#define __WORDSIZE
+
+/* Set to the size of the f_fsid field in the statvfs and statvfs64 structs.
+Â Â Â In most cases this is the same as __WORDSIZE but some 32 bit hosts may set
+Â Â Â it to 64.Â Â */
+#define __SYSCALL_WORDSIZE
+
+/* Set to 1 if ssize_t is type 'unsigned long' instead of type 'unsigned int'
+Â Â Â so that SIZE_MAX is defined as an unsigned long constant instead of an
+Â Â Â unsigned int constant.Â Â Set to 0 if ssize_t is 'unsigned int'.Â Â */
+#define __WORDSIZE32_SIZE_ULONG
+
+/* Set to 1 if ptrdiff_t is type 'long' instead of type 'int' so that
+Â Â Â PTRDIFF_MIN and PTRDIFF_MAX are defined as long constants instead of
+Â Â Â int constants.Â Â Set to 0 if ptrdiff_t is type 'int'.Â Â */
+#define __WORDSIZE32_PTRDIFF_LONG
+
+/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in
+Â Â Â struct lastlog and struct utmp{,x} on 64-bit ports.Â Â This may be done in
+Â Â Â order to make 64-bit ports compatible with 32-bit ports.Â Â Set to 0 for
+Â Â Â 64-bit ports where the time types are 64-bits or for any 32-bit ports.Â Â */
+#define __WORDSIZE_TIME64_COMPAT32
diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index e69de29..c907986 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -0,0 +1,31 @@
+/* Determine the wordsize from the preprocessor defines.
+
+Â Â Â Copyright (C) 2016 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
+Â Â Â &lt;<a rel="nofollow" href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.Â Â */
+
+#ifdef __LP64__
+# define __WORDSIZE			64
+# define __WORDSIZE32_SIZE_ULONG	0
+# define __WORDSIZE32_PTRDIFF_LONG	0
+#else
+# define __WORDSIZE			32
+# define __WORDSIZE32_SIZE_ULONG	1
+# define __WORDSIZE32_PTRDIFF_LONG	1
+#endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 5428dbc..8e4347c 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -249,8 +249,13 @@ typedef unsigned long long int	uintmax_t;
Â #Â Â define PTRDIFF_MIN		(-9223372036854775807L-1)
Â #Â Â define PTRDIFF_MAX		(9223372036854775807L)
Â # else
-#Â Â define PTRDIFF_MIN		(-2147483647-1)
-#Â Â define PTRDIFF_MAX		(2147483647)
+#Â Â if __WORDSIZE32_PTRDIFF_LONG
+#Â Â Â define PTRDIFF_MIN		(-2147483647L-1)
+#Â Â Â define PTRDIFF_MAX		(2147483647L)
+#Â Â else
+#Â Â Â define PTRDIFF_MIN		(-2147483647-1)
+#Â Â Â define PTRDIFF_MAX		(2147483647)
+#Â Â endif
Â # endif
Â 
Â /* Limits of `sig_atomic_t'.Â Â */
@@ -261,7 +266,7 @@ typedef unsigned long long int	uintmax_t;
Â # if __WORDSIZE == 64
Â #Â Â define SIZE_MAX		(18446744073709551615UL)
Â # else
-#Â Â ifdef __WORDSIZE32_SIZE_ULONG
+#Â Â if __WORDSIZE32_SIZE_ULONG
Â #Â Â Â define SIZE_MAX		(4294967295UL)
Â #Â Â else
Â #Â Â Â define SIZE_MAX		(4294967295U)
diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index 2a1ffcb..bce1a7b 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -35,7 +35,7 @@
Â Â Â Â previous logins.Â Â */
Â struct lastlog
Â Â Â {
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
Â Â Â Â Â int32_t ll_time;
Â #else
Â Â Â Â Â __time_t ll_time;
@@ -68,7 +68,7 @@ struct utmp
Â /* The ut_session and ut_tv fields must be the same size when compiled
Â Â Â Â 32- and 64-bit.Â Â This allows data files and shared memory to be
Â Â Â Â shared between 32- and 64-bit applications.Â Â */
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
Â Â Â int32_t ut_session;		/* Session ID, used for windowing.Â Â */
Â Â Â struct
Â Â Â {
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index b41548b..a438660 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -66,7 +66,7 @@ struct utmpx
Â /* The fields ut_session and ut_tv must be the same size when compiled
Â Â Â Â 32- and 64-bit.Â Â This allows files and shared memory to be shared
Â Â Â Â between 32- and 64-bit applications.Â Â */
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
Â Â Â __int32_t ut_session;		/* Session ID, used for windowing.Â Â */
Â Â Â struct
Â Â Â {
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
index bc90435..6d476ba 100644
--- a/sysdeps/mips/bits/wordsize.h
+++ b/sysdeps/mips/bits/wordsize.h
@@ -17,7 +17,13 @@
Â 
Â #include <sgidefs.h>
Â 
-#define __WORDSIZE	_MIPS_SZPTR
+#define __WORDSIZE			_MIPS_SZPTR
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+
Â #if _MIPS_SIM == _ABI64
Â # define __WORDSIZE_TIME64_COMPAT32	1
+#else
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h
index f31ac9a..f08ab26 100644
--- a/sysdeps/powerpc/powerpc32/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h
@@ -5,4 +5,9 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h
index f31ac9a..f08ab26 100644
--- a/sysdeps/powerpc/powerpc64/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h
@@ -5,4 +5,9 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h
index da791fa..7ac7e6b 100644
--- a/sysdeps/s390/s390-32/bits/wordsize.h
+++ b/sysdeps/s390/s390-32/bits/wordsize.h
@@ -2,11 +2,16 @@
Â 
Â #if defined __s390x__
Â # define __WORDSIZE	64
+# define __WORDSIZE32_SIZE_ULONGÂ Â Â Â Â Â Â 0
Â #else
Â # define __WORDSIZE	32
Â # define __WORDSIZE32_SIZE_ULONGÂ Â Â Â Â Â Â 1
Â #endif
Â 
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_PTRDIFF_LONGÂ Â Â Â Â Â 0
+#define __WORDSIZE_TIME64_COMPAT32Â Â Â Â Â 0
+
Â #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
Â 
Â /* Signal that we didn't used to have a `long double'. The changes all
diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h
index da791fa..7ac7e6b 100644
--- a/sysdeps/s390/s390-64/bits/wordsize.h
+++ b/sysdeps/s390/s390-64/bits/wordsize.h
@@ -2,11 +2,16 @@
Â 
Â #if defined __s390x__
Â # define __WORDSIZE	64
+# define __WORDSIZE32_SIZE_ULONGÂ Â Â Â Â Â Â 0
Â #else
Â # define __WORDSIZE	32
Â # define __WORDSIZE32_SIZE_ULONGÂ Â Â Â Â Â Â 1
Â #endif
Â 
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_PTRDIFF_LONGÂ Â Â Â Â Â 0
+#define __WORDSIZE_TIME64_COMPAT32Â Â Â Â Â 0
+
Â #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
Â 
Â /* Signal that we didn't used to have a `long double'. The changes all
diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h
index d8fd1a5..73a3b7c 100644
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -5,4 +5,9 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h
index d8fd1a5..73a3b7c 100644
--- a/sysdeps/sparc/sparc64/bits/wordsize.h
+++ b/sysdeps/sparc/sparc64/bits/wordsize.h
@@ -5,4 +5,9 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/tile/tilegx/bits/wordsize.h b/sysdeps/tile/tilegx/bits/wordsize.h
index 5d4e4b4..f5db53a 100644
--- a/sysdeps/tile/tilegx/bits/wordsize.h
+++ b/sysdeps/tile/tilegx/bits/wordsize.h
@@ -5,4 +5,9 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
+
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
diff --git a/sysdeps/tile/tilepro/bits/wordsize.h b/sysdeps/tile/tilepro/bits/wordsize.h
index da587a2..e1f21c9 100644
--- a/sysdeps/tile/tilepro/bits/wordsize.h
+++ b/sysdeps/tile/tilepro/bits/wordsize.h
@@ -1,3 +1,7 @@
Â /* Determine the wordsize from the preprocessor defines.Â Â */
Â 
-#define __WORDSIZE	32
+#define __WORDSIZE			32
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
index 51fc433..e1a3cdb 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
@@ -16,6 +16,10 @@
Â Â Â Â <http://www.gnu.org/licenses/>.Â Â */
Â 
Â #define __WORDSIZE	64
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+#define __WORDSIZE_TIME64_COMPAT32	0
Â 
Â #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
Â 
diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h
index 9244401..fcdd2cd 100644
--- a/sysdeps/unix/sysv/linux/bits/statvfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statvfs.h
@@ -21,8 +21,7 @@
Â 
Â #include <bits/types.h>Â Â /* For __fsblkcnt_t and __fsfilcnt_t.Â Â */
Â 
-#if (__WORDSIZE == 32 \
-Â Â Â Â Â && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+#if (__WORDSIZE == 32 && __SYSCALL_WORDSIZE == 32)
Â #define _STATVFSBUF_F_UNUSED
Â #endif
Â 
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index 3e8a1e0..aaec974 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -5,8 +5,13 @@
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â #else
Â # define __WORDSIZE	32
+# define __WORDSIZE_TIME64_COMPAT32	0
Â #endif
Â 
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+
Â #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
Â 
Â /* Signal the glibc ABI didn't used to have a `long double'.
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
index 2d958d2..5df97ab 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
@@ -6,6 +6,11 @@
Â # define __WORDSIZE	32
Â #endif
Â 
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+
Â #if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
Â 
Â # if __WORDSIZE == 32
diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h
index 2aa16bc..3454d7f 100644
--- a/sysdeps/wordsize-32/bits/wordsize.h
+++ b/sysdeps/wordsize-32/bits/wordsize.h
@@ -15,4 +15,8 @@
Â Â Â Â License along with the GNU C Library; if not, see
Â Â Â Â <http://www.gnu.org/licenses/>.Â Â */
Â 
-#define __WORDSIZE	32
+#define __WORDSIZE			32
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h
index 0944f9e..5a4b6c5 100644
--- a/sysdeps/wordsize-64/bits/wordsize.h
+++ b/sysdeps/wordsize-64/bits/wordsize.h
@@ -15,4 +15,8 @@
Â Â Â Â License along with the GNU C Library; if not, see
Â Â Â Â <http://www.gnu.org/licenses/>.Â Â */
Â 
-#define __WORDSIZE	64
+#define __WORDSIZE			64
+#define __SYSCALL_WORDSIZE		__WORDSIZE
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+#define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h
index e25af28..0834c13 100644
--- a/sysdeps/x86/bits/wordsize.h
+++ b/sysdeps/x86/bits/wordsize.h
@@ -6,8 +6,14 @@
Â # define __WORDSIZE	32
Â #endif
Â 
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
+
Â #ifdef __x86_64__
Â # define __WORDSIZE_TIME64_COMPAT32	1
Â /* Both x86-64 and x32 use the 64-bit system call interface.Â Â */
Â # define __SYSCALL_WORDSIZE		64
+#else
+# define _WORDSIZE_TIME64_COMPAT32	0
+# define __SYSCALL_WORDSIZE		32
Â #endif
