kumquat-buildroot/package/gdb/9.2/0004-gdbserver-fix-build-for-m68k.patch
Maxim Kochetkov 5377f8de7a package/gdb: bump to version 9.2
The in-tree build restriction has been added after the move of gnulib
to top level [1] [2].  This restriction has been added as a workaround
a build issue with gdbserver that still uses its own copy of gnulib.

gnulib is configured a second time if we build in-tree gdb and gdbserver:

    configure: error: source directory already configured; run "make distclean" there first
    configure: error: .././../../gnulib/configure failed for build-gnulib-gdbserver
    configure: error: ./configure failed for gdbserver

Use the same pre-configure-hook as gcc package.

Older gdb version support building out of tree even if it's not
required.

There is no in-tree build restriction of we only build gdbserver for
the target.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=73cc72729a184f00bf6fc4d74684a8516ba6b683
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=043a0010933a6b55081535ecaf7fde9cc1491be0

See:
https://sourceware.org/pipermail/gdb-announce/2020/000122.html
https://sourceware.org/pipermail/gdb-announce/2020/000123.html

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
[Romain:
    - add in-tree build support
    - improve commit log]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-08-17 12:04:46 +02:00

63 lines
1.9 KiB
Diff

From 448e481aab86c823d908530038e20a14213db0a2 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Fri, 22 Jun 2018 22:40:26 +0200
Subject: [PATCH] gdbserver: fix build for m68k
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,
the build fails on m68k with the following diagnostics:
In file included from ./../nat/linux-ptrace.h:28:0,
from linux-low.h:27,
from linux-m68k-low.c:20:
[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant
PT_D1 = 0,
^
[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant
[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant
In file included from linux-m68k-low.c:27:0:
[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token
};
^
Fix this by moving <sys/reg.h> on top of "linux-low.h".
[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/gdbserver/linux-m68k-low.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index 16f639d02fc..969d9973737 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -17,16 +17,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
#include "linux-low.h"
/* Defined in auto-generated file reg-m68k.c. */
void init_registers_m68k (void);
extern const struct target_desc *tdesc_m68k;
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
-
#define m68k_num_regs 29
#define m68k_num_gregs 18
--
2.21.0