[PATCH] Disable year 2038 support on 32-bit hosts by default
Mon Aug 8 18:00:08 GMT 2022
On 8/8/22 18:55, Paul Eggert wrote:
> On 8/1/22 23:42, Luis Machado wrote:
>> Maybe the best course of action is to get autoconf patched to support year2038 checks and then use that
>> in binutils-gdb.
> Sorry, I'm a bit lost here.
> GDB can already do what Gnulib's largefile module does; that's just some .m4 code. It sounds like you don't want GDB to do that, and instead want Autoconf to do something - presumably, modify Autoconf's AC_SYS_LARGEFILE to do the same thing that Gnulib's AC_SYS_LARGEFILE does). Although Autoconf could do that, I don't see why that would be be any better for GDB than GDB's using the equivalent of Gnulib's largefile module in GDB's ACX_LARGEFILE macro.
> What am I missing?
The missing part here is that although GDB can indeed use Gnulib's default "enable 64-bit time_t on 32-bit hosts" check, BFD doesn't use Gnulib and so won't know anything about 64-bit time_t. BFD uses autoconf's AC_SYS_LARGEFILE, which seems like a copy of Gnulib's AC_SYS_LARGEFILE, sort of.
Given there is some shared code between GDB and BFD using struct stat, for example, this leads to memory corruption due to the discrepancies in struct size.
More information about the Binutils