[Slackbuilds-users] 32-bit fails

B. Watson urchlay at slackware.uk
Sun Mar 27 15:13:11 UTC 2022



On Sun, 27 Mar 2022, Ozan Türkyılmaz wrote:

> Cum, 2022-03-25 tarihinde 11:56 -0400 saatinde, B. Watson yazdı:
>> 
>> 
>> On Fri, 25 Mar 2022, Ozan Türkyılmaz wrote:
>> 
>> The y2k38 issue... there's now kernel support for a 64-bit time_t on
>> 32-bit, but AFAICT no support in glibc.
>> 
> That's a big ABI break. I am not surprised they are holding it down.
> BSD  people used binary compatibility layer to handle this ABI break.

Actually... I looked into it a bit more... we *have* 64-bit time_t
support in glibc, on Slackware 15.0. It works like large file
support, you "#define _TIME_BITS 64" before including <sys/types.h>
or <time.h>. Doesn't break the ABI, it causes your code to be
compiled with 64-bit versions of the time-related functions (e.g.
you write "gettimeofday" and what really gets compiled is a call to a
gettimeofday64() function).

See https://www.gnu.org/software/libc/manual/html_mono/libc.html and
search for TIME_BITS within the page.

Also:

$ cat 1.c

#define _FILE_OFFSET_BITS 64
#define _TIME_BITS 64

#include <stdio.h>
#include <sys/types.h>

int main(int argc, char **argv) {
 	printf("%lu\n", sizeof(time_t));
 	return 0;
}

$ gcc -Wall -o 1 1.c
$ ./1
8

...didn't know this last week, or I would have used it for pdns
and and pdns-recursor. Just adding -D_FILE_OFFSET_BITS=64 and
-D_TIME_BITS=64 to SLKCFLAGS would be a better fix than what I
actually did.


More information about the SlackBuilds-users mailing list