From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D9EB3858428; Tue, 19 Jul 2022 04:21:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D9EB3858428 From: "euloanty at live dot com" 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: Tue, 19 Jul 2022 04:21:47 +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: euloanty at live dot com 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: 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: Tue, 19 Jul 2022 04:21:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29373 --- Comment #5 from cqwrteur --- (In reply to Pedro Alves from comment #4) > I can reproduce this here, cross building with mingw on Fedora. >=20 > This is indeed an ABI issue -- mingw defaults to "-mms-bitfields", which > affects how bitfields are laid out. Luckily, there's an attribute to swi= tch > ABI on a per struct basis. See: >=20 > https://gcc.gnu.org/onlinedocs/gcc/x86-Variable-Attributes.html >=20 > This fixes the build for me: >=20 > 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 @@ >=20=20 > #include "traits.h" >=20=20 > +#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 >=20=20 > private: > T m_val : (Bytes * HOST_CHAR_BIT) ATTRIBUTE_PACKED; > -}; > +} ATTRIBUTE_GCC_STRUCT; >=20=20 > /* Add some comparisons between std::atomic> and T. We need > this because the regular comparisons would require two implicit Also cygwin and other pe targets. you probably need=20 #if __has_cpp_attribute(__gnu__::__gcc_struct__) #define ATTRIBUTE_GCC_STRUCT [[__gnu__::__gcc_struct__]] #endif something like that to detect the feature --=20 You are receiving this mail because: You are on the CC list for the bug.=