kumquat-buildroot/package/gdb/9.2/0005-nat-fork-inferior-include-linux-ptrace.h.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

54 lines
1.9 KiB
Diff

From d84ecfa3a8c8fbade89229ac66c09f2a97ab00fb Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sun, 24 Jun 2018 23:33:55 +0200
Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h
To decide whether fork() or vfork() should be used, fork-inferior.c
uses the following test:
#if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
However, HAS_NOMMU is never defined, because it gets defined in
linux-ptrace.h, which is not included by fork-inferior.c. Due to this,
gdbserver fails to build on noMMU architectures. This commit fixes
that by simply including linux-ptrace.h.
This bug was introduced by commit
2090129c36c7e582943b7d300968d19b46160d84 ("Share fork_inferior et al
with gdbserver"). Indeed, the same fork()/vfork() selection was done,
but in another file where linux-ptrace.h was included.
Fixes the following build issue:
../nat/fork-inferior.c: In function 'pid_t fork_inferior(const char*, const string&, char**, void (*)(), void (*)(int), void (*)(), const char*, void (*)(const char*, char* const*, char* const*))':
../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope
pid = fork ();
^~~~
../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork'
pid = fork ();
^~~~
vfork
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[Romain: rebase on gdb 8.3]
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
gdb/nat/fork-inferior.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index fe9360a5039..626fe7c1fbf 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -27,6 +27,7 @@
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/signals-state-save-restore.h"
#include "gdbsupport/gdb_tilde_expand.h"
+#include "linux-ptrace.h"
#include <vector>
extern char **environ;
--
2.21.0