From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 359BF385842B; Tue, 12 Jul 2022 11:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 359BF385842B Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/build] Fix build with gcc 4.8.5 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: ac3972d81f1065a156daa0da97320262845c2469 X-Git-Newrev: 02f0597c46892c4b69e0af45a95509bf310c759e Message-Id: <20220712113700.359BF385842B@sourceware.org> Date: Tue, 12 Jul 2022 11:37:00 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 11:37:00 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D02f0597c4689= 2c4b69e0af45a95509bf310c759e commit 02f0597c46892c4b69e0af45a95509bf310c759e Author: Tom de Vries Date: Tue Jul 12 13:36:57 2022 +0200 [gdb/build] Fix build with gcc 4.8.5 =20 When building gdb with gcc 4.8.5, we run into problems due to unconditi= onally using: ... gdb_static_assert (std::is_trivially_copyable::value); ... in gdbsupport/packed.h. =20 Fix this by guarding the usage with HAVE_IS_TRIVIALLY_COPYABLE. =20 Tested by doing a full gdb build with gcc 4.8.5. Diff: --- 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 =20 +#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 @@ public: gdb_static_assert (alignof (packed) =3D=3D 1); =20 /* 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);