From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0102A3858438; Mon, 18 Jul 2022 23:34:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0102A3858438 From: "pedro at palves dot net" To: gdb-prs@sourceware.org Subject: [Bug build/29373] Canadian Compilation Failed! gdbsupport/packed.h:41:40: error: static assertion failed for x86_64-w64-mingw32 host. Date: Mon, 18 Jul 2022 23:34:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 23:34:03 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29373 Pedro Alves changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro at palves dot net --- Comment #4 from Pedro Alves --- I can reproduce this here, cross building with mingw on Fedora. This is indeed an ABI issue -- mingw defaults to "-mms-bitfields", which affects how bitfields are laid out. Luckily, there's an attribute to switch ABI on a per struct basis. See: https://gcc.gnu.org/onlinedocs/gcc/x86-Variable-Attributes.html This fixes the build for me: diff --git c/gdbsupport/packed.h w/gdbsupport/packed.h index 3468cf44207..a3389afdfb7 100644 --- c/gdbsupport/packed.h +++ w/gdbsupport/packed.h @@ -20,6 +20,12 @@ #include "traits.h" +#ifdef __MINGW32__ +# define ATTRIBUTE_GCC_STRUCT __attribute__((gcc_struct)) +#else +# define ATTRIBUTE_GCC_STRUCT +#endif + /* Each instantiation and full specialization of the packed template defines a type that behaves like a given scalar type, but that has byte alignment, and, may optionally have a smaller size than the @@ -58,7 +64,7 @@ struct packed private: T m_val : (Bytes * HOST_CHAR_BIT) ATTRIBUTE_PACKED; -}; +} ATTRIBUTE_GCC_STRUCT; /* Add some comparisons between std::atomic> and T. We need this because the regular comparisons would require two implicit --=20 You are receiving this mail because: You are on the CC list for the bug.=