On Thu, 23 Dec 2021, Adhemerval Zanella via Libc-alpha wrote:
> .../linux/powerpc/powerpc32/bits/timesize.h | 20 ++++++++++++++++
> .../sysv/linux/s390/s390-32/bits/timesize.h | 20 ++++++++++++++++
> .../sysv/linux/sparc/sparc32/bits/timesize.h | 20 ++++++++++++++++
There should be no installed headers in such sub-architecture sysdeps
directories (unless the header is identical for all sub-architecture
variants of an architecture but required to be in the sub-architecture
directory to get the right header found in the sysdeps directory
ordering), because installed headers should be suitable to share between
all ABIs for an architecture. Instead, there need to be bits/timesize.h
headers for powerpc, s390 and sparc that contain conditionals to determine
the correct value of __TIMESIZE for a given compilation.
> diff --git a/sysdeps/unix/sysv/linux/mips/bits/timesize.h b/sysdeps/unix/sysv/linux/mips/bits/timesize.h
> new file mode 100644
> index 0000000000..95a27ad5b6
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/bits/timesize.h
> @@ -0,0 +1,24 @@
> +/* Bit size of the time_t type at glibc build time, Linux/MIPS.
> + Copyright (C) 2021 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
> + <https://www.gnu.org/licenses/>. */
> +
> +/* Size in bits of the 'time_t' type of the default ABI. */
> +#if _MIPS_SIM == _ABI64
Headers checking _MIPS_SIM like this should include <sgidefs.h> to ensure
all the _ABI* macros are defined (GCC only predefines the one for the
current ABI, so while the code would work correctly for other ABIs,
there's the potential for -Wundef warnings if <sgidefs.h> hasn't already
been included).
On 30/12/2021 18:58, Joseph Myers wrote:
> On Thu, 23 Dec 2021, Adhemerval Zanella via Libc-alpha wrote:
>
>> .../linux/powerpc/powerpc32/bits/timesize.h | 20 ++++++++++++++++
>> .../sysv/linux/s390/s390-32/bits/timesize.h | 20 ++++++++++++++++
>> .../sysv/linux/sparc/sparc32/bits/timesize.h | 20 ++++++++++++++++
>
> There should be no installed headers in such sub-architecture sysdeps
> directories (unless the header is identical for all sub-architecture
> variants of an architecture but required to be in the sub-architecture
> directory to get the right header found in the sysdeps directory
> ordering), because installed headers should be suitable to share between
> all ABIs for an architecture. Instead, there need to be bits/timesize.h
> headers for powerpc, s390 and sparc that contain conditionals to determine
> the correct value of __TIMESIZE for a given compilation.
Ok, I will fix it (I though about it, but I was not sure sure if this was
the correct approach).
>
>> diff --git a/sysdeps/unix/sysv/linux/mips/bits/timesize.h b/sysdeps/unix/sysv/linux/mips/bits/timesize.h
>> new file mode 100644
>> index 0000000000..95a27ad5b6
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/mips/bits/timesize.h
>> @@ -0,0 +1,24 @@
>> +/* Bit size of the time_t type at glibc build time, Linux/MIPS.
>> + Copyright (C) 2021 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
>> + <https://www.gnu.org/licenses/>. */
>> +
>> +/* Size in bits of the 'time_t' type of the default ABI. */
>> +#if _MIPS_SIM == _ABI64
>
> Headers checking _MIPS_SIM like this should include <sgidefs.h> to ensure
> all the _ABI* macros are defined (GCC only predefines the one for the
> current ABI, so while the code would work correctly for other ABIs,
> there's the potential for -Wundef warnings if <sgidefs.h> hasn't already
> been included).
>
Ack, I will fix it as well.
@@ -16,7 +16,5 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <bits/wordsize.h>
-
/* Size in bits of the 'time_t' type of the default ABI. */
-#define __TIMESIZE __WORDSIZE
+#define __TIMESIZE 64
similarity index 74%
rename from sysdeps/unix/sysv/linux/arc/bits/timesize.h
rename to sysdeps/mach/hurd/bits/timesize.h
@@ -1,5 +1,5 @@
-/* Bit size of the time_t type at glibc build time, general case.
- Copyright (C) 2020-2021 Free Software Foundation, Inc.
+/* Bit size of the time_t type at glibc build time, Hurd.
+ Copyright (C) 2021 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
@@ -14,8 +14,7 @@
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/>. */
+ <https://www.gnu.org/licenses/>. */
-#include <bits/wordsize.h>
-
-#define __TIMESIZE 64
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/ARM.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/csky.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/HPPA.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/m68k.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/MicroBlaze.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,24 @@
+/* Bit size of the time_t type at glibc build time, Linux/MIPS.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#if _MIPS_SIM == _ABI64
+# define __TIMESIZE 64
+#else
+# define __TIMESIZE 32
+#endif
similarity index 77%
rename from sysdeps/unix/sysv/linux/riscv/bits/timesize.h
rename to sysdeps/unix/sysv/linux/nios2/bits/timesize.h
@@ -1,5 +1,5 @@
-/* Bit size of the time_t type at glibc build time, RISC-V case.
- Copyright (C) 2020-2021 Free Software Foundation, Inc.
+/* Bit size of the time_t type at glibc build time, Linux/NIOS2.
+ Copyright (C) 2021 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
@@ -16,7 +16,5 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <bits/wordsize.h>
-
-/* RV32 and RV64 both use 64-bit time_t */
-#define __TIMESIZE 64
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/PowerPC 32-bits.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/s390 32-bits.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/sh.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
new file mode 100644
@@ -0,0 +1,20 @@
+/* Bit size of the time_t type at glibc build time, Linux/sparc 32-bits.
+ Copyright (C) 2021 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
+ <https://www.gnu.org/licenses/>. */
+
+/* Size in bits of the 'time_t' type of the default ABI. */
+#define __TIMESIZE 32
@@ -16,6 +16,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <bits/wordsize.h>
+
#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit. */
# define __TIMESIZE 64