diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-01-04 16:45:14 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-01-05 00:46:00 +0000 |
commit | b1ad748754401613b5cf8e5d46b38ad1ee49d07a (patch) | |
tree | 24be05aa3e7aee607b59f8c6479c51387813b6a9 /gcc | |
parent | e36e57b032b2d70eaa1294d5921e4fd8ce12a74d (diff) | |
download | gcc-b1ad748754401613b5cf8e5d46b38ad1ee49d07a.zip gcc-b1ad748754401613b5cf8e5d46b38ad1ee49d07a.tar.gz gcc-b1ad748754401613b5cf8e5d46b38ad1ee49d07a.tar.bz2 |
libstdc++: Only use std::atomic<tzdb_list::_Node*> if lock free [PR108228]
This fixes linker errors for hppa-hp-hpux11.11 due to an undefined weak
symbol and the use of atomic operations that require libatomic.
The weak symbol can simply be defined, which we already do for darwin.
The std::atomic<_Node*> is only an optimization, so can be avoided for
targets where the underlying atomic ops aren't available without help
from libatomic. The accesses to the std::atomic<_Node*> can be
abstracted behind a new API for getting and setting the cached value,
and then the atomics can be used conditionally.
libstdc++-v3/ChangeLog:
PR libstdc++/108228
PR libstdc++/108235
* config/abi/pre/gnu.ver: Move zoneinfo_dir_override export to
the latest symbol version.
* src/c++20/tzdb.cc (USE_ATOMIC_SHARED_PTR): Define to 0 if
atomic<_Node*> is not always lock free.
(USE_ATOMIC_LIST_HEAD): New macro.
[__hpux__] (__gnu_cxx::zoneinfo_dir_override()): Provide
definition of weak symbol.
(tzdb_list::_Node::_S_head): Rename to _S_head_cache.
(tzdb_list::_Node::_S_list_head): New function for accessing
list head efficiently.
(tzdb_list::_Node::_S_cache_list_head): New function for
updating _S_list_head.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions