public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
@ 2020-04-01 16:54 Alistair Francis
  2020-04-01 17:54 ` Vineet Gupta
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alistair Francis @ 2020-04-01 16:54 UTC (permalink / raw)
  To: libc-alpha; +Cc: alistair23, Alistair Francis

Update the default typesizes.h to match the new kernel sizes for 32-bit
architectures with a 64-bit time_t and friends. This follows the sizes
used for RV32 which is a y2038 safe architecture added after Linux 5.1.
---
 .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index 4fb246ac74..05a6f6d1e5 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -24,33 +24,46 @@
 #ifndef	_BITS_TYPESIZES_H
 #define	_BITS_TYPESIZES_H	1
 
-/* See <bits/types.h> for the meaning of these macros.  This file exists so
-   that <bits/types.h> need not vary across different GNU platforms.  */
+/* See <bits/types.h> for the meaning of these macros.	This file exists so
+	 that <bits/types.h> need not vary across different GNU platforms.	*/
+#if __TIMESIZE == 64 && __WORDSIZE == 32
+/* This is the "new" y2038 types defined for architectures added after
+ * the 5.1 kernel	*/
+# define __INO_T_TYPE		__UQUAD_TYPE
+# define __OFF_T_TYPE		__SQUAD_TYPE
+# define __RLIM_T_TYPE		__UQUAD_TYPE
+# define __BLKCNT_T_TYPE	__SQUAD_TYPE
+# define __FSBLKCNT_T_TYPE	__UQUAD_TYPE
+# define __FSFILCNT_T_TYPE	__UQUAD_TYPE
+# define __TIME_T_TYPE		__SQUAD_TYPE
+# define __SUSECONDS_T_TYPE	__SQUAD_TYPE
+#else
+# define __INO_T_TYPE		__ULONGWORD_TYPE
+# define __OFF_T_TYPE		__SLONGWORD_TYPE
+# define __RLIM_T_TYPE		__ULONGWORD_TYPE
+# define __BLKCNT_T_TYPE	__SLONGWORD_TYPE
+# define __FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+# define __FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+# define __TIME_T_TYPE		__SLONGWORD_TYPE
+# define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#endif
 
 #define __DEV_T_TYPE		__UQUAD_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
-#define __INO_T_TYPE		__ULONGWORD_TYPE
 #define __INO64_T_TYPE		__UQUAD_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #define __NLINK_T_TYPE		__U32_TYPE
-#define __OFF_T_TYPE		__SLONGWORD_TYPE
 #define __OFF64_T_TYPE		__SQUAD_TYPE
 #define __PID_T_TYPE		__S32_TYPE
-#define __RLIM_T_TYPE		__ULONGWORD_TYPE
 #define __RLIM64_T_TYPE		__UQUAD_TYPE
-#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
 #define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
-#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
 #define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
-#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
 #define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
 #define	__FSWORD_T_TYPE		__SWORD_TYPE
 #define	__ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
-#define __TIME_T_TYPE		__SLONGWORD_TYPE
 #define __USECONDS_T_TYPE	__U32_TYPE
-#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
 #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE
 #define __DADDR_T_TYPE		__S32_TYPE
 #define __KEY_T_TYPE		__S32_TYPE
@@ -63,7 +76,7 @@
 #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE
 
-#ifdef __LP64__
+#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
 /* Tell the libc code that off_t and off64_t are actually the same type
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
@@ -79,7 +92,7 @@
 # define __STATFS_MATCHES_STATFS64  1
 
 /* And for getitimer, setitimer and rusage  */
-# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
 #else
 # define __RLIM_T_MATCHES_RLIM64_T	0
 
-- 
2.26.0


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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-01 17:54 ` Vineet Gupta
@ 2020-04-01 17:48   ` Alistair Francis
  0 siblings, 0 replies; 8+ messages in thread
From: Alistair Francis @ 2020-04-01 17:48 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: Alistair Francis, libc-alpha

On Wed, Apr 1, 2020 at 10:55 AM Vineet Gupta via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On 4/1/20 9:54 AM, Alistair Francis via Libc-alpha wrote:
> > Update the default typesizes.h to match the new kernel sizes for 32-bit
> > architectures with a 64-bit time_t and friends. This follows the sizes
> > used for RV32 which is a y2038 safe architecture added after Linux 5.1.
> > ---
> >  .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
> >  1 file changed, 25 insertions(+), 12 deletions(-)
> >
> > diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > index 4fb246ac74..05a6f6d1e5 100644
> > --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > @@ -24,33 +24,46 @@
> >  #ifndef      _BITS_TYPESIZES_H
> >  #define      _BITS_TYPESIZES_H       1
> >
> > -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> > -   that <bits/types.h> need not vary across different GNU platforms.  */
> > +/* See <bits/types.h> for the meaning of these macros.       This file exists so
> > +      that <bits/types.h> need not vary across different GNU platforms.      */
> > +#if __TIMESIZE == 64 && __WORDSIZE == 32
>
> Is this x32 safe as discussed in several other threads ?

Yep, x86 has it's own override so it won't use this file.

Alistair

>
> > +/* This is the "new" y2038 types defined for architectures added after
> > + * the 5.1 kernel    */
> > +# define __INO_T_TYPE                __UQUAD_TYPE
> > +# define __OFF_T_TYPE                __SQUAD_TYPE
> > +# define __RLIM_T_TYPE               __UQUAD_TYPE
> > +# define __BLKCNT_T_TYPE     __SQUAD_TYPE
> > +# define __FSBLKCNT_T_TYPE   __UQUAD_TYPE
> > +# define __FSFILCNT_T_TYPE   __UQUAD_TYPE
> > +# define __TIME_T_TYPE               __SQUAD_TYPE
> > +# define __SUSECONDS_T_TYPE  __SQUAD_TYPE
> > +#else
> > +# define __INO_T_TYPE                __ULONGWORD_TYPE
> > +# define __OFF_T_TYPE                __SLONGWORD_TYPE
> > +# define __RLIM_T_TYPE               __ULONGWORD_TYPE
> > +# define __BLKCNT_T_TYPE     __SLONGWORD_TYPE
> > +# define __FSBLKCNT_T_TYPE   __ULONGWORD_TYPE
> > +# define __FSFILCNT_T_TYPE   __ULONGWORD_TYPE
> > +# define __TIME_T_TYPE               __SLONGWORD_TYPE
> > +# define __SUSECONDS_T_TYPE  __SLONGWORD_TYPE
> > +#endif
> >
> >  #define __DEV_T_TYPE         __UQUAD_TYPE
> >  #define __UID_T_TYPE         __U32_TYPE
> >  #define __GID_T_TYPE         __U32_TYPE
> > -#define __INO_T_TYPE         __ULONGWORD_TYPE
> >  #define __INO64_T_TYPE               __UQUAD_TYPE
> >  #define __MODE_T_TYPE                __U32_TYPE
> >  #define __NLINK_T_TYPE               __U32_TYPE
> > -#define __OFF_T_TYPE         __SLONGWORD_TYPE
> >  #define __OFF64_T_TYPE               __SQUAD_TYPE
> >  #define __PID_T_TYPE         __S32_TYPE
> > -#define __RLIM_T_TYPE                __ULONGWORD_TYPE
> >  #define __RLIM64_T_TYPE              __UQUAD_TYPE
> > -#define      __BLKCNT_T_TYPE         __SLONGWORD_TYPE
> >  #define      __BLKCNT64_T_TYPE       __SQUAD_TYPE
> > -#define      __FSBLKCNT_T_TYPE       __ULONGWORD_TYPE
> >  #define      __FSBLKCNT64_T_TYPE     __UQUAD_TYPE
> > -#define      __FSFILCNT_T_TYPE       __ULONGWORD_TYPE
> >  #define      __FSFILCNT64_T_TYPE     __UQUAD_TYPE
> >  #define      __FSWORD_T_TYPE         __SWORD_TYPE
> >  #define      __ID_T_TYPE             __U32_TYPE
> >  #define __CLOCK_T_TYPE               __SLONGWORD_TYPE
> > -#define __TIME_T_TYPE                __SLONGWORD_TYPE
> >  #define __USECONDS_T_TYPE    __U32_TYPE
> > -#define __SUSECONDS_T_TYPE   __SLONGWORD_TYPE
> >  #define __SUSECONDS64_T_TYPE __SQUAD_TYPE
> >  #define __DADDR_T_TYPE               __S32_TYPE
> >  #define __KEY_T_TYPE         __S32_TYPE
> > @@ -63,7 +76,7 @@
> >  #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
> >  #define __CPU_MASK_TYPE      __ULONGWORD_TYPE
> >
> > -#ifdef __LP64__
> > +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
> >  /* Tell the libc code that off_t and off64_t are actually the same type
> >     for all ABI purposes, even if possibly expressed as different base types
> >     for C type-checking purposes.  */
> > @@ -79,7 +92,7 @@
> >  # define __STATFS_MATCHES_STATFS64  1
> >
> >  /* And for getitimer, setitimer and rusage  */
> > -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
> > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
> >  #else
> >  # define __RLIM_T_MATCHES_RLIM64_T   0
> >
> >
>

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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-01 16:54 [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types Alistair Francis
@ 2020-04-01 17:54 ` Vineet Gupta
  2020-04-01 17:48   ` Alistair Francis
  2020-04-01 21:24 ` Vineet Gupta
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Vineet Gupta @ 2020-04-01 17:54 UTC (permalink / raw)
  To: Alistair Francis, libc-alpha

