Solve the y2038 problem for powerpc

AKA Make time_t 64 bits on powerpc(32).

PowerPC currently (until now) was one of two architectures with a 32-bit time_t
on 32-bit archs (the other being i386).  This is an ABI breakage, so all ports,
and all local binaries, *must* be recompiled.

Tested by:	andreast, others
MFC after:	Never
Relnotes:	Yes
This commit is contained in:
Justin Hibbits 2017-06-26 02:25:19 +00:00
parent 81b07aac10
commit fbcf7bcdf4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320347
9 changed files with 30 additions and 22 deletions

View File

@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ****************************** ****************************** SPECIAL WARNING: ******************************
20170625:
The FreeBSD/powerpc platform now uses a 64-bit type for time_t. This is
a very major ABI incompatible change, so users of FreeBSD/powerpc must
be careful when performing source upgrades. It is best to run
'make installworld' from an alternate root system, either a live
CD/memory stick, or a temporary root partition. Additionally, all ports
must be recompiled. powerpc64 is largely unaffected, except in the case
of 32-bit compatibility. All 32-bit binaries will be affected.
20170623: 20170623:
Forward compatibility for the "ino64" project have been committed. This Forward compatibility for the "ino64" project have been committed. This
will allow most new binaries to run on older kernels in a limited will allow most new binaries to run on older kernels in a limited

View File

@ -203,8 +203,8 @@ Machine-dependent type sizes:
.It mips64el Ta 8 Ta 8 Ta 8 .It mips64el Ta 8 Ta 8 Ta 8
.It mips64elhf Ta 8 Ta 8 Ta 8 .It mips64elhf Ta 8 Ta 8 Ta 8
.It mips64hf Ta 8 Ta 8 Ta 8 .It mips64hf Ta 8 Ta 8 Ta 8
.It powerpc Ta 4 Ta 8 Ta 4 .It powerpc Ta 4 Ta 8 Ta 8
.It powerpcspe Ta 4 Ta 8 Ta 4 .It powerpcspe Ta 4 Ta 8 Ta 8
.It powerpc64 Ta 8 Ta 8 Ta 8 .It powerpc64 Ta 8 Ta 8 Ta 8
.It riscv64 Ta 8 Ta 16 Ta 8 .It riscv64 Ta 8 Ta 16 Ta 8
.It riscv64sf Ta 8 Ta 16 Ta 8 .It riscv64sf Ta 8 Ta 16 Ta 8

View File

@ -45,7 +45,7 @@
/* /*
* Being a newer port, 32-bit FreeBSD/MIPS uses 64-bit time_t. * Being a newer port, 32-bit FreeBSD/MIPS uses 64-bit time_t.
*/ */
#ifdef __mips__ #if defined (__mips__) || defined(__powerpc__)
typedef int64_t time32_t; typedef int64_t time32_t;
#else #else
typedef int32_t time32_t; typedef int32_t time32_t;

View File

@ -109,13 +109,13 @@ __FBSDID("$FreeBSD$");
FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD"); FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD");
#ifndef __mips__ #if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct timeval32) == 8); CTASSERT(sizeof(struct timeval32) == 8);
CTASSERT(sizeof(struct timespec32) == 8); CTASSERT(sizeof(struct timespec32) == 8);
CTASSERT(sizeof(struct itimerval32) == 16); CTASSERT(sizeof(struct itimerval32) == 16);
#endif #endif
CTASSERT(sizeof(struct statfs32) == 256); CTASSERT(sizeof(struct statfs32) == 256);
#ifndef __mips__ #if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct rusage32) == 72); CTASSERT(sizeof(struct rusage32) == 72);
#endif #endif
CTASSERT(sizeof(struct sigaltstack32) == 12); CTASSERT(sizeof(struct sigaltstack32) == 12);
@ -125,7 +125,7 @@ CTASSERT(sizeof(struct msghdr32) == 28);
#ifdef __amd64__ #ifdef __amd64__
CTASSERT(sizeof(struct stat32) == 208); CTASSERT(sizeof(struct stat32) == 208);
#endif #endif
#ifndef __mips__ #if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct freebsd11_stat32) == 96); CTASSERT(sizeof(struct freebsd11_stat32) == 96);
#endif #endif
CTASSERT(sizeof(struct sigaction32) == 24); CTASSERT(sizeof(struct sigaction32) == 24);

View File

