* [PATCH][gdb/build] Fix build with gcc 4.8.5
@ 2022-07-12 11:31 Tom de Vries
2022-07-12 11:36 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2022-07-12 11:31 UTC (permalink / raw)
To: gdb-patches; +Cc: Pedro Alves
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][gdb/build] Fix build with gcc 4.8.5
2022-07-12 11:31 [PATCH][gdb/build] Fix build with gcc 4.8.5 Tom de Vries
@ 2022-07-12 11:36 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2022-07-12 11:36 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 2022-07-12 12:31 p.m., Tom de Vries wrote:
> 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?
This is OK, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-12 11:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 11:31 [PATCH][gdb/build] Fix build with gcc 4.8.5 Tom de Vries
2022-07-12 11:36 ` Pedro Alves
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).