public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <pedro@palves.net>
Subject: [PATCH][gdb/build] Fix build with gcc 4.8.5
Date: Tue, 12 Jul 2022 13:31:26 +0200	[thread overview]
Message-ID: <20220712113125.GA14559@delia.home> (raw)

Hi,

When building gdb with gcc 4.8.5, we run into problems due to unconditionally
using:
...
     gdb_static_assert (std::is_trivially_copyable<packed>::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<packed>::value);
+#endif
     gdb_static_assert (std::is_copy_constructible<packed>::value);
     gdb_static_assert (std::is_move_constructible<packed>::value);
     gdb_static_assert (std::is_copy_assignable<packed>::value);

             reply	other threads:[~2022-07-12 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 11:31 Tom de Vries [this message]
2022-07-12 11:36 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220712113125.GA14559@delia.home \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).