]> git.ipfire.org Git - thirdparty/gcc.git/commit
Libstdc++: Fix bootstrap failure for cross without tm.tm_zone [PR119550]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 31 Mar 2025 14:07:12 +0000 (15:07 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 31 Mar 2025 21:54:08 +0000 (22:54 +0100)
commit97cbe3cd5f36470884e940bda4469dc9b5b93cfd
tree1f4bf09a7630138d76a7375d44328f161744a9fd
parent0cb8889e51b91871121fb73c0457dc2a55b0f909
Libstdc++: Fix bootstrap failure for cross without tm.tm_zone [PR119550]

In r15-8491-g778c28c70f8573 I added a use of the Autoconf macro
AC_STRUCT_TIMEZONE, but that requires a link-test for the global tzname
object if tm.tm_zone isn't supported. That link-test isn't allowed for
cross-compilation, so bootstrap fails if tm.tm_zone isn't supported.

Since libstdc++ only cares about tm.tm_zone and won't use tzname anyway,
we don't need the link-test. Replace AC_STRUCT_TIMEZONE with a custom
macro that only checks for tm.tm_zone. We can improve on the Autoconf
macro by checking it's a suitable type, which isn't actually checked by
AC_STRUCT_TIMEZONE.

libstdc++-v3/ChangeLog:

PR libstdc++/119550
* acinclude.m4 (GLIBCXX_STRUCT_TM_TM_ZONE): New macro.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Use GLIBCXX_STRUCT_TM_TM_ZONE.
* include/bits/chrono_io.h (__formatter_chrono::_M_c): Check
_GLIBCXX_USE_STRUCT_TM_TM_ZONE instead of
_GLIBCXX_HAVE_STRUCT_TM_TM_ZONE.
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/configure.ac
libstdc++-v3/include/bits/chrono_io.h