@ -1283,7 +1283,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
#endif #endif
case BIOCGETIF: case BIOCGETIF:
case BIOCGRTIMEOUT: case BIOCGRTIMEOUT:
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCGRTIMEOUT32: case BIOCGRTIMEOUT32:
#endif #endif
case BIOCGSTATS: case BIOCGSTATS:
@ -1295,7 +1295,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
case FIONREAD: case FIONREAD:
case BIOCLOCK: case BIOCLOCK:
case BIOCSRTIMEOUT: case BIOCSRTIMEOUT:
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCSRTIMEOUT32: case BIOCSRTIMEOUT32:
#endif #endif
case BIOCIMMEDIATE: case BIOCIMMEDIATE:
@ -1519,7 +1519,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
* Set read timeout. * Set read timeout.
*/ */
case BIOCSRTIMEOUT: case BIOCSRTIMEOUT:
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCSRTIMEOUT32: case BIOCSRTIMEOUT32:
#endif #endif
{ {
@ -1550,12 +1550,12 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
* Get read timeout. * Get read timeout.
*/ */
case BIOCGRTIMEOUT: case BIOCGRTIMEOUT:
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCGRTIMEOUT32: case BIOCGRTIMEOUT32:
#endif #endif
{ {
struct timeval *tv; struct timeval *tv;
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
struct timeval32 *tv32; struct timeval32 *tv32;
struct timeval tv64; struct timeval tv64;
@ -1567,7 +1567,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
tv->tv_sec = d->bd_rtout / hz; tv->tv_sec = d->bd_rtout / hz;
tv->tv_usec = (d->bd_rtout % hz) * tick; tv->tv_usec = (d->bd_rtout % hz) * tick;
#if defined(COMPAT_FREEBSD32) && !defined(__mips__) #if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
if (cmd == BIOCGRTIMEOUT32) { if (cmd == BIOCGRTIMEOUT32) {
tv32 = (struct timeval32 *)addr; tv32 = (struct timeval32 *)addr;
tv32->tv_sec = tv->tv_sec; tv32->tv_sec = tv->tv_sec;

View File

@ -98,16 +98,18 @@ typedef __int64_t __register_t;
typedef __int64_t __segsz_t; /* segment size (in pages) */ typedef __int64_t __segsz_t; /* segment size (in pages) */
typedef __uint64_t __size_t; /* sizeof() */ typedef __uint64_t __size_t; /* sizeof() */
typedef __int64_t __ssize_t; /* byte count or error */ typedef __int64_t __ssize_t; /* byte count or error */
typedef __int64_t __time_t; /* time()... */
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintptr_t;
#else #else
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
typedef __int32_t __register_t; typedef __int32_t __register_t;
typedef __int32_t __segsz_t; /* segment size (in pages) */ typedef __int32_t __segsz_t; /* segment size (in pages) */
typedef __uint32_t __size_t; /* sizeof() */ typedef __uint32_t __size_t; /* sizeof() */
typedef __int32_t __ssize_t; /* byte count or error */ typedef __int32_t __ssize_t; /* byte count or error */
typedef __int32_t __time_t; /* time()... */ #endif
typedef __int64_t __time_t; /* time()... */
#ifdef __LP64__
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintptr_t;
#else
typedef __uint32_t __uintfptr_t; typedef __uint32_t __uintfptr_t;
typedef __uint32_t __uintptr_t; typedef __uint32_t __uintptr_t;
#endif #endif

View File

@ -48,9 +48,9 @@ struct mdproc {
#ifdef __powerpc64__ #ifdef __powerpc64__
#define KINFO_PROC_SIZE 1088 #define KINFO_PROC_SIZE 1088
#define KINFO_PROC32_SIZE 768 #define KINFO_PROC32_SIZE 816
#else #else
#define KINFO_PROC_SIZE 768 #define KINFO_PROC_SIZE 816
#endif #endif
struct syscall_args { struct syscall_args {

View File

@ -66,9 +66,6 @@ struct acctv3 {
float ac_io; /* count of IO blocks */ float ac_io; /* count of IO blocks */
__dev_t ac_tty; /* controlling tty */ __dev_t ac_tty; /* controlling tty */
uint32_t ac_pad0; uint32_t ac_pad0;
#if defined(__powerpc__) && !defined(_LP64)
uint32_t ac_pad1;
#endif
uint16_t ac_len2; /* record length */ uint16_t ac_len2; /* record length */
union { union {
uint32_t ac_align; /* force v1 compatible alignment */ uint32_t ac_align; /* force v1 compatible alignment */

View File

@ -58,7 +58,7 @@
* in the range 5 to 9. * in the range 5 to 9.
*/ */
#undef __FreeBSD_version #undef __FreeBSD_version
#define __FreeBSD_version 1200035 /* Master, propagated to newvers */ #define __FreeBSD_version 1200036 /* Master, propagated to newvers */
/* /*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,