diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp --- a/lld/COFF/DebugTypes.cpp +++ b/lld/COFF/DebugTypes.cpp @@ -902,7 +902,11 @@ /// A ghash table cell for deduplicating types from TpiSources. class GHashCell { - uint64_t data = 0; + // Force "data" to be 64-bit aligned; otherwise, some versions of clang + // will generate calls to libatomic when using some versions of libstdc++ + // on 32-bit targets. (Also, in theory, there could be a target where + // new[] doesn't always return an 8-byte-aligned allocation.) + alignas(sizeof(uint64_t)) uint64_t data = 0; public: GHashCell() = default;