From patchwork Mon Jun 25 08:05:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 28009 Received: (qmail 48718 invoked by alias); 25 Jun 2018 08:05:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 47642 invoked by uid 89); 25 Jun 2018 08:05:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:thomas., Share, const*, gdbserver X-HELO: mail.bootlin.com Received: from mail.bootlin.com (HELO mail.bootlin.com) (62.4.15.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Jun 2018 08:05:55 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 50F2A207D4; Mon, 25 Jun 2018 10:05:52 +0200 (CEST) Received: from localhost (AAubervilliers-681-1-50-153.w90-88.abo.wanadoo.fr [90.88.168.153]) by mail.bootlin.com (Postfix) with ESMTPSA id 20E91203D9; Mon, 25 Jun 2018 10:05:52 +0200 (CEST) From: Thomas Petazzoni To: gdb-patches@sourceware.org Cc: Thomas Petazzoni Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h Date: Mon, 25 Jun 2018 10:05:47 +0200 Message-Id: <20180625080547.7629-1-thomas.petazzoni@bootlin.com> 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 --- 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 8b59387fa5..05167628a6 100644 --- a/gdb/nat/fork-inferior.c +++ b/gdb/nat/fork-inferior.c @@ -26,6 +26,7 @@ #include "common-gdbthread.h" #include "signals-state-save-restore.h" #include "gdb_tilde_expand.h" +#include "linux-ptrace.h" #include extern char **environ;