public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] hurd: Fix __TIMESIZE on x86_64
@ 2023-05-19 17:15 Sergey Bugaev
  2023-05-19 18:27 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Bugaev @ 2023-05-19 17:15 UTC (permalink / raw)
  To: libc-alpha, bug-hurd; +Cc: Samuel Thibault

We had sizeof (time_t) == 8, but __TIMESIZE == 32.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---

...oops.

I have not tested whether this breaks anything (other then checking
that it still builds), but it's kind of amazing that it had worked at
all before this, and there's a higher chance of this fixing something
than breaking something.

Unfortunately I believe this means that all binaries built for
x86_64-gnu so far will have to be rebuilt. Fortunately I don't think
anybody except for myself (and Samuel himself) had installed them.

Discovered while attempting to hack on fcntl{,64,_time64}.

 sysdeps/mach/clock_gettime.c            | 2 ++
 sysdeps/mach/hurd/bits/timesize.h       | 4 +++-
 sysdeps/mach/hurd/x86_64/libanl.abilist | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
index be775ed2..9124a32e 100644
--- a/sysdeps/mach/clock_gettime.c
+++ b/sysdeps/mach/clock_gettime.c
@@ -111,6 +111,7 @@ strong_alias (__clock_gettime, __clock_gettime_2);
 compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
 #endif
 
+#if __TIMESIZE != 64
 int
 __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
 {
@@ -124,3 +125,4 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
   return ret;
 }
 libc_hidden_def (__clock_gettime64)
+#endif
diff --git a/sysdeps/mach/hurd/bits/timesize.h b/sysdeps/mach/hurd/bits/timesize.h
index 900a0a23..981452c0 100644
--- a/sysdeps/mach/hurd/bits/timesize.h
+++ b/sysdeps/mach/hurd/bits/timesize.h
@@ -16,5 +16,7 @@
    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	32
+#define __TIMESIZE	__WORDSIZE
diff --git a/sysdeps/mach/hurd/x86_64/libanl.abilist b/sysdeps/mach/hurd/x86_64/libanl.abilist
index c0a6a009..baad6de2 100644
--- a/sysdeps/mach/hurd/x86_64/libanl.abilist
+++ b/sysdeps/mach/hurd/x86_64/libanl.abilist
@@ -1,4 +1,3 @@
 GLIBC_2.38 gai_cancel F
 GLIBC_2.38 gai_error F
-GLIBC_2.38 gai_suspend F
 GLIBC_2.38 getaddrinfo_a F
-- 
2.40.1


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

* Re: [PATCH] hurd: Fix __TIMESIZE on x86_64
  2023-05-19 17:15 [PATCH] hurd: Fix __TIMESIZE on x86_64 Sergey Bugaev
@ 2023-05-19 18:27 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2023-05-19 18:27 UTC (permalink / raw)
  To: Sergey Bugaev; +Cc: libc-alpha, bug-hurd

Applied, thanks!

Sergey Bugaev, le ven. 19 mai 2023 20:15:16 +0300, a ecrit:
> We had sizeof (time_t) == 8, but __TIMESIZE == 32.
> 
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
> 
> ...oops.
> 
> I have not tested whether this breaks anything (other then checking
> that it still builds), but it's kind of amazing that it had worked at
> all before this,

There aren't that many users of time_t actually.

> and there's a higher chance of this fixing something
> than breaking something.
> 
> Unfortunately I believe this means that all binaries built for
> x86_64-gnu so far will have to be rebuilt.

It's not a problem on my side, I'm still always reboostraping everything
everytime. Until we have made a careful review of the types we expose,
I'm not considering the ABI as stable.

Samuel

> Fortunately I don't think
> anybody except for myself (and Samuel himself) had installed them.
> 
> Discovered while attempting to hack on fcntl{,64,_time64}.
> 
>  sysdeps/mach/clock_gettime.c            | 2 ++
>  sysdeps/mach/hurd/bits/timesize.h       | 4 +++-
>  sysdeps/mach/hurd/x86_64/libanl.abilist | 1 -
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
> index be775ed2..9124a32e 100644
> --- a/sysdeps/mach/clock_gettime.c
> +++ b/sysdeps/mach/clock_gettime.c
> @@ -111,6 +111,7 @@ strong_alias (__clock_gettime, __clock_gettime_2);
>  compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
>  #endif
>  
> +#if __TIMESIZE != 64
>  int
>  __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
>  {
> @@ -124,3 +125,4 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
>    return ret;
>  }
>  libc_hidden_def (__clock_gettime64)
> +#endif
> diff --git a/sysdeps/mach/hurd/bits/timesize.h b/sysdeps/mach/hurd/bits/timesize.h
> index 900a0a23..981452c0 100644
> --- a/sysdeps/mach/hurd/bits/timesize.h
> +++ b/sysdeps/mach/hurd/bits/timesize.h
> @@ -16,5 +16,7 @@
>     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	32
> +#define __TIMESIZE	__WORDSIZE
> diff --git a/sysdeps/mach/hurd/x86_64/libanl.abilist b/sysdeps/mach/hurd/x86_64/libanl.abilist
> index c0a6a009..baad6de2 100644
> --- a/sysdeps/mach/hurd/x86_64/libanl.abilist
> +++ b/sysdeps/mach/hurd/x86_64/libanl.abilist
> @@ -1,4 +1,3 @@
>  GLIBC_2.38 gai_cancel F
>  GLIBC_2.38 gai_error F
> -GLIBC_2.38 gai_suspend F
>  GLIBC_2.38 getaddrinfo_a F
> -- 
> 2.40.1
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.

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

end of thread, other threads:[~2023-05-19 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 17:15 [PATCH] hurd: Fix __TIMESIZE on x86_64 Sergey Bugaev
2023-05-19 18:27 ` Samuel Thibault

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