aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/configure.ac
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-05-16 15:09:20 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-05-16 18:31:19 +0100
commit94a311abf783de754f0f1b2d4c1f00a9788e795b (patch)
tree61e5fc53f07b21755c5edd434d205c8be5e39383 /libstdc++-v3/configure.ac
parentd5e5007c4b534391c0a97be56f6024fde1a88682 (diff)
downloadgcc-94a311abf783de754f0f1b2d4c1f00a9788e795b.zip
gcc-94a311abf783de754f0f1b2d4c1f00a9788e795b.tar.gz
gcc-94a311abf783de754f0f1b2d4c1f00a9788e795b.tar.bz2
libstdc++: Disable cacheline alignment for DJGPP [PR109741]
DJGPP (and maybe other targets) uses MAX_OFILE_ALIGNMENT=16 which means that globals (and static objects) can't have alignment greater than 16. This causes an error for the locks defined in src/c++11/shared_ptr.cc because we try to align them to the cacheline size, to avoid false sharing. Add a configure check for the increased alignment, and live with false sharing where we can't increase the alignment. libstdc++-v3/ChangeLog: PR libstdc++/109741 * acinclude.m4 (GLIBCXX_CHECK_ALIGNAS_CACHELINE): Define. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Use GLIBCXX_CHECK_ALIGNAS_CACHELINE. * src/c++11/shared_ptr.cc (__gnu_internal::get_mutex): Do not align lock table if not supported. use __GCC_DESTRUCTIVE_SIZE instead of hardcoded 64.
Diffstat (limited to 'libstdc++-v3/configure.ac')
-rw-r--r--libstdc++-v3/configure.ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 0dd550a..df01f58 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -538,6 +538,9 @@ GLIBCXX_EMERGENCY_EH_ALLOC
# For src/c++20/tzdb.cc defaults.
GLIBCXX_ZONEINFO_DIR
+# For src/c++11/shared_ptr.cc alignment.
+GLIBCXX_CHECK_ALIGNAS_CACHELINE
+
# Define documentation rules conditionally.
# See if makeinfo has been installed and is modern enough