glibc set __TIMESIZE

1k views Asked by At

I'm trying to port my 32-bit ARM architecture to 64-bit time values.

Reading the answers from 64-bit time_t in Linux Kernel it tells me the following:

All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from linux-5.6 or higher.

I'm using a custom Linux kernel version 5.10.10 and build my own gcc toolchain with crosstool-ng using glibc version 2.32.

To test the time sizes, I wrote a simple print:

printf("Timesize = %d\n", __TIMESIZE);
printf("sizeof time_t = %d\n", sizeof(tv.tv_sec));

Which gives me the output:

Timesize = 32
sizeof time_t = 4

Following the defines and typedefs in glibc-2.32, I can see the relevant types defined as follows:

#define __TIMESIZE __WORDSIZE

#define __TIME_T_TYPE __SLONGWORD_TYPE

#define __SLONGWORD_TYPE long int

But __WORDSIZE and __SLONGWORD_TYPE are both 32-bit in size for my architecture.

Is it possible to have time_t defined as 64-bit on my 32-bit architecture target?

0

There are 0 answers