]> git.ipfire.org Git - thirdparty/gcc.git/commit
Disable year 2038 support on 32-bit hosts by default
authorLuis Machado <luis.machado@arm.com>
Mon, 25 Jul 2022 23:17:38 +0000 (00:17 +0100)
committerArsen Arsenović <arsen@gcc.gnu.org>
Mon, 7 Aug 2023 20:59:38 +0000 (22:59 +0200)
commita49d42e8dfe2a8ac320782c5dd2751ea3f43db68
treecb1ccc240a837b190cf4731db9e38d15b4107146
parent24552056fd5fc677c0d032f54a5cad1c4303d312
Disable year 2038 support on 32-bit hosts by default

With a recent import of gnulib, code has been pulled that tests and enables
64-bit time_t by default on 32-bit hosts that support it.

Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
doesn't do these checks.

As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
have a mismatch between gdb's notion of time_t and bfd's notion of time_t.

This will lead to mismatches in the struct stat size, leading to memory
corruption and crashes.

This patch disables the year 2038 check for now, which makes things work
reliably again.

I'd consider this a temporary fix until we have proper bfd checks for the year
2038, if it makes sense.  64-bit hosts seems to be more common these days, so
I'm not sure how important it is to have this support enabled and how soon
we want to enable it.

Thoughts?

ChangeLog:

* configure.ac: Disable year2038 by default on 32-bit hosts.
* configure: Regenerate.
configure
configure.ac