On 4/1/20 9:54 AM, Alistair Francis via Libc-alpha wrote:
> Update the default typesizes.h to match the new kernel sizes for 32-bit
> architectures with a 64-bit time_t and friends. This follows the sizes
> used for RV32 which is a y2038 safe architecture added after Linux 5.1.
> ---
>  .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
>  1 file changed, 25 insertions(+), 12 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> index 4fb246ac74..05a6f6d1e5 100644
> --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> @@ -24,33 +24,46 @@
>  #ifndef	_BITS_TYPESIZES_H
>  #define	_BITS_TYPESIZES_H	1
>  
> -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> -   that <bits/types.h> need not vary across different GNU platforms.  */
> +/* See <bits/types.h> for the meaning of these macros.	This file exists so
> +	 that <bits/types.h> need not vary across different GNU platforms.	*/
> +#if __TIMESIZE == 64 && __WORDSIZE == 32

Is this x32 safe as discussed in several other threads ?

> +/* This is the "new" y2038 types defined for architectures added after
> + * the 5.1 kernel	*/
> +# define __INO_T_TYPE		__UQUAD_TYPE
> +# define __OFF_T_TYPE		__SQUAD_TYPE
> +# define __RLIM_T_TYPE		__UQUAD_TYPE
> +# define __BLKCNT_T_TYPE	__SQUAD_TYPE
> +# define __FSBLKCNT_T_TYPE	__UQUAD_TYPE
> +# define __FSFILCNT_T_TYPE	__UQUAD_TYPE
> +# define __TIME_T_TYPE		__SQUAD_TYPE
> +# define __SUSECONDS_T_TYPE	__SQUAD_TYPE
> +#else
> +# define __INO_T_TYPE		__ULONGWORD_TYPE
> +# define __OFF_T_TYPE		__SLONGWORD_TYPE
> +# define __RLIM_T_TYPE		__ULONGWORD_TYPE
> +# define __BLKCNT_T_TYPE	__SLONGWORD_TYPE
> +# define __FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
> +# define __FSFILCNT_T_TYPE	__ULONGWORD_TYPE
> +# define __TIME_T_TYPE		__SLONGWORD_TYPE
> +# define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
> +#endif
>  
>  #define __DEV_T_TYPE		__UQUAD_TYPE
>  #define __UID_T_TYPE		__U32_TYPE
>  #define __GID_T_TYPE		__U32_TYPE
> -#define __INO_T_TYPE		__ULONGWORD_TYPE
>  #define __INO64_T_TYPE		__UQUAD_TYPE
>  #define __MODE_T_TYPE		__U32_TYPE
>  #define __NLINK_T_TYPE		__U32_TYPE
> -#define __OFF_T_TYPE		__SLONGWORD_TYPE
>  #define __OFF64_T_TYPE		__SQUAD_TYPE
>  #define __PID_T_TYPE		__S32_TYPE
> -#define __RLIM_T_TYPE		__ULONGWORD_TYPE
>  #define __RLIM64_T_TYPE		__UQUAD_TYPE
> -#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
>  #define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
> -#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
>  #define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
> -#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
>  #define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
>  #define	__FSWORD_T_TYPE		__SWORD_TYPE
>  #define	__ID_T_TYPE		__U32_TYPE
>  #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
> -#define __TIME_T_TYPE		__SLONGWORD_TYPE
>  #define __USECONDS_T_TYPE	__U32_TYPE
> -#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
>  #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE
>  #define __DADDR_T_TYPE		__S32_TYPE
>  #define __KEY_T_TYPE		__S32_TYPE
> @@ -63,7 +76,7 @@
>  #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
>  #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE
>  
> -#ifdef __LP64__
> +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
>  /* Tell the libc code that off_t and off64_t are actually the same type
>     for all ABI purposes, even if possibly expressed as different base types
>     for C type-checking purposes.  */
> @@ -79,7 +92,7 @@
>  # define __STATFS_MATCHES_STATFS64  1
>  
>  /* And for getitimer, setitimer and rusage  */
> -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
> +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
>  #else
>  # define __RLIM_T_MATCHES_RLIM64_T	0
>  
> 


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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-01 16:54 [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types Alistair Francis
  2020-04-01 17:54 ` Vineet Gupta
@ 2020-04-01 21:24 ` Vineet Gupta
  2020-04-16 16:23 ` Alistair Francis
  2020-04-28  7:59 ` Andreas Schwab
  3 siblings, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2020-04-01 21:24 UTC (permalink / raw)
  To: Alistair Francis, libc-alpha

On 4/1/20 9:54 AM, Alistair Francis via Libc-alpha wrote:
> Update the default typesizes.h to match the new kernel sizes for 32-bit
> architectures with a 64-bit time_t and friends. This follows the sizes
> used for RV32 which is a y2038 safe architecture added after Linux 5.1.

ARC port is using this. So FWIW,

Reviewed-by: Vineet Gupta <vgupta@synopsys.com>
Tested-by: Vineet Gupta <vgupta@synopsys.com>

> ---
>  .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
>  1 file changed, 25 insertions(+), 12 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> index 4fb246ac74..05a6f6d1e5 100644
> --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> @@ -24,33 +24,46 @@
>  #ifndef	_BITS_TYPESIZES_H
>  #define	_BITS_TYPESIZES_H	1
>  
> -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> -   that <bits/types.h> need not vary across different GNU platforms.  */
> +/* See <bits/types.h> for the meaning of these macros.	This file exists so
> +	 that <bits/types.h> need not vary across different GNU platforms.	*/
> +#if __TIMESIZE == 64 && __WORDSIZE == 32
> +/* This is the "new" y2038 types defined for architectures added after
> + * the 5.1 kernel	*/
> +# define __INO_T_TYPE		__UQUAD_TYPE
> +# define __OFF_T_TYPE		__SQUAD_TYPE
> +# define __RLIM_T_TYPE		__UQUAD_TYPE
> +# define __BLKCNT_T_TYPE	__SQUAD_TYPE
> +# define __FSBLKCNT_T_TYPE	__UQUAD_TYPE
> +# define __FSFILCNT_T_TYPE	__UQUAD_TYPE
> +# define __TIME_T_TYPE		__SQUAD_TYPE
> +# define __SUSECONDS_T_TYPE	__SQUAD_TYPE
> +#else
> +# define __INO_T_TYPE		__ULONGWORD_TYPE
> +# define __OFF_T_TYPE		__SLONGWORD_TYPE
> +# define __RLIM_T_TYPE		__ULONGWORD_TYPE
> +# define __BLKCNT_T_TYPE	__SLONGWORD_TYPE
> +# define __FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
> +# define __FSFILCNT_T_TYPE	__ULONGWORD_TYPE
> +# define __TIME_T_TYPE		__SLONGWORD_TYPE
> +# define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
> +#endif
>  
>  #define __DEV_T_TYPE		__UQUAD_TYPE
>  #define __UID_T_TYPE		__U32_TYPE
>  #define __GID_T_TYPE		__U32_TYPE
> -#define __INO_T_TYPE		__ULONGWORD_TYPE
>  #define __INO64_T_TYPE		__UQUAD_TYPE
>  #define __MODE_T_TYPE		__U32_TYPE
>  #define __NLINK_T_TYPE		__U32_TYPE
> -#define __OFF_T_TYPE		__SLONGWORD_TYPE
>  #define __OFF64_T_TYPE		__SQUAD_TYPE
>  #define __PID_T_TYPE		__S32_TYPE
> -#define __RLIM_T_TYPE		__ULONGWORD_TYPE
>  #define __RLIM64_T_TYPE		__UQUAD_TYPE
> -#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
>  #define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
> -#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
>  #define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
> -#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
>  #define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
>  #define	__FSWORD_T_TYPE		__SWORD_TYPE
>  #define	__ID_T_TYPE		__U32_TYPE
>  #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
> -#define __TIME_T_TYPE		__SLONGWORD_TYPE
>  #define __USECONDS_T_TYPE	__U32_TYPE
> -#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
>  #define __SUSECONDS64_T_TYPE	__SQUAD_TYPE
>  #define __DADDR_T_TYPE		__S32_TYPE
>  #define __KEY_T_TYPE		__S32_TYPE
> @@ -63,7 +76,7 @@
>  #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
>  #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE
>  
> -#ifdef __LP64__
> +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
>  /* Tell the libc code that off_t and off64_t are actually the same type
>     for all ABI purposes, even if possibly expressed as different base types
>     for C type-checking purposes.  */
> @@ -79,7 +92,7 @@
>  # define __STATFS_MATCHES_STATFS64  1
>  
>  /* And for getitimer, setitimer and rusage  */
> -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
> +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
>  #else
>  # define __RLIM_T_MATCHES_RLIM64_T	0
>  
> 


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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-01 16:54 [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types Alistair Francis
  2020-04-01 17:54 ` Vineet Gupta
  2020-04-01 21:24 ` Vineet Gupta
@ 2020-04-16 16:23 ` Alistair Francis
  2020-04-27 21:46   ` Alistair Francis
  2020-04-28  7:59 ` Andreas Schwab
  3 siblings, 1 reply; 8+ messages in thread
From: Alistair Francis @ 2020-04-16 16:23 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library

On Wed, Apr 1, 2020 at 10:02 AM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> Update the default typesizes.h to match the new kernel sizes for 32-bit
> architectures with a 64-bit time_t and friends. This follows the sizes
> used for RV32 which is a y2038 safe architecture added after Linux 5.1.

Ping!

> ---
>  .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
>  1 file changed, 25 insertions(+), 12 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> index 4fb246ac74..05a6f6d1e5 100644
> --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> @@ -24,33 +24,46 @@
>  #ifndef        _BITS_TYPESIZES_H
>  #define        _BITS_TYPESIZES_H       1
>
> -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> -   that <bits/types.h> need not vary across different GNU platforms.  */
> +/* See <bits/types.h> for the meaning of these macros. This file exists so
> +        that <bits/types.h> need not vary across different GNU platforms.      */
> +#if __TIMESIZE == 64 && __WORDSIZE == 32
> +/* This is the "new" y2038 types defined for architectures added after
> + * the 5.1 kernel      */
> +# define __INO_T_TYPE          __UQUAD_TYPE
> +# define __OFF_T_TYPE          __SQUAD_TYPE
> +# define __RLIM_T_TYPE         __UQUAD_TYPE
> +# define __BLKCNT_T_TYPE       __SQUAD_TYPE
> +# define __FSBLKCNT_T_TYPE     __UQUAD_TYPE
> +# define __FSFILCNT_T_TYPE     __UQUAD_TYPE
> +# define __TIME_T_TYPE         __SQUAD_TYPE
> +# define __SUSECONDS_T_TYPE    __SQUAD_TYPE
> +#else
> +# define __INO_T_TYPE          __ULONGWORD_TYPE
> +# define __OFF_T_TYPE          __SLONGWORD_TYPE
> +# define __RLIM_T_TYPE         __ULONGWORD_TYPE
> +# define __BLKCNT_T_TYPE       __SLONGWORD_TYPE
> +# define __FSBLKCNT_T_TYPE     __ULONGWORD_TYPE
> +# define __FSFILCNT_T_TYPE     __ULONGWORD_TYPE
> +# define __TIME_T_TYPE         __SLONGWORD_TYPE
> +# define __SUSECONDS_T_TYPE    __SLONGWORD_TYPE
> +#endif
>
>  #define __DEV_T_TYPE           __UQUAD_TYPE
>  #define __UID_T_TYPE           __U32_TYPE
>  #define __GID_T_TYPE           __U32_TYPE
> -#define __INO_T_TYPE           __ULONGWORD_TYPE
>  #define __INO64_T_TYPE         __UQUAD_TYPE
>  #define __MODE_T_TYPE          __U32_TYPE
>  #define __NLINK_T_TYPE         __U32_TYPE
> -#define __OFF_T_TYPE           __SLONGWORD_TYPE
>  #define __OFF64_T_TYPE         __SQUAD_TYPE
>  #define __PID_T_TYPE           __S32_TYPE
> -#define __RLIM_T_TYPE          __ULONGWORD_TYPE
>  #define __RLIM64_T_TYPE                __UQUAD_TYPE
> -#define        __BLKCNT_T_TYPE         __SLONGWORD_TYPE
>  #define        __BLKCNT64_T_TYPE       __SQUAD_TYPE
> -#define        __FSBLKCNT_T_TYPE       __ULONGWORD_TYPE
>  #define        __FSBLKCNT64_T_TYPE     __UQUAD_TYPE
> -#define        __FSFILCNT_T_TYPE       __ULONGWORD_TYPE
>  #define        __FSFILCNT64_T_TYPE     __UQUAD_TYPE
>  #define        __FSWORD_T_TYPE         __SWORD_TYPE
>  #define        __ID_T_TYPE             __U32_TYPE
>  #define __CLOCK_T_TYPE         __SLONGWORD_TYPE
> -#define __TIME_T_TYPE          __SLONGWORD_TYPE
>  #define __USECONDS_T_TYPE      __U32_TYPE
> -#define __SUSECONDS_T_TYPE     __SLONGWORD_TYPE
>  #define __SUSECONDS64_T_TYPE   __SQUAD_TYPE
>  #define __DADDR_T_TYPE         __S32_TYPE
>  #define __KEY_T_TYPE           __S32_TYPE
> @@ -63,7 +76,7 @@
>  #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
>  #define __CPU_MASK_TYPE        __ULONGWORD_TYPE
>
> -#ifdef __LP64__
> +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
>  /* Tell the libc code that off_t and off64_t are actually the same type
>     for all ABI purposes, even if possibly expressed as different base types
>     for C type-checking purposes.  */
> @@ -79,7 +92,7 @@
>  # define __STATFS_MATCHES_STATFS64  1
>
>  /* And for getitimer, setitimer and rusage  */
> -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
> +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
>  #else
>  # define __RLIM_T_MATCHES_RLIM64_T     0
>
> --
> 2.26.0
>

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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-16 16:23 ` Alistair Francis
@ 2020-04-27 21:46   ` Alistair Francis
  0 siblings, 0 replies; 8+ messages in thread
From: Alistair Francis @ 2020-04-27 21:46 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library, Joseph Myers, Lukasz Majewski

On Thu, Apr 16, 2020 at 9:23 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Wed, Apr 1, 2020 at 10:02 AM Alistair Francis
> <alistair.francis@wdc.com> wrote:
> >
> > Update the default typesizes.h to match the new kernel sizes for 32-bit
> > architectures with a 64-bit time_t and friends. This follows the sizes
> > used for RV32 which is a y2038 safe architecture added after Linux 5.1.
>
> Ping!

Ping^2.

Alistair

>
> > ---
> >  .../unix/sysv/linux/generic/bits/typesizes.h  | 37 +++++++++++++------
> >  1 file changed, 25 insertions(+), 12 deletions(-)
> >
> > diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > index 4fb246ac74..05a6f6d1e5 100644
> > --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > @@ -24,33 +24,46 @@
> >  #ifndef        _BITS_TYPESIZES_H
> >  #define        _BITS_TYPESIZES_H       1
> >
> > -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> > -   that <bits/types.h> need not vary across different GNU platforms.  */
> > +/* See <bits/types.h> for the meaning of these macros. This file exists so
> > +        that <bits/types.h> need not vary across different GNU platforms.      */
> > +#if __TIMESIZE == 64 && __WORDSIZE == 32
> > +/* This is the "new" y2038 types defined for architectures added after
> > + * the 5.1 kernel      */
> > +# define __INO_T_TYPE          __UQUAD_TYPE
> > +# define __OFF_T_TYPE          __SQUAD_TYPE
> > +# define __RLIM_T_TYPE         __UQUAD_TYPE
> > +# define __BLKCNT_T_TYPE       __SQUAD_TYPE
> > +# define __FSBLKCNT_T_TYPE     __UQUAD_TYPE
> > +# define __FSFILCNT_T_TYPE     __UQUAD_TYPE
> > +# define __TIME_T_TYPE         __SQUAD_TYPE
> > +# define __SUSECONDS_T_TYPE    __SQUAD_TYPE
> > +#else
> > +# define __INO_T_TYPE          __ULONGWORD_TYPE
> > +# define __OFF_T_TYPE          __SLONGWORD_TYPE
> > +# define __RLIM_T_TYPE         __ULONGWORD_TYPE
> > +# define __BLKCNT_T_TYPE       __SLONGWORD_TYPE
> > +# define __FSBLKCNT_T_TYPE     __ULONGWORD_TYPE
> > +# define __FSFILCNT_T_TYPE     __ULONGWORD_TYPE
> > +# define __TIME_T_TYPE         __SLONGWORD_TYPE
> > +# define __SUSECONDS_T_TYPE    __SLONGWORD_TYPE
> > +#endif
> >
> >  #define __DEV_T_TYPE           __UQUAD_TYPE
> >  #define __UID_T_TYPE           __U32_TYPE
> >  #define __GID_T_TYPE           __U32_TYPE
> > -#define __INO_T_TYPE           __ULONGWORD_TYPE
> >  #define __INO64_T_TYPE         __UQUAD_TYPE
> >  #define __MODE_T_TYPE          __U32_TYPE
> >  #define __NLINK_T_TYPE         __U32_TYPE
> > -#define __OFF_T_TYPE           __SLONGWORD_TYPE
> >  #define __OFF64_T_TYPE         __SQUAD_TYPE
> >  #define __PID_T_TYPE           __S32_TYPE
> > -#define __RLIM_T_TYPE          __ULONGWORD_TYPE
> >  #define __RLIM64_T_TYPE                __UQUAD_TYPE
> > -#define        __BLKCNT_T_TYPE         __SLONGWORD_TYPE
> >  #define        __BLKCNT64_T_TYPE       __SQUAD_TYPE
> > -#define        __FSBLKCNT_T_TYPE       __ULONGWORD_TYPE
> >  #define        __FSBLKCNT64_T_TYPE     __UQUAD_TYPE
> > -#define        __FSFILCNT_T_TYPE       __ULONGWORD_TYPE
> >  #define        __FSFILCNT64_T_TYPE     __UQUAD_TYPE
> >  #define        __FSWORD_T_TYPE         __SWORD_TYPE
> >  #define        __ID_T_TYPE             __U32_TYPE
> >  #define __CLOCK_T_TYPE         __SLONGWORD_TYPE
> > -#define __TIME_T_TYPE          __SLONGWORD_TYPE
> >  #define __USECONDS_T_TYPE      __U32_TYPE
> > -#define __SUSECONDS_T_TYPE     __SLONGWORD_TYPE
> >  #define __SUSECONDS64_T_TYPE   __SQUAD_TYPE
> >  #define __DADDR_T_TYPE         __S32_TYPE
> >  #define __KEY_T_TYPE           __S32_TYPE
> > @@ -63,7 +76,7 @@
> >  #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
> >  #define __CPU_MASK_TYPE        __ULONGWORD_TYPE
> >
> > -#ifdef __LP64__
> > +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
> >  /* Tell the libc code that off_t and off64_t are actually the same type
> >     for all ABI purposes, even if possibly expressed as different base types
> >     for C type-checking purposes.  */
> > @@ -79,7 +92,7 @@
> >  # define __STATFS_MATCHES_STATFS64  1
> >
> >  /* And for getitimer, setitimer and rusage  */
> > -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
> > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
> >  #else
> >  # define __RLIM_T_MATCHES_RLIM64_T     0
> >
> > --
> > 2.26.0
> >

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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-01 16:54 [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types Alistair Francis
                   ` (2 preceding siblings ...)
  2020-04-16 16:23 ` Alistair Francis
@ 2020-04-28  7:59 ` Andreas Schwab
  2020-04-29 16:31   ` Alistair Francis
  3 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2020-04-28  7:59 UTC (permalink / raw)
  To: Alistair Francis via Libc-alpha; +Cc: Alistair Francis

On Apr 01 2020, Alistair Francis via Libc-alpha wrote:

> Update the default typesizes.h to match the new kernel sizes for 32-bit
> architectures with a 64-bit time_t and friends. This follows the sizes
> used for RV32 which is a y2038 safe architecture added after Linux 5.1.

Ok with a few style nits.

> diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> index 4fb246ac74..05a6f6d1e5 100644
> --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> @@ -24,33 +24,46 @@
>  #ifndef	_BITS_TYPESIZES_H
>  #define	_BITS_TYPESIZES_H	1
>  
> -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> -   that <bits/types.h> need not vary across different GNU platforms.  */
> +/* See <bits/types.h> for the meaning of these macros.	This file exists so
> +	 that <bits/types.h> need not vary across different GNU platforms.	*/

Spurious space change.

> +#if __TIMESIZE == 64 && __WORDSIZE == 32
> +/* This is the "new" y2038 types defined for architectures added after
> + * the 5.1 kernel	*/

"These are the"

No asterisk continuation.  End the sentence with a period and two spaces.

> @@ -63,7 +76,7 @@
>  #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
>  #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE
>  
> -#ifdef __LP64__
> +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)

No paren after defined.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types
  2020-04-28  7:59 ` Andreas Schwab
@ 2020-04-29 16:31   ` Alistair Francis
  0 siblings, 0 replies; 8+ messages in thread
From: Alistair Francis @ 2020-04-29 16:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Alistair Francis via Libc-alpha, Alistair Francis

On Tue, Apr 28, 2020 at 1:45 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Apr 01 2020, Alistair Francis via Libc-alpha wrote:
>
> > Update the default typesizes.h to match the new kernel sizes for 32-bit
> > architectures with a 64-bit time_t and friends. This follows the sizes
> > used for RV32 which is a y2038 safe architecture added after Linux 5.1.
>
> Ok with a few style nits.

Thanks, I'll apply this with the changes you requested.

Alistair

>
> > diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > index 4fb246ac74..05a6f6d1e5 100644
> > --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
> > @@ -24,33 +24,46 @@
> >  #ifndef      _BITS_TYPESIZES_H
> >  #define      _BITS_TYPESIZES_H       1
> >
> > -/* See <bits/types.h> for the meaning of these macros.  This file exists so
> > -   that <bits/types.h> need not vary across different GNU platforms.  */
> > +/* See <bits/types.h> for the meaning of these macros.       This file exists so
> > +      that <bits/types.h> need not vary across different GNU platforms.      */
>
> Spurious space change.
>
> > +#if __TIMESIZE == 64 && __WORDSIZE == 32
> > +/* This is the "new" y2038 types defined for architectures added after
> > + * the 5.1 kernel    */
>
> "These are the"
>
> No asterisk continuation.  End the sentence with a period and two spaces.
>
> > @@ -63,7 +76,7 @@
> >  #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
> >  #define __CPU_MASK_TYPE      __ULONGWORD_TYPE
> >
> > -#ifdef __LP64__
> > +#if defined(__LP64__) || (__TIMESIZE == 64 && __WORDSIZE == 32)
>
> No paren after defined.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."

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

end of thread, other threads:[~2020-04-29 16:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 16:54 [PATCH] generic/typesizes.h: Add support for 32-bit arches with 64-bit types Alistair Francis
2020-04-01 17:54 ` Vineet Gupta
2020-04-01 17:48   ` Alistair Francis
2020-04-01 21:24 ` Vineet Gupta
2020-04-16 16:23 ` Alistair Francis
2020-04-27 21:46   ` Alistair Francis
2020-04-28  7:59 ` Andreas Schwab
2020-04-29 16:31   ` Alistair Francis

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).