[v3] remaining steps for time64 switchover

Submitted by Rich Felker on Nov. 2, 2019, 9:37 p.m.

Details

Message ID 20191102213715.GT16318@brightrain.aerifal.cx
State New
Series "remaining steps for time64 switchover"
Headers show

Commit Message

Rich Felker Nov. 2, 2019, 9:37 p.m.
On Sat, Nov 02, 2019 at 12:34:26PM -0400, Rich Felker wrote:
> On Fri, Nov 01, 2019 at 09:39:11PM -0400, Rich Felker wrote:
> > A couple errors in the v2 patchset motivated me to factor the changes
> > to sys/socket.h and arch/generic/ioctl.h out of the main switchover
> > commit, so that the latter only touches arch dirs, and acts uniformly
> > on them. The final result with all patches applied is almost the same,
> > except now the powerpc and mips[n32] socket.h bits omit the time64
> > socket options, letting the top-level header's defaults take effect.
> > 
> > All archs I have toolchains handy for, which includes the oddballs
> > (mips, powerpc) and a few 64-bit ones, have been tested to build
> > successfully and get the right values of the sockopt and ioctl macros,
> > utilizing a horrible hack (uncommitted of course) dropped into the
> > source tree while building.
> > 
> > Hopefully this is "final" now and ready for push.
> 
> compat/time32/adjtimex_time32.c was inconsistent with what was later
> done for struct timex (see commit
> 928674dcd0c5c643b8a4440466103be841151f5e). Two very helpful reviewers
> on #musl pointed this out, and I'll be squashing the attached fix. (I
> tried to avoid having many time32 compat shims call each other rather
> than directly calling the real functions in libc, but this one would
> involve a lot of duplication (and the duplication initially led to
> this error) so...

And a few more. The first two clearly cause wrong behavior. The last
(__xstat) just causes undefined behavior by calling the
__*stat*_time32 functions without a prototype with wrong pointer type.
(The same issue also applies in theory between the legacy caller and
the shims, but it's inevitable, and is only visible with LTO between
the old .o files and new libc.a or similar, which just can't be a
supported usage. OTOH the libc-internal mismatch could break LTO of
libc.so.)

I'll be squashing these with the compat shims commit, and pushing real
soon now.

Rich
From c634bb6210c770a835bb565c859da4b435ff97f7 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Sat, 2 Nov 2019 12:40:50 -0400
Subject: [PATCH 1/3] fixup difftime32

---
 compat/time32/difftime32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/compat/time32/difftime32.c b/compat/time32/difftime32.c
index 15c65709..5950943a 100644
--- a/compat/time32/difftime32.c
+++ b/compat/time32/difftime32.c
@@ -1,7 +1,7 @@ 
 #include "time32.h"
 #include <time.h>
 
-double __difftime32(time32_t t1, time_t t2)
+double __difftime32(time32_t t1, time32_t t2)
 {
 	return difftime(t1, t2);
 }