aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-01-04 16:45:14 +0000
committerJonathan Wakely <jwakely@redhat.com>2023-01-05 00:46:00 +0000
commitb1ad748754401613b5cf8e5d46b38ad1ee49d07a (patch)
tree24be05aa3e7aee607b59f8c6479c51387813b6a9 /gcc
parente36e57b032b2d70eaa1294d5921e4fd8ce12a74d (diff)
downloadgcc-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