0004-gdbserver-fix-build-for-m68k.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From 69cbbbbbd425111428db5ae91767dae5436ba63d Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@gmail.com>
  3. Date: Fri, 22 Jun 2018 22:40:26 +0200
  4. Subject: [PATCH] gdbserver: fix build for m68k
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,
  9. the build fails on m68k with the following diagnostics:
  10. In file included from ./../nat/linux-ptrace.h:28:0,
  11. from linux-low.h:27,
  12. from linux-m68k-low.c:20:
  13. [...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant
  14. PT_D1 = 0,
  15. ^
  16. [...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant
  17. [...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant
  18. In file included from linux-m68k-low.c:27:0:
  19. [...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token
  20. };
  21. ^
  22. Fix this by moving <sys/reg.h> on top of "linux-low.h".
  23. [1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
  24. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  25. ---
  26. gdb/gdbserver/linux-m68k-low.c | 9 +++++----
  27. 1 file changed, 5 insertions(+), 4 deletions(-)
  28. diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
  29. index 5594f10f927..19b4ef7b259 100644
  30. --- a/gdb/gdbserver/linux-m68k-low.c
  31. +++ b/gdb/gdbserver/linux-m68k-low.c
  32. @@ -17,16 +17,17 @@
  33. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  34. #include "server.h"
  35. +
  36. +#ifdef HAVE_SYS_REG_H
  37. +#include <sys/reg.h>
  38. +#endif
  39. +
  40. #include "linux-low.h"
  41. /* Defined in auto-generated file reg-m68k.c. */
  42. void init_registers_m68k (void);
  43. extern const struct target_desc *tdesc_m68k;
  44. -#ifdef HAVE_SYS_REG_H
  45. -#include <sys/reg.h>
  46. -#endif
  47. -
  48. #define m68k_num_regs 29
  49. #define m68k_num_gregs 18
  50. --
  51. 2.14.4