From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 1C6BC3858C53 for ; Tue, 12 Jul 2022 11:31:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1C6BC3858C53 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5D1B422A98; Tue, 12 Jul 2022 11:31:28 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 44DFA13A94; Tue, 12 Jul 2022 11:31:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4IKbD5BbzWLACgAAMHmgww (envelope-from ); Tue, 12 Jul 2022 11:31:28 +0000 Date: Tue, 12 Jul 2022 13:31:26 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: [PATCH][gdb/build] Fix build with gcc 4.8.5 Message-ID: <20220712113125.GA14559@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 11:31:30 -0000 Hi, When building gdb with gcc 4.8.5, we run into problems due to unconditionally using: ... gdb_static_assert (std::is_trivially_copyable::value); ... in gdbsupport/packed.h. Fix this by guarding the usage with HAVE_IS_TRIVIALLY_COPYABLE. Tested by doing a full gdb build with gcc 4.8.5. Any comments? Thanks, - Tom [gdb/build] Fix build with gcc 4.8.5 --- gdbsupport/packed.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdbsupport/packed.h b/gdbsupport/packed.h index ebc66c0cb1a..cd331b5477d 100644 --- a/gdbsupport/packed.h +++ b/gdbsupport/packed.h @@ -18,6 +18,8 @@ #ifndef PACKED_H #define PACKED_H +#include "traits.h" + /* 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 @@ -38,7 +40,9 @@ struct packed gdb_static_assert (alignof (packed) == 1); /* Make sure packed can be wrapped with std::atomic. */ +#if HAVE_IS_TRIVIALLY_COPYABLE gdb_static_assert (std::is_trivially_copyable::value); +#endif gdb_static_assert (std::is_copy_constructible::value); gdb_static_assert (std::is_move_constructible::value); gdb_static_assert (std::is_copy_assignable::value);