public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
@ 2017-04-25 20:23 Sergio Durigan Junior
  2017-04-25 21:08 ` John Baldwin
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-04-25 20:23 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Sergio Durigan Junior

Due to my ongoing work to make it possible for gdbserver to start the
inferior using the shell, I had to share the fork_inferior function
under the "nat/" directory.  In order to do that, I created a new file
and put the function there; however, this meant that I now had to
update some of the *.mh files (under "gdb/config") and add the new
file as a dependency to be built natively.  Bleh...

After talking a bit to Pedro about this, the idea came up to write a
new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
concentrate all of the native settings for each host/system.  I
decided to tackle this issue.

The patch is simple.  All of the previous Makefile variables that were
being declared inside the *.mh files are now inside "gdb/Makefile.in",
and "gdb/configure" is responsible for AC_SUBST'ing them.  The
definitions of these variables were put inside "gdb/configure.nat", so
now they're shell variables.  For excerpts of Makefile code, one must
create a file under "gdb/config/${gdb_cpu_host}" and reference it on
the "NAT_EXTRA_FRAGS_FILE" variable.

It should now be easier to update the native dependencies of hosts in
this single file.

This has been tested on x86_64 without regressions.

gdb/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile.in: Remove "@host_makefile_frag@".  Add variables
	NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
	NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_TARGET.  Add
	"@NAT_EXTRA_FRAGS_FILE@".
	(Makefile): Remove dependency on "@frags@".
	($(GNULIB_BUILDDIR)/Makefile): Likewise.
	(data-directory/Makefile): Likewise.
	* config/aarch64/linux.mh: Deleted; moved contents to
	"gdb/configure.nat".
	* config/alpha/alpha-linux.mh: Likewise.
	* config/alpha/nbsd.mh: Likewise.
	* config/arm/linux.mh: Likewise.
	* config/arm/nbsdelf.mh: Likewise.
	* config/i386/cygwin.mh: Likewise.
	* config/i386/cygwin64.mh: Likewise.
	* config/i386/darwin.mh: Likewise.
	* config/i386/fbsd.mh: Likewise.
	* config/i386/fbsd64.mh: Likewise.
	* config/i386/go32.mh: Likewise.
	* config/i386/i386gnu.mh: Likewise.
	* config/i386/i386sol2.mh: Likewise.
	* config/i386/linux.mh: Likewise.
	* config/i386/linux64.mh: Likewise.
	* config/i386/mingw.mh: Likewise.
	* config/i386/mingw64.mh: Likewise.
	* config/i386/nbsd64.mh: Likewise.
	* config/i386/nbsdelf.mh: Likewise.
	* config/i386/nto.mh: Likewise.
	* config/i386/obsd.mh: Likewise.
	* config/i386/obsd64.mh: Likewise.
	* config/i386/sol2-64.mh: Likewise.
	* config/ia64/linux.mh: Likewise.
	* config/m32r/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/m68k/nbsdelf.mh: Likewise.
	* config/m68k/obsd.mh: Likewise.
	* config/m88k/obsd.mh: Likewise.
	* config/mips/fbsd.mh: Likewise.
	* config/mips/linux.mh: Likewise.
	* config/mips/nbsd.mh: Likewise.
	* config/mips/obsd64.mh: Likewise.
	* config/pa/linux.mh: Likewise.
	* config/pa/nbsd.mh: Likewise.
	* config/pa/obsd.mh: Likewise.
	* config/powerpc/aix.mh: Likewise.
	* config/powerpc/fbsd.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/powerpc/nbsd.mh: Likewise.
	* config/powerpc/obsd.mh: Likewise.
	* config/powerpc/ppc64-linux.mh: Likewise.
	* config/powerpc/spu-linux.mh: Likewise.
	* config/s390/linux.mh: Likewise.
	* config/sh/nbsd.mh: Likewise.
	* config/sparc/fbsd.mh: Likewise.
	* config/sparc/linux.mh: Likewise.
	* config/sparc/linux64.mh: Likewise.
	* config/sparc/nbsd64.mh: Likewise.
	* config/sparc/nbsdelf.mh: Likewise.
	* config/sparc/obsd64.mh: Likewise.
	* config/sparc/sol2.mh: Likewise.
	* config/tilegx/linux.mh: Likewise.
	* config/vax/nbsdelf.mh: Likewise.
	* config/vax/obsd.mh: Likewise.
	* config/xtensa/linux.mh: Likewise.
	* config/i386/i386gnu-extra.mh: New file.
	* configure: Regenerate.
	* configure.ac: Rewrite code to use "gdb/configure.nat" instead of
	*.mh files under "gdb/config".
	* configure.nat: New file, with contents from the
	"gdb/config/*/*.mh" files.

gdb/doc/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile: Remove "@host_makefile_frag".
---
 gdb/Makefile.in                                  |  17 +-
 gdb/config/aarch64/linux.mh                      |  29 --
 gdb/config/alpha/alpha-linux.mh                  |  15 -
 gdb/config/alpha/nbsd.mh                         |   4 -
 gdb/config/arm/linux.mh                          |  10 -
 gdb/config/arm/nbsdelf.mh                        |   2 -
 gdb/config/i386/cygwin.mh                        |   3 -
 gdb/config/i386/cygwin64.mh                      |  20 -
 gdb/config/i386/darwin.mh                        |   4 -
 gdb/config/i386/fbsd.mh                          |   8 -
 gdb/config/i386/fbsd64.mh                        |   7 -
 gdb/config/i386/go32.mh                          |  11 -
 gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} |  23 +-
 gdb/config/i386/i386sol2.mh                      |   4 -
 gdb/config/i386/linux.mh                         |  14 -
 gdb/config/i386/linux64.mh                       |  15 -
 gdb/config/i386/mingw.mh                         |   3 -
 gdb/config/i386/mingw64.mh                       |   1 -
 gdb/config/i386/nbsd64.mh                        |   3 -
 gdb/config/i386/nbsdelf.mh                       |   5 -
 gdb/config/i386/nto.mh                           |   4 -
 gdb/config/i386/obsd.mh                          |   5 -
 gdb/config/i386/obsd64.mh                        |   5 -
 gdb/config/i386/sol2-64.mh                       |   4 -
 gdb/config/ia64/linux.mh                         |  13 -
 gdb/config/m32r/linux.mh                         |  10 -
 gdb/config/m68k/linux.mh                         |  14 -
 gdb/config/m68k/nbsdelf.mh                       |   4 -
 gdb/config/m68k/obsd.mh                          |   4 -
 gdb/config/m88k/obsd.mh                          |   2 -
 gdb/config/mips/fbsd.mh                          |   3 -
 gdb/config/mips/linux.mh                         |  11 -
 gdb/config/mips/nbsd.mh                          |   2 -
 gdb/config/mips/obsd64.mh                        |   2 -
 gdb/config/pa/linux.mh                           |  10 -
 gdb/config/pa/nbsd.mh                            |   2 -
 gdb/config/pa/obsd.mh                            |   2 -
 gdb/config/powerpc/aix.mh                        |   8 -
 gdb/config/powerpc/fbsd.mh                       |  24 -
 gdb/config/powerpc/linux.mh                      |  12 -
 gdb/config/powerpc/nbsd.mh                       |   4 -
 gdb/config/powerpc/obsd.mh                       |   4 -
 gdb/config/powerpc/ppc64-linux.mh                |  15 -
 gdb/config/powerpc/spu-linux.mh                  |   8 -
 gdb/config/s390/linux.mh                         |   9 -
 gdb/config/sh/nbsd.mh                            |   2 -
 gdb/config/sparc/fbsd.mh                         |   7 -
 gdb/config/sparc/linux.mh                        |  13 -
 gdb/config/sparc/linux64.mh                      |  13 -
 gdb/config/sparc/nbsd64.mh                       |   5 -
 gdb/config/sparc/nbsdelf.mh                      |   5 -
 gdb/config/sparc/obsd64.mh                       |   5 -
 gdb/config/sparc/sol2.mh                         |   6 -
 gdb/config/tilegx/linux.mh                       |  13 -
 gdb/config/vax/nbsdelf.mh                        |   5 -
 gdb/config/vax/obsd.mh                           |   5 -
 gdb/config/xtensa/linux.mh                       |  11 -
 gdb/configure                                    |  34 +-
 gdb/configure.ac                                 |  33 +-
 gdb/configure.nat                                | 591 +++++++++++++++++++++++
 gdb/doc/Makefile.in                              |   3 -
 61 files changed, 637 insertions(+), 493 deletions(-)
 delete mode 100644 gdb/config/aarch64/linux.mh
 delete mode 100644 gdb/config/alpha/alpha-linux.mh
 delete mode 100644 gdb/config/alpha/nbsd.mh
 delete mode 100644 gdb/config/arm/linux.mh
 delete mode 100644 gdb/config/arm/nbsdelf.mh
 delete mode 100644 gdb/config/i386/cygwin.mh
 delete mode 100644 gdb/config/i386/cygwin64.mh
 delete mode 100644 gdb/config/i386/darwin.mh
 delete mode 100644 gdb/config/i386/fbsd.mh
 delete mode 100644 gdb/config/i386/fbsd64.mh
 delete mode 100644 gdb/config/i386/go32.mh
 rename gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} (58%)
 delete mode 100644 gdb/config/i386/i386sol2.mh
 delete mode 100644 gdb/config/i386/linux.mh
 delete mode 100644 gdb/config/i386/linux64.mh
 delete mode 100644 gdb/config/i386/mingw.mh
 delete mode 100644 gdb/config/i386/mingw64.mh
 delete mode 100644 gdb/config/i386/nbsd64.mh
 delete mode 100644 gdb/config/i386/nbsdelf.mh
 delete mode 100644 gdb/config/i386/nto.mh
 delete mode 100644 gdb/config/i386/obsd.mh
 delete mode 100644 gdb/config/i386/obsd64.mh
 delete mode 100644 gdb/config/i386/sol2-64.mh
 delete mode 100644 gdb/config/ia64/linux.mh
 delete mode 100644 gdb/config/m32r/linux.mh
 delete mode 100644 gdb/config/m68k/linux.mh
 delete mode 100644 gdb/config/m68k/nbsdelf.mh
 delete mode 100644 gdb/config/m68k/obsd.mh
 delete mode 100644 gdb/config/m88k/obsd.mh
 delete mode 100644 gdb/config/mips/fbsd.mh
 delete mode 100644 gdb/config/mips/linux.mh
 delete mode 100644 gdb/config/mips/nbsd.mh
 delete mode 100644 gdb/config/mips/obsd64.mh
 delete mode 100644 gdb/config/pa/linux.mh
 delete mode 100644 gdb/config/pa/nbsd.mh
 delete mode 100644 gdb/config/pa/obsd.mh
 delete mode 100644 gdb/config/powerpc/aix.mh
 delete mode 100644 gdb/config/powerpc/fbsd.mh
 delete mode 100644 gdb/config/powerpc/linux.mh
 delete mode 100644 gdb/config/powerpc/nbsd.mh
 delete mode 100644 gdb/config/powerpc/obsd.mh
 delete mode 100644 gdb/config/powerpc/ppc64-linux.mh
 delete mode 100644 gdb/config/powerpc/spu-linux.mh
 delete mode 100644 gdb/config/s390/linux.mh
 delete mode 100644 gdb/config/sh/nbsd.mh
 delete mode 100644 gdb/config/sparc/fbsd.mh
 delete mode 100644 gdb/config/sparc/linux.mh
 delete mode 100644 gdb/config/sparc/linux64.mh
 delete mode 100644 gdb/config/sparc/nbsd64.mh
 delete mode 100644 gdb/config/sparc/nbsdelf.mh
 delete mode 100644 gdb/config/sparc/obsd64.mh
 delete mode 100644 gdb/config/sparc/sol2.mh
 delete mode 100644 gdb/config/tilegx/linux.mh
 delete mode 100644 gdb/config/vax/nbsdelf.mh
 delete mode 100644 gdb/config/vax/obsd.mh
 delete mode 100644 gdb/config/xtensa/linux.mh
 create mode 100644 gdb/configure.nat

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index b865b7c..ff4c7e1 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -903,7 +903,16 @@ ALL_TARGET_OBS = \
 	xtensa-tdep.o
 
 # Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
+NAT_FILE = @NAT_FILE@
+NATDEPFILES = @NATDEPFILES@
+NAT_CDEPS = @NAT_CDEPS@
+LOADLIBES = @LOADLIBES@
+MH_CFLAGS = @MH_CFLAGS@
+XM_CLIBS = @XM_CLIBS@
+NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
+HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
+
+@NAT_EXTRA_FRAGS_FILE@
 # End of host-dependent makefile fragment
 
 FLAGS_TO_PASS = \
@@ -2315,21 +2324,21 @@ subdir_do: force
 		else true ; fi ; \
 	done
 
-Makefile: Makefile.in config.status @frags@
+Makefile: Makefile.in config.status
 	# Regenerate the Makefile and the tm.h / nm.h links.
 	CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS= \
 	  CONFIG_HEADERS= \
 	  $(SHELL) config.status
 
-$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status @frags@
+$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
 	@cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
 	  CONFIG_LINKS= \
 	  $(SHELL) config.status
 
-data-directory/Makefile: data-directory/Makefile.in config.status @frags@
+data-directory/Makefile: data-directory/Makefile.in config.status
 	CONFIG_FILES="data-directory/Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh
deleted file mode 100644
index d184a79..0000000
--- a/gdb/config/aarch64/linux.mh
+++ /dev/null
@@ -1,29 +0,0 @@
-#  Host: AArch64 based machine running GNU/Linux
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#  Contributed by ARM Ltd.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
-	proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
-	aarch64-linux.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
deleted file mode 100644
index 4991dd2..0000000
--- a/gdb/config/alpha/alpha-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: Little-endian Alpha running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
-	fork-child.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
-
-# doublest.c currently assumes some properties of FP arithmetic
-# on the host which require this.
-MH_CFLAGS = -mieee
diff --git a/gdb/config/alpha/nbsd.mh b/gdb/config/alpha/nbsd.mh
deleted file mode 100644
index a46739e..0000000
--- a/gdb/config/alpha/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/alpha
-NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh
deleted file mode 100644
index 003ca1f..0000000
--- a/gdb/config/arm/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: ARM based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
-	aarch32-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/arm/nbsdelf.mh b/gdb/config/arm/nbsdelf.mh
deleted file mode 100644
index 042b583..0000000
--- a/gdb/config/arm/nbsdelf.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o arm-nbsd-nat.o
diff --git a/gdb/config/i386/cygwin.mh b/gdb/config/i386/cygwin.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/cygwin.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/cygwin64.mh b/gdb/config/i386/cygwin64.mh
deleted file mode 100644
index 4f70adc..0000000
--- a/gdb/config/i386/cygwin64.mh
+++ /dev/null
@@ -1,20 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
deleted file mode 100644
index 16c1558..0000000
--- a/gdb/config/i386/darwin.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: IA86 running Darwin
-
-NATDEPFILES = fork-child.o darwin-nat.o \
-     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
deleted file mode 100644
index 69e0a8b..0000000
--- a/gdb/config/i386/fbsd.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: FreeBSD/i386
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
-	i386-fbsd-nat.o bsd-kvm.o
-NAT_FILE= nm-fbsd.h
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
deleted file mode 100644
index 461ff9a..0000000
--- a/gdb/config/i386/fbsd64.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
-	bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh
deleted file mode 100644
index f1edfad..0000000
--- a/gdb/config/i386/go32.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Intel x86 running DJGPP
-
-# We include several header files from config/djgpp
-MH_CFLAGS= -I$(srcdir)/config/djgpp
-
-NATDEPFILES= go32-nat.o x86-nat.o x86-dregs.o
-
-HOST_IPC=
-XM_CLIBS= -ldbg
-
-
diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
similarity index 58%
rename from gdb/config/i386/i386gnu.mh
rename to gdb/config/i386/i386gnu-extra.mh
index 070497f..1f2d937 100644
--- a/gdb/config/i386/i386gnu.mh
+++ b/gdb/config/i386/i386gnu-extra.mh
@@ -1,21 +1,9 @@
-# Host: Intel 386 running the GNU Hurd
-NATDEPFILES= i386-gnu-nat.o gnu-nat.o \
-	     x86-nat.o x86-dregs.o fork-child.o \
-	     notify_S.o process_reply_S.o msg_reply_S.o \
-	     msg_U.o exc_request_U.o exc_request_S.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-NAT_FILE= nm-i386gnu.h
-MH_CFLAGS = -D_GNU_SOURCE
-
-XM_CLIBS = -lshouldbeinlibc
-
 # Use our own user stubs for the msg rpcs, so we can make them time out, in
 # case the program is fucked, or we guess the wrong signal thread.
-msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
+msg-MIGUFLAGS=-D'MSG_IMPORTS=waittime 1000;'
 
 # ick
-MIGCOM = $(MIG) -cc cat - /dev/null
+MIGCOM=$(MIG) -cc cat - /dev/null
 
 # Reply servers need special massaging of the code mig generates, to make
 # them work correctly for error returns in some cases.
@@ -33,9 +21,4 @@ MIGCOM = $(MIG) -cc cat - /dev/null
 	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
 
 # MIG stubs are not yet ready for C++ compilation.
-%_S.o %_U.o : COMPILE.post += -x c
-
-NAT_GENERATED_FILES = notify_S.h notify_S.c \
-	process_reply_S.h process_reply_S.c \
-	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
-	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
+%_S.o %_U.o : COMPILE.post +=-x c"
diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
deleted file mode 100644
index 787a3c1..0000000
--- a/gdb/config/i386/i386sol2.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86
-NATDEPFILES= fork-child.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
deleted file mode 100644
index 421c56f..0000000
--- a/gdb/config/i386/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Intel 386 running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
deleted file mode 100644
index 42d8df5..0000000
--- a/gdb/config/i386/linux64.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: GNU/Linux x86-64
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
-	x86-linux-nat.o \
-	linux-nat.o linux-osdata.o \
-	proc-service.o linux-thread-db.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-btrace.o \
-	linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/mingw.mh b/gdb/config/i386/mingw.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/mingw.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/mingw64.mh b/gdb/config/i386/mingw64.mh
deleted file mode 100644
index 0ee2e2c..0000000
--- a/gdb/config/i386/mingw64.mh
+++ /dev/null
@@ -1 +0,0 @@
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
deleted file mode 100644
index 91d21f3..0000000
--- a/gdb/config/i386/nbsd64.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: NetBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
deleted file mode 100644
index 5954b3f..0000000
--- a/gdb/config/i386/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/nto.mh b/gdb/config/i386/nto.mh
deleted file mode 100644
index b9e2f84..0000000
--- a/gdb/config/i386/nto.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Intel 386 running QNX.
-
-NATDEPFILES= nto-procfs.o
-NAT_FILE= config/nm-nto.h
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
deleted file mode 100644
index fac7282..0000000
--- a/gdb/config/i386/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
deleted file mode 100644
index 51deea7..0000000
--- a/gdb/config/i386/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/sol2-64.mh b/gdb/config/i386/sol2-64.mh
deleted file mode 100644
index 7a3ab73..0000000
--- a/gdb/config/i386/sol2-64.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86_64
-NATDEPFILES= fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh
deleted file mode 100644
index b05f834..0000000
--- a/gdb/config/ia64/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Intel IA-64 running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ia64-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-personality.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
deleted file mode 100644
index 277d8bd..0000000
--- a/gdb/config/m32r/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: M32R based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o				\
-	m32r-linux-nat.o proc-service.o linux-thread-db.o	\
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh
deleted file mode 100644
index 7c1f4ac..0000000
--- a/gdb/config/m68k/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Motorola m68k running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	m68k-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/nbsdelf.mh b/gdb/config/m68k/nbsdelf.mh
deleted file mode 100644
index 1d00cbc..0000000
--- a/gdb/config/m68k/nbsdelf.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/m68k ELF
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m68k/obsd.mh b/gdb/config/m68k/obsd.mh
deleted file mode 100644
index 902a24b..0000000
--- a/gdb/config/m68k/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/m68k
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m88k/obsd.mh b/gdb/config/m88k/obsd.mh
deleted file mode 100644
index 3c4d8d5..0000000
--- a/gdb/config/m88k/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/m88k
-NATDEPFILES= fork-child.o inf-ptrace.o m88k-bsd-nat.o
diff --git a/gdb/config/mips/fbsd.mh b/gdb/config/mips/fbsd.mh
deleted file mode 100644
index f433347..0000000
--- a/gdb/config/mips/fbsd.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: FreeBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh
deleted file mode 100644
index 11ff903..0000000
--- a/gdb/config/mips/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Linux/MIPS
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o \
-	mips-linux-watch.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/mips/nbsd.mh b/gdb/config/mips/nbsd.mh
deleted file mode 100644
index a80da95..0000000
--- a/gdb/config/mips/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o mips-nbsd-nat.o
diff --git a/gdb/config/mips/obsd64.mh b/gdb/config/mips/obsd64.mh
deleted file mode 100644
index 6aeac34..0000000
--- a/gdb/config/mips/obsd64.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/mips64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o
diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
deleted file mode 100644
index 1b73ecd..0000000
--- a/gdb/config/pa/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: Hewlett-Packard PA-RISC machine, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	hppa-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/pa/nbsd.mh b/gdb/config/pa/nbsd.mh
deleted file mode 100644
index 791cd9f..0000000
--- a/gdb/config/pa/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o
diff --git a/gdb/config/pa/obsd.mh b/gdb/config/pa/obsd.mh
deleted file mode 100644
index 95dd416..0000000
--- a/gdb/config/pa/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o
diff --git a/gdb/config/powerpc/aix.mh b/gdb/config/powerpc/aix.mh
deleted file mode 100644
index 141501d..0000000
--- a/gdb/config/powerpc/aix.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: IBM PowerPC running AIX
-
-# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
-NATDEPFILES= fork-child.o inf-ptrace.o rs6000-nat.o
-
-# When compiled with cc, for debugging, this argument should be passed.
-# We have no idea who our current compiler is though, so we skip it.
-# MH_CFLAGS = -bnodelcsect
diff --git a/gdb/config/powerpc/fbsd.mh b/gdb/config/powerpc/fbsd.mh
deleted file mode 100644
index 9c2e6b4..0000000
--- a/gdb/config/powerpc/fbsd.mh
+++ /dev/null
@@ -1,24 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
-
diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
deleted file mode 100644
index f4a52c3..0000000
--- a/gdb/config/powerpc/linux.mh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Host: PowerPC, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh
deleted file mode 100644
index f02a0f9..0000000
--- a/gdb/config/powerpc/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/obsd.mh b/gdb/config/powerpc/obsd.mh
deleted file mode 100644
index 3743254..0000000
--- a/gdb/config/powerpc/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
deleted file mode 100644
index 8681d00..0000000
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: PowerPC64, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o ppc-linux.o linux-personality.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/spu-linux.mh b/gdb/config/powerpc/spu-linux.mh
deleted file mode 100644
index 9205b62..0000000
--- a/gdb/config/powerpc/spu-linux.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Cell BE (PowerPC64 + SPU)
-
-# This implements a 'pseudo-native' GDB running on the
-# PPU side of the Cell BE and debugging the SPU side.
-
-NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
-	      linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	      linux-personality.o linux-namespaces.o
diff --git a/gdb/config/s390/linux.mh b/gdb/config/s390/linux.mh
deleted file mode 100644
index 4a137cd..0000000
--- a/gdb/config/s390/linux.mh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Host: S390, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sh/nbsd.mh b/gdb/config/sh/nbsd.mh
deleted file mode 100644
index 14d7e8c..0000000
--- a/gdb/config/sh/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/sh
-NATDEPFILES= fork-child.o inf-ptrace.o sh-nbsd-nat.o
diff --git a/gdb/config/sparc/fbsd.mh b/gdb/config/sparc/fbsd.mh
deleted file mode 100644
index bdc272c..0000000
--- a/gdb/config/sparc/fbsd.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
-	bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
deleted file mode 100644
index 385f640..0000000
--- a/gdb/config/sparc/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux SPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh
deleted file mode 100644
index 8df0de1..0000000
--- a/gdb/config/sparc/linux64.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux UltraSPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/nbsd64.mh b/gdb/config/sparc/nbsd64.mh
deleted file mode 100644
index aa15b1d..0000000
--- a/gdb/config/sparc/nbsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
deleted file mode 100644
index 97d07b3..0000000
--- a/gdb/config/sparc/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/obsd64.mh b/gdb/config/sparc/obsd64.mh
deleted file mode 100644
index e9f2fb9..0000000
--- a/gdb/config/sparc/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
deleted file mode 100644
index 220c61f..0000000
--- a/gdb/config/sparc/sol2.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Solaris SPARC & UltraSPARC
-NAT_FILE= nm-sol2.h
-NATDEPFILES= sparc-sol2-nat.o \
-	fork-child.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/tilegx/linux.mh b/gdb/config/tilegx/linux.mh
deleted file mode 100644
index ec648d3..0000000
--- a/gdb/config/tilegx/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Tilera TILE-Gx running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	tilegx-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/vax/nbsdelf.mh b/gdb/config/vax/nbsdelf.mh
deleted file mode 100644
index bf0f0b9..0000000
--- a/gdb/config/vax/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/vax/obsd.mh b/gdb/config/vax/obsd.mh
deleted file mode 100644
index cef99d3..0000000
--- a/gdb/config/vax/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/vax
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/xtensa/linux.mh b/gdb/config/xtensa/linux.mh
deleted file mode 100644
index d5b8f91..0000000
--- a/gdb/config/xtensa/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Xtensa, running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-
-NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/configure b/gdb/configure
index 9f05b4b..f1068ba 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -598,7 +598,13 @@ GDB_NM_FILE
 LTLIBBABELTRACE
 LIBBABELTRACE
 HAVE_LIBBABELTRACE
-frags
+NAT_GENERATED_FILES
+XM_CLIBS
+MH_CFLAGS
+LOADLIBES
+NAT_CDEPS
+NATDEPFILES
+NAT_FILE
 target_subdir
 CONFIG_UNINSTALL
 CONFIG_INSTALL
@@ -799,7 +805,7 @@ PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files='host_makefile_frag'
+ac_subst_files='NAT_EXTRA_FRAGS_FILE'
 ac_user_opts='
 enable_option_checking
 enable_maintainer_mode
@@ -16724,27 +16730,21 @@ if test "${host}" != "${target}"; then
 fi
 
 
-frags=
+# Importing nat definitions.
+NAT_EXTRA_FRAGS_FILE=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
 
 
 
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
+
+
+
+
+
 
 
 if test x"${gdb_osabi}" != x ; then
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 50f6f59..f9d8aac 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
 fi
 AC_SUBST(target_subdir)
 
-frags=
+# Importing nat definitions.
+NAT_EXTRA_FRAGS_FILE=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
-AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST(frags)
-
-changequote(,)dnl
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
-changequote([,])
+AC_SUBST(NAT_FILE)
+AC_SUBST(NATDEPFILES)
+AC_SUBST(NAT_CDEPS)
+AC_SUBST(LOADLIBES)
+AC_SUBST(MH_CFLAGS)
+AC_SUBST(XM_CLIBS)
+AC_SUBST(NAT_GENERATED_FILES)
+AC_SUBST(HAVE_NATIVE_GCORE_TARGET)
+AC_SUBST_FILE(NAT_EXTRA_FRAGS_FILE)
 
 if test x"${gdb_osabi}" != x ; then
     AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
diff --git a/gdb/configure.nat b/gdb/configure.nat
new file mode 100644
index 0000000..585f94f
--- /dev/null
+++ b/gdb/configure.nat
@@ -0,0 +1,591 @@
+# Copyright (C) 2013-2017 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Variables defined here:
+#
+# NAT_FILE
+# NATDEPFILES
+# NAT_CDEPS
+# LOADLIBES
+# MH_CFLAGS
+# XM_CLIBS
+# NAT_GENERATED_FILES
+# HAVE_NATIVE_GCORE_HOST
+# NAT_EXTRA_FRAGS_FILE
+#
+# - To avoid shell expansion of variables, declare them with single
+#   quotes.
+#
+# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
+
+case ${gdb_host_cpu} in
+  aarch64)
+    case ${gdb_host} in
+      linux)
+	#  Host: AArch64 based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
+		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
+		aarch64-linux.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  alpha)
+    case ${gdb_host} in
+      alpha-linux)
+	# Host: Little-endian Alpha running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
+		fork-child.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+
+	# doublest.c currently assumes some properties of FP arithmetic
+	# on the host which require this.
+	MH_CFLAGS='-mieee'
+	;;
+      nbsd)
+	# Host: NetBSD/alpha
+	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  arm)
+    case ${gdb_host} in
+      linux)
+	# Host: ARM based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
+		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/arm
+	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  i386)
+    case ${gdb_host} in
+      cygwin64)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      cygwin)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      darwin)
+	# Host: IA86 running Darwin
+	NATDEPFILES='fork-child.o darwin-nat.o \
+	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
+	;;
+      fbsd64)
+	# Host: FreeBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
+		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      fbsd)
+	# Host: FreeBSD/i386
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
+		i386-fbsd-nat.o bsd-kvm.o'
+	NAT_FILE='nm-fbsd.h'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      go32)
+	# Host: Intel x86 running DJGPP
+
+	# We include several header files from config/djgpp
+	MH_CFLAGS='-I$(srcdir)/config/djgpp'
+
+	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+
+	XM_CLIBS='-ldbg'
+	;;
+      i386gnu)
+	# Host: Intel 386 running the GNU Hurd
+	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
+		     x86-nat.o x86-dregs.o fork-child.o \
+		     notify_S.o process_reply_S.o msg_reply_S.o \
+		     msg_U.o exc_request_U.o exc_request_S.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	NAT_FILE='nm-i386gnu.h'
+	MH_CFLAGS='-D_GNU_SOURCE'
+
+	XM_CLIBS='-lshouldbeinlibc'
+
+	NAT_EXTRA_FRAGS_FILE="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+
+	NAT_GENERATED_FILES='notify_S.h notify_S.c \
+		process_reply_S.h process_reply_S.c \
+		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
+		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c'
+	;;
+      i386sol2)
+	# Host: Solaris x86
+	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux64)
+	# Host: GNU/Linux x86-64
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
+		x86-linux-nat.o \
+		linux-nat.o linux-osdata.o \
+		proc-service.o linux-thread-db.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-btrace.o \
+		linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
+	NAT_FILE='config/nm-linux.h'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: Intel 386 running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      mingw64)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      mingw)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      nbsd64)
+	# Host: NetBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
+	;;
+      nbsdelf)
+	# Host: NetBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nto)
+	# Host: Intel 386 running QNX.
+	NATDEPFILES='nto-procfs.o'
+	NAT_FILE='config/nm-nto.h'
+	;;
+      obsd64)
+	# Host: OpenBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2-64)
+	# Host: Solaris x86_64
+	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  ia64)
+    case ${gdb_host} in
+      linux)
+	# Host: Intel IA-64 running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ia64-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-personality.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m32r)
+    case ${gdb_host} in
+      linux)
+	# Host: M32R based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o				\
+		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m68k)
+    case ${gdb_host} in
+      linux)
+	# Host: Motorola m68k running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		m68k-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/m68k ELF
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/m68k
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  m88k)
+    case ${gdb_host} in
+      obsd)
+	# Host: OpenBSD/m88k
+	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
+	;;
+    esac
+    ;;
+  mips)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux)
+	# Host: Linux/MIPS
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o \
+		mips-linux-watch.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
+	;;
+      obsd64)
+	# Host: OpenBSD/mips64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
+	;;
+    esac
+    ;;
+  pa)
+    case ${gdb_host} in
+      linux)
+	# Host: Hewlett-Packard PA-RISC machine, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		hppa-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
+	;;
+      obsd)
+	# Host: OpenBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
+	;;
+    esac
+    ;;
+  powerpc)
+    case ${gdb_host} in
+      aix)
+	# Host: IBM PowerPC running AIX
+	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
+	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+
+	# When compiled with cc, for debugging, this argument should be passed.
+	# We have no idea who our current compiler is though, so we skip it.
+	# MH_CFLAGS='-bnodelcsect'
+	;;
+      fbsd)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux)
+	# Host: PowerPC, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      ppc64-linux)
+	# Host: PowerPC64, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o ppc-linux.o linux-personality.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      spu-linux)
+	# Target: Cell BE (PowerPC64 + SPU)
+	# This implements a 'pseudo-native' GDB running on the
+	# PPU side of the Cell BE and debugging the SPU side.
+
+	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
+		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		      linux-personality.o linux-namespaces.o'
+	;;
+    esac
+    ;;
+  s390)
+    case ${gdb_host} in
+      linux)
+	# Host: S390, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  sh)
+    case ${gdb_host} in
+      nbsd)
+	# Host: NetBSD/sh
+	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  sparc)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
+		bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux64)
+	# Host: GNU/Linux UltraSPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: GNU/Linux SPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd64)
+	# Host: NetBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nbsdelf)
+	# Host: NetBSD/sparc ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd64)
+	# Host: OpenBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2)
+	# Host: Solaris SPARC & UltraSPARC
+	NAT_FILE='nm-sol2.h'
+	NATDEPFILES='sparc-sol2-nat.o \
+		fork-child.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  tilegx)
+    case ${gdb_host} in
+      linux)
+	# Host: Tilera TILE-Gx running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		tilegx-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  vax)
+    case ${gdb_host} in
+      nbsdelf)
+	# Host: NetBSD/vax ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/vax
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  xtensa)
+    case ${gdb_host} in
+      linux)
+	# Host: Xtensa, running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+
+	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+esac
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 5a58fa7..e0e50c1 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -178,9 +178,6 @@ MAN1S = gdb.1 gdbserver.1 gcore.1
 MAN5S = gdbinit.5
 MANS = $(MAN1S) $(MAN5S)
 
-# Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
-# End of host-dependent makefile fragment
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
 ###
-- 
2.9.3

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
@ 2017-04-25 21:08 ` John Baldwin
  2017-05-01 18:45 ` Sergio Durigan Junior
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 30+ messages in thread
From: John Baldwin @ 2017-04-25 21:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Sergio Durigan Junior, Pedro Alves

On Tuesday, April 25, 2017 04:23:09 PM Sergio Durigan Junior wrote:
> Due to my ongoing work to make it possible for gdbserver to start the
> inferior using the shell, I had to share the fork_inferior function
> under the "nat/" directory.  In order to do that, I created a new file
> and put the function there; however, this meant that I now had to
> update some of the *.mh files (under "gdb/config") and add the new
> file as a dependency to be built natively.  Bleh...
> 
> After talking a bit to Pedro about this, the idea came up to write a
> new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
> concentrate all of the native settings for each host/system.  I
> decided to tackle this issue.
> 
> The patch is simple.  All of the previous Makefile variables that were
> being declared inside the *.mh files are now inside "gdb/Makefile.in",
> and "gdb/configure" is responsible for AC_SUBST'ing them.  The
> definitions of these variables were put inside "gdb/configure.nat", so
> now they're shell variables.  For excerpts of Makefile code, one must
> create a file under "gdb/config/${gdb_cpu_host}" and reference it on
> the "NAT_EXTRA_FRAGS_FILE" variable.
> 
> It should now be easier to update the native dependencies of hosts in
> this single file.
> 
> This has been tested on x86_64 without regressions.

The FreeBSD-related bits all look correct to me.  I do think this is easier
to work with than the various *.mh files.

-- 
John Baldwin

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
  2017-04-25 21:08 ` John Baldwin
@ 2017-05-01 18:45 ` Sergio Durigan Junior
  2017-05-02  2:44 ` Simon Marchi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-01 18:45 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves

Ping.

On Tuesday, April 25 2017, I wrote:

> Due to my ongoing work to make it possible for gdbserver to start the
> inferior using the shell, I had to share the fork_inferior function
> under the "nat/" directory.  In order to do that, I created a new file
> and put the function there; however, this meant that I now had to
> update some of the *.mh files (under "gdb/config") and add the new
> file as a dependency to be built natively.  Bleh...
>
> After talking a bit to Pedro about this, the idea came up to write a
> new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
> concentrate all of the native settings for each host/system.  I
> decided to tackle this issue.
>
> The patch is simple.  All of the previous Makefile variables that were
> being declared inside the *.mh files are now inside "gdb/Makefile.in",
> and "gdb/configure" is responsible for AC_SUBST'ing them.  The
> definitions of these variables were put inside "gdb/configure.nat", so
> now they're shell variables.  For excerpts of Makefile code, one must
> create a file under "gdb/config/${gdb_cpu_host}" and reference it on
> the "NAT_EXTRA_FRAGS_FILE" variable.
>
> It should now be easier to update the native dependencies of hosts in
> this single file.
>
> This has been tested on x86_64 without regressions.
>
> gdb/ChangeLog:
> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
>
> 	* Makefile.in: Remove "@host_makefile_frag@".  Add variables
> 	NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
> 	NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_TARGET.  Add
> 	"@NAT_EXTRA_FRAGS_FILE@".
> 	(Makefile): Remove dependency on "@frags@".
> 	($(GNULIB_BUILDDIR)/Makefile): Likewise.
> 	(data-directory/Makefile): Likewise.
> 	* config/aarch64/linux.mh: Deleted; moved contents to
> 	"gdb/configure.nat".
> 	* config/alpha/alpha-linux.mh: Likewise.
> 	* config/alpha/nbsd.mh: Likewise.
> 	* config/arm/linux.mh: Likewise.
> 	* config/arm/nbsdelf.mh: Likewise.
> 	* config/i386/cygwin.mh: Likewise.
> 	* config/i386/cygwin64.mh: Likewise.
> 	* config/i386/darwin.mh: Likewise.
> 	* config/i386/fbsd.mh: Likewise.
> 	* config/i386/fbsd64.mh: Likewise.
> 	* config/i386/go32.mh: Likewise.
> 	* config/i386/i386gnu.mh: Likewise.
> 	* config/i386/i386sol2.mh: Likewise.
> 	* config/i386/linux.mh: Likewise.
> 	* config/i386/linux64.mh: Likewise.
> 	* config/i386/mingw.mh: Likewise.
> 	* config/i386/mingw64.mh: Likewise.
> 	* config/i386/nbsd64.mh: Likewise.
> 	* config/i386/nbsdelf.mh: Likewise.
> 	* config/i386/nto.mh: Likewise.
> 	* config/i386/obsd.mh: Likewise.
> 	* config/i386/obsd64.mh: Likewise.
> 	* config/i386/sol2-64.mh: Likewise.
> 	* config/ia64/linux.mh: Likewise.
> 	* config/m32r/linux.mh: Likewise.
> 	* config/m68k/linux.mh: Likewise.
> 	* config/m68k/nbsdelf.mh: Likewise.
> 	* config/m68k/obsd.mh: Likewise.
> 	* config/m88k/obsd.mh: Likewise.
> 	* config/mips/fbsd.mh: Likewise.
> 	* config/mips/linux.mh: Likewise.
> 	* config/mips/nbsd.mh: Likewise.
> 	* config/mips/obsd64.mh: Likewise.
> 	* config/pa/linux.mh: Likewise.
> 	* config/pa/nbsd.mh: Likewise.
> 	* config/pa/obsd.mh: Likewise.
> 	* config/powerpc/aix.mh: Likewise.
> 	* config/powerpc/fbsd.mh: Likewise.
> 	* config/powerpc/linux.mh: Likewise.
> 	* config/powerpc/nbsd.mh: Likewise.
> 	* config/powerpc/obsd.mh: Likewise.
> 	* config/powerpc/ppc64-linux.mh: Likewise.
> 	* config/powerpc/spu-linux.mh: Likewise.
> 	* config/s390/linux.mh: Likewise.
> 	* config/sh/nbsd.mh: Likewise.
> 	* config/sparc/fbsd.mh: Likewise.
> 	* config/sparc/linux.mh: Likewise.
> 	* config/sparc/linux64.mh: Likewise.
> 	* config/sparc/nbsd64.mh: Likewise.
> 	* config/sparc/nbsdelf.mh: Likewise.
> 	* config/sparc/obsd64.mh: Likewise.
> 	* config/sparc/sol2.mh: Likewise.
> 	* config/tilegx/linux.mh: Likewise.
> 	* config/vax/nbsdelf.mh: Likewise.
> 	* config/vax/obsd.mh: Likewise.
> 	* config/xtensa/linux.mh: Likewise.
> 	* config/i386/i386gnu-extra.mh: New file.
> 	* configure: Regenerate.
> 	* configure.ac: Rewrite code to use "gdb/configure.nat" instead of
> 	*.mh files under "gdb/config".
> 	* configure.nat: New file, with contents from the
> 	"gdb/config/*/*.mh" files.
>
> gdb/doc/ChangeLog:
> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
>
> 	* Makefile: Remove "@host_makefile_frag".
> ---
>  gdb/Makefile.in                                  |  17 +-
>  gdb/config/aarch64/linux.mh                      |  29 --
>  gdb/config/alpha/alpha-linux.mh                  |  15 -
>  gdb/config/alpha/nbsd.mh                         |   4 -
>  gdb/config/arm/linux.mh                          |  10 -
>  gdb/config/arm/nbsdelf.mh                        |   2 -
>  gdb/config/i386/cygwin.mh                        |   3 -
>  gdb/config/i386/cygwin64.mh                      |  20 -
>  gdb/config/i386/darwin.mh                        |   4 -
>  gdb/config/i386/fbsd.mh                          |   8 -
>  gdb/config/i386/fbsd64.mh                        |   7 -
>  gdb/config/i386/go32.mh                          |  11 -
>  gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} |  23 +-
>  gdb/config/i386/i386sol2.mh                      |   4 -
>  gdb/config/i386/linux.mh                         |  14 -
>  gdb/config/i386/linux64.mh                       |  15 -
>  gdb/config/i386/mingw.mh                         |   3 -
>  gdb/config/i386/mingw64.mh                       |   1 -
>  gdb/config/i386/nbsd64.mh                        |   3 -
>  gdb/config/i386/nbsdelf.mh                       |   5 -
>  gdb/config/i386/nto.mh                           |   4 -
>  gdb/config/i386/obsd.mh                          |   5 -
>  gdb/config/i386/obsd64.mh                        |   5 -
>  gdb/config/i386/sol2-64.mh                       |   4 -
>  gdb/config/ia64/linux.mh                         |  13 -
>  gdb/config/m32r/linux.mh                         |  10 -
>  gdb/config/m68k/linux.mh                         |  14 -
>  gdb/config/m68k/nbsdelf.mh                       |   4 -
>  gdb/config/m68k/obsd.mh                          |   4 -
>  gdb/config/m88k/obsd.mh                          |   2 -
>  gdb/config/mips/fbsd.mh                          |   3 -
>  gdb/config/mips/linux.mh                         |  11 -
>  gdb/config/mips/nbsd.mh                          |   2 -
>  gdb/config/mips/obsd64.mh                        |   2 -
>  gdb/config/pa/linux.mh                           |  10 -
>  gdb/config/pa/nbsd.mh                            |   2 -
>  gdb/config/pa/obsd.mh                            |   2 -
>  gdb/config/powerpc/aix.mh                        |   8 -
>  gdb/config/powerpc/fbsd.mh                       |  24 -
>  gdb/config/powerpc/linux.mh                      |  12 -
>  gdb/config/powerpc/nbsd.mh                       |   4 -
>  gdb/config/powerpc/obsd.mh                       |   4 -
>  gdb/config/powerpc/ppc64-linux.mh                |  15 -
>  gdb/config/powerpc/spu-linux.mh                  |   8 -
>  gdb/config/s390/linux.mh                         |   9 -
>  gdb/config/sh/nbsd.mh                            |   2 -
>  gdb/config/sparc/fbsd.mh                         |   7 -
>  gdb/config/sparc/linux.mh                        |  13 -
>  gdb/config/sparc/linux64.mh                      |  13 -
>  gdb/config/sparc/nbsd64.mh                       |   5 -
>  gdb/config/sparc/nbsdelf.mh                      |   5 -
>  gdb/config/sparc/obsd64.mh                       |   5 -
>  gdb/config/sparc/sol2.mh                         |   6 -
>  gdb/config/tilegx/linux.mh                       |  13 -
>  gdb/config/vax/nbsdelf.mh                        |   5 -
>  gdb/config/vax/obsd.mh                           |   5 -
>  gdb/config/xtensa/linux.mh                       |  11 -
>  gdb/configure                                    |  34 +-
>  gdb/configure.ac                                 |  33 +-
>  gdb/configure.nat                                | 591 +++++++++++++++++++++++
>  gdb/doc/Makefile.in                              |   3 -
>  61 files changed, 637 insertions(+), 493 deletions(-)
>  delete mode 100644 gdb/config/aarch64/linux.mh
>  delete mode 100644 gdb/config/alpha/alpha-linux.mh
>  delete mode 100644 gdb/config/alpha/nbsd.mh
>  delete mode 100644 gdb/config/arm/linux.mh
>  delete mode 100644 gdb/config/arm/nbsdelf.mh
>  delete mode 100644 gdb/config/i386/cygwin.mh
>  delete mode 100644 gdb/config/i386/cygwin64.mh
>  delete mode 100644 gdb/config/i386/darwin.mh
>  delete mode 100644 gdb/config/i386/fbsd.mh
>  delete mode 100644 gdb/config/i386/fbsd64.mh
>  delete mode 100644 gdb/config/i386/go32.mh
>  rename gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} (58%)
>  delete mode 100644 gdb/config/i386/i386sol2.mh
>  delete mode 100644 gdb/config/i386/linux.mh
>  delete mode 100644 gdb/config/i386/linux64.mh
>  delete mode 100644 gdb/config/i386/mingw.mh
>  delete mode 100644 gdb/config/i386/mingw64.mh
>  delete mode 100644 gdb/config/i386/nbsd64.mh
>  delete mode 100644 gdb/config/i386/nbsdelf.mh
>  delete mode 100644 gdb/config/i386/nto.mh
>  delete mode 100644 gdb/config/i386/obsd.mh
>  delete mode 100644 gdb/config/i386/obsd64.mh
>  delete mode 100644 gdb/config/i386/sol2-64.mh
>  delete mode 100644 gdb/config/ia64/linux.mh
>  delete mode 100644 gdb/config/m32r/linux.mh
>  delete mode 100644 gdb/config/m68k/linux.mh
>  delete mode 100644 gdb/config/m68k/nbsdelf.mh
>  delete mode 100644 gdb/config/m68k/obsd.mh
>  delete mode 100644 gdb/config/m88k/obsd.mh
>  delete mode 100644 gdb/config/mips/fbsd.mh
>  delete mode 100644 gdb/config/mips/linux.mh
>  delete mode 100644 gdb/config/mips/nbsd.mh
>  delete mode 100644 gdb/config/mips/obsd64.mh
>  delete mode 100644 gdb/config/pa/linux.mh
>  delete mode 100644 gdb/config/pa/nbsd.mh
>  delete mode 100644 gdb/config/pa/obsd.mh
>  delete mode 100644 gdb/config/powerpc/aix.mh
>  delete mode 100644 gdb/config/powerpc/fbsd.mh
>  delete mode 100644 gdb/config/powerpc/linux.mh
>  delete mode 100644 gdb/config/powerpc/nbsd.mh
>  delete mode 100644 gdb/config/powerpc/obsd.mh
>  delete mode 100644 gdb/config/powerpc/ppc64-linux.mh
>  delete mode 100644 gdb/config/powerpc/spu-linux.mh
>  delete mode 100644 gdb/config/s390/linux.mh
>  delete mode 100644 gdb/config/sh/nbsd.mh
>  delete mode 100644 gdb/config/sparc/fbsd.mh
>  delete mode 100644 gdb/config/sparc/linux.mh
>  delete mode 100644 gdb/config/sparc/linux64.mh
>  delete mode 100644 gdb/config/sparc/nbsd64.mh
>  delete mode 100644 gdb/config/sparc/nbsdelf.mh
>  delete mode 100644 gdb/config/sparc/obsd64.mh
>  delete mode 100644 gdb/config/sparc/sol2.mh
>  delete mode 100644 gdb/config/tilegx/linux.mh
>  delete mode 100644 gdb/config/vax/nbsdelf.mh
>  delete mode 100644 gdb/config/vax/obsd.mh
>  delete mode 100644 gdb/config/xtensa/linux.mh
>  create mode 100644 gdb/configure.nat
>
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index b865b7c..ff4c7e1 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -903,7 +903,16 @@ ALL_TARGET_OBS = \
>  	xtensa-tdep.o
>  
>  # Host-dependent makefile fragment comes in here.
> -@host_makefile_frag@
> +NAT_FILE = @NAT_FILE@
> +NATDEPFILES = @NATDEPFILES@
> +NAT_CDEPS = @NAT_CDEPS@
> +LOADLIBES = @LOADLIBES@
> +MH_CFLAGS = @MH_CFLAGS@
> +XM_CLIBS = @XM_CLIBS@
> +NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
> +HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
> +
> +@NAT_EXTRA_FRAGS_FILE@
>  # End of host-dependent makefile fragment
>  
>  FLAGS_TO_PASS = \
> @@ -2315,21 +2324,21 @@ subdir_do: force
>  		else true ; fi ; \
>  	done
>  
> -Makefile: Makefile.in config.status @frags@
> +Makefile: Makefile.in config.status
>  	# Regenerate the Makefile and the tm.h / nm.h links.
>  	CONFIG_FILES="Makefile" \
>  	  CONFIG_COMMANDS= \
>  	  CONFIG_HEADERS= \
>  	  $(SHELL) config.status
>  
> -$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status @frags@
> +$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
>  	@cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
>  	  CONFIG_COMMANDS="depfiles" \
>  	  CONFIG_HEADERS= \
>  	  CONFIG_LINKS= \
>  	  $(SHELL) config.status
>  
> -data-directory/Makefile: data-directory/Makefile.in config.status @frags@
> +data-directory/Makefile: data-directory/Makefile.in config.status
>  	CONFIG_FILES="data-directory/Makefile" \
>  	  CONFIG_COMMANDS="depfiles" \
>  	  CONFIG_HEADERS= \
> diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh
> deleted file mode 100644
> index d184a79..0000000
> --- a/gdb/config/aarch64/linux.mh
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -#  Host: AArch64 based machine running GNU/Linux
> -#
> -#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
> -#  Contributed by ARM Ltd.
> -#
> -#  This file is part of GDB.
> -#
> -#  This program is free software; you can redistribute it and/or modify
> -#  it under the terms of the GNU General Public License as published by
> -#  the Free Software Foundation; either version 3 of the License, or
> -#  (at your option) any later version.
> -#
> -#  This program is distributed in the hope that it will be useful,
> -#  but WITHOUT ANY WARRANTY; without even the implied warranty of
> -#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -#  GNU General Public License for more details.
> -#
> -#  You should have received a copy of the GNU General Public License
> -#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
> -	proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
> -	linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
> -	aarch64-linux.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES= -ldl $(RDYNAMIC)
> diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
> deleted file mode 100644
> index 4991dd2..0000000
> --- a/gdb/config/alpha/alpha-linux.mh
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -# Host: Little-endian Alpha running Linux
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
> -	fork-child.o proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> -
> -# doublest.c currently assumes some properties of FP arithmetic
> -# on the host which require this.
> -MH_CFLAGS = -mieee
> diff --git a/gdb/config/alpha/nbsd.mh b/gdb/config/alpha/nbsd.mh
> deleted file mode 100644
> index a46739e..0000000
> --- a/gdb/config/alpha/nbsd.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: NetBSD/alpha
> -NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh
> deleted file mode 100644
> index 003ca1f..0000000
> --- a/gdb/config/arm/linux.mh
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -# Host: ARM based machine running GNU/Linux
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
> -	aarch32-linux-nat.o proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES= -ldl $(RDYNAMIC)
> diff --git a/gdb/config/arm/nbsdelf.mh b/gdb/config/arm/nbsdelf.mh
> deleted file mode 100644
> index 042b583..0000000
> --- a/gdb/config/arm/nbsdelf.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: NetBSD/arm
> -NATDEPFILES= fork-child.o inf-ptrace.o arm-nbsd-nat.o
> diff --git a/gdb/config/i386/cygwin.mh b/gdb/config/i386/cygwin.mh
> deleted file mode 100644
> index 09bee12..0000000
> --- a/gdb/config/i386/cygwin.mh
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -MH_CFLAGS=
> -NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
> -XM_CLIBS=
> diff --git a/gdb/config/i386/cygwin64.mh b/gdb/config/i386/cygwin64.mh
> deleted file mode 100644
> index 4f70adc..0000000
> --- a/gdb/config/i386/cygwin64.mh
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -#  Native config information for GDB on PowerPC systems running FreeBSD.
> -#
> -#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
> -#
> -#  This file is part of GDB.
> -#
> -#  This program is free software; you can redistribute it and/or modify
> -#  it under the terms of the GNU General Public License as published by
> -#  the Free Software Foundation; either version 3 of the License, or
> -#  (at your option) any later version.
> -#
> -#  This program is distributed in the hope that it will be useful,
> -#  but WITHOUT ANY WARRANTY; without even the implied warranty of
> -#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -#  GNU General Public License for more details.
> -#
> -#  You should have received a copy of the GNU General Public License
> -#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> -
> -NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
> diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
> deleted file mode 100644
> index 16c1558..0000000
> --- a/gdb/config/i386/darwin.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: IA86 running Darwin
> -
> -NATDEPFILES = fork-child.o darwin-nat.o \
> -     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o
> diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
> deleted file mode 100644
> index 69e0a8b..0000000
> --- a/gdb/config/i386/fbsd.mh
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# Host: FreeBSD/i386
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
> -	i386-fbsd-nat.o bsd-kvm.o
> -NAT_FILE= nm-fbsd.h
> -HAVE_NATIVE_GCORE_HOST = 1
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
> deleted file mode 100644
> index 461ff9a..0000000
> --- a/gdb/config/i386/fbsd64.mh
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -# Host: FreeBSD/amd64
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
> -	bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o
> -HAVE_NATIVE_GCORE_HOST = 1
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh
> deleted file mode 100644
> index f1edfad..0000000
> --- a/gdb/config/i386/go32.mh
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -# Host: Intel x86 running DJGPP
> -
> -# We include several header files from config/djgpp
> -MH_CFLAGS= -I$(srcdir)/config/djgpp
> -
> -NATDEPFILES= go32-nat.o x86-nat.o x86-dregs.o
> -
> -HOST_IPC=
> -XM_CLIBS= -ldbg
> -
> -
> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
> similarity index 58%
> rename from gdb/config/i386/i386gnu.mh
> rename to gdb/config/i386/i386gnu-extra.mh
> index 070497f..1f2d937 100644
> --- a/gdb/config/i386/i386gnu.mh
> +++ b/gdb/config/i386/i386gnu-extra.mh
> @@ -1,21 +1,9 @@
> -# Host: Intel 386 running the GNU Hurd
> -NATDEPFILES= i386-gnu-nat.o gnu-nat.o \
> -	     x86-nat.o x86-dregs.o fork-child.o \
> -	     notify_S.o process_reply_S.o msg_reply_S.o \
> -	     msg_U.o exc_request_U.o exc_request_S.o
> -HAVE_NATIVE_GCORE_HOST = 1
> -
> -NAT_FILE= nm-i386gnu.h
> -MH_CFLAGS = -D_GNU_SOURCE
> -
> -XM_CLIBS = -lshouldbeinlibc
> -
>  # Use our own user stubs for the msg rpcs, so we can make them time out, in
>  # case the program is fucked, or we guess the wrong signal thread.
> -msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
> +msg-MIGUFLAGS=-D'MSG_IMPORTS=waittime 1000;'
>  
>  # ick
> -MIGCOM = $(MIG) -cc cat - /dev/null
> +MIGCOM=$(MIG) -cc cat - /dev/null
>  
>  # Reply servers need special massaging of the code mig generates, to make
>  # them work correctly for error returns in some cases.
> @@ -33,9 +21,4 @@ MIGCOM = $(MIG) -cc cat - /dev/null
>  	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
>  
>  # MIG stubs are not yet ready for C++ compilation.
> -%_S.o %_U.o : COMPILE.post += -x c
> -
> -NAT_GENERATED_FILES = notify_S.h notify_S.c \
> -	process_reply_S.h process_reply_S.c \
> -	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
> -	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
> +%_S.o %_U.o : COMPILE.post +=-x c"
> diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
> deleted file mode 100644
> index 787a3c1..0000000
> --- a/gdb/config/i386/i386sol2.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: Solaris x86
> -NATDEPFILES= fork-child.o i386-v4-nat.o i386-sol2-nat.o \
> -	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
> -HAVE_NATIVE_GCORE_HOST = 1
> diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
> deleted file mode 100644
> index 421c56f..0000000
> --- a/gdb/config/i386/linux.mh
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -# Host: Intel 386 running GNU/Linux.
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
> -	x86-linux-dregs.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
> deleted file mode 100644
> index 42d8df5..0000000
> --- a/gdb/config/i386/linux64.mh
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -# Host: GNU/Linux x86-64
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
> -	x86-linux-nat.o \
> -	linux-nat.o linux-osdata.o \
> -	proc-service.o linux-thread-db.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-btrace.o \
> -	linux-waitpid.o linux-personality.o x86-linux.o \
> -	x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
> -NAT_FILE= config/nm-linux.h
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/i386/mingw.mh b/gdb/config/i386/mingw.mh
> deleted file mode 100644
> index 09bee12..0000000
> --- a/gdb/config/i386/mingw.mh
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -MH_CFLAGS=
> -NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
> -XM_CLIBS=
> diff --git a/gdb/config/i386/mingw64.mh b/gdb/config/i386/mingw64.mh
> deleted file mode 100644
> index 0ee2e2c..0000000
> --- a/gdb/config/i386/mingw64.mh
> +++ /dev/null
> @@ -1 +0,0 @@
> -NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
> diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
> deleted file mode 100644
> index 91d21f3..0000000
> --- a/gdb/config/i386/nbsd64.mh
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# Host: NetBSD/amd64
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o
> diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
> deleted file mode 100644
> index 5954b3f..0000000
> --- a/gdb/config/i386/nbsdelf.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: NetBSD/i386 ELF
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/i386/nto.mh b/gdb/config/i386/nto.mh
> deleted file mode 100644
> index b9e2f84..0000000
> --- a/gdb/config/i386/nto.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: Intel 386 running QNX.
> -
> -NATDEPFILES= nto-procfs.o
> -NAT_FILE= config/nm-nto.h
> diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
> deleted file mode 100644
> index fac7282..0000000
> --- a/gdb/config/i386/obsd.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: OpenBSD/i386 ELF
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
> -	x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
> deleted file mode 100644
> index 51deea7..0000000
> --- a/gdb/config/i386/obsd64.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: OpenBSD/amd64
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
> -	amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/i386/sol2-64.mh b/gdb/config/i386/sol2-64.mh
> deleted file mode 100644
> index 7a3ab73..0000000
> --- a/gdb/config/i386/sol2-64.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: Solaris x86_64
> -NATDEPFILES= fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
> -	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
> -HAVE_NATIVE_GCORE_HOST = 1
> diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh
> deleted file mode 100644
> index b05f834..0000000
> --- a/gdb/config/ia64/linux.mh
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# Host: Intel IA-64 running GNU/Linux
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	ia64-linux-nat.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-personality.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
> deleted file mode 100644
> index 277d8bd..0000000
> --- a/gdb/config/m32r/linux.mh
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -# Host: M32R based machine running GNU/Linux
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o				\
> -	m32r-linux-nat.o proc-service.o linux-thread-db.o	\
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES= -ldl $(RDYNAMIC)
> diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh
> deleted file mode 100644
> index 7c1f4ac..0000000
> --- a/gdb/config/m68k/linux.mh
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -# Host: Motorola m68k running GNU/Linux.
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	m68k-linux-nat.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-personality.o \
> -	linux-waitpid.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/m68k/nbsdelf.mh b/gdb/config/m68k/nbsdelf.mh
> deleted file mode 100644
> index 1d00cbc..0000000
> --- a/gdb/config/m68k/nbsdelf.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: NetBSD/m68k ELF
> -NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/m68k/obsd.mh b/gdb/config/m68k/obsd.mh
> deleted file mode 100644
> index 902a24b..0000000
> --- a/gdb/config/m68k/obsd.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: OpenBSD/m68k
> -NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/m88k/obsd.mh b/gdb/config/m88k/obsd.mh
> deleted file mode 100644
> index 3c4d8d5..0000000
> --- a/gdb/config/m88k/obsd.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: OpenBSD/m88k
> -NATDEPFILES= fork-child.o inf-ptrace.o m88k-bsd-nat.o
> diff --git a/gdb/config/mips/fbsd.mh b/gdb/config/mips/fbsd.mh
> deleted file mode 100644
> index f433347..0000000
> --- a/gdb/config/mips/fbsd.mh
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# Host: FreeBSD/mips
> -NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o
> -HAVE_NATIVE_GCORE_HOST = 1
> diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh
> deleted file mode 100644
> index 11ff903..0000000
> --- a/gdb/config/mips/linux.mh
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -# Host: Linux/MIPS
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
> -	linux-thread-db.o proc-service.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-personality.o \
> -	mips-linux-watch.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/mips/nbsd.mh b/gdb/config/mips/nbsd.mh
> deleted file mode 100644
> index a80da95..0000000
> --- a/gdb/config/mips/nbsd.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: NetBSD/mips
> -NATDEPFILES= fork-child.o inf-ptrace.o mips-nbsd-nat.o
> diff --git a/gdb/config/mips/obsd64.mh b/gdb/config/mips/obsd64.mh
> deleted file mode 100644
> index 6aeac34..0000000
> --- a/gdb/config/mips/obsd64.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: OpenBSD/mips64
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o
> diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
> deleted file mode 100644
> index 1b73ecd..0000000
> --- a/gdb/config/pa/linux.mh
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -# Host: Hewlett-Packard PA-RISC machine, running Linux
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	hppa-linux-nat.o proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/pa/nbsd.mh b/gdb/config/pa/nbsd.mh
> deleted file mode 100644
> index 791cd9f..0000000
> --- a/gdb/config/pa/nbsd.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: NetBSD/hppa
> -NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o
> diff --git a/gdb/config/pa/obsd.mh b/gdb/config/pa/obsd.mh
> deleted file mode 100644
> index 95dd416..0000000
> --- a/gdb/config/pa/obsd.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: OpenBSD/hppa
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o
> diff --git a/gdb/config/powerpc/aix.mh b/gdb/config/powerpc/aix.mh
> deleted file mode 100644
> index 141501d..0000000
> --- a/gdb/config/powerpc/aix.mh
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# Host: IBM PowerPC running AIX
> -
> -# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
> -NATDEPFILES= fork-child.o inf-ptrace.o rs6000-nat.o
> -
> -# When compiled with cc, for debugging, this argument should be passed.
> -# We have no idea who our current compiler is though, so we skip it.
> -# MH_CFLAGS = -bnodelcsect
> diff --git a/gdb/config/powerpc/fbsd.mh b/gdb/config/powerpc/fbsd.mh
> deleted file mode 100644
> index 9c2e6b4..0000000
> --- a/gdb/config/powerpc/fbsd.mh
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#  Native config information for GDB on PowerPC systems running FreeBSD.
> -#
> -#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
> -#
> -#  This file is part of GDB.
> -#
> -#  This program is free software; you can redistribute it and/or modify
> -#  it under the terms of the GNU General Public License as published by
> -#  the Free Software Foundation; either version 3 of the License, or
> -#  (at your option) any later version.
> -#
> -#  This program is distributed in the hope that it will be useful,
> -#  but WITHOUT ANY WARRANTY; without even the implied warranty of
> -#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -#  GNU General Public License for more details.
> -#
> -#  You should have received a copy of the GNU General Public License
> -#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> -
> -NATDEPFILES= fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o
> -HAVE_NATIVE_GCORE_HOST = 1
> -
> -LOADLIBES= -lkvm
> -
> diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
> deleted file mode 100644
> index f4a52c3..0000000
> --- a/gdb/config/powerpc/linux.mh
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -# Host: PowerPC, running Linux
> -
> -XM_CLIBS=
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	ppc-linux-nat.o proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh
> deleted file mode 100644
> index f02a0f9..0000000
> --- a/gdb/config/powerpc/nbsd.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: NetBSD/powerpc
> -NATDEPFILES= fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/powerpc/obsd.mh b/gdb/config/powerpc/obsd.mh
> deleted file mode 100644
> index 3743254..0000000
> --- a/gdb/config/powerpc/obsd.mh
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# Host: OpenBSD/powerpc
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
> deleted file mode 100644
> index 8681d00..0000000
> --- a/gdb/config/powerpc/ppc64-linux.mh
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -# Host: PowerPC64, running Linux
> -
> -XM_CLIBS=
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	ppc-linux-nat.o proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o ppc-linux.o linux-personality.o \
> -	linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES= -ldl $(RDYNAMIC)
> diff --git a/gdb/config/powerpc/spu-linux.mh b/gdb/config/powerpc/spu-linux.mh
> deleted file mode 100644
> index 9205b62..0000000
> --- a/gdb/config/powerpc/spu-linux.mh
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -# Target: Cell BE (PowerPC64 + SPU)
> -
> -# This implements a 'pseudo-native' GDB running on the
> -# PPU side of the Cell BE and debugging the SPU side.
> -
> -NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
> -	      linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	      linux-personality.o linux-namespaces.o
> diff --git a/gdb/config/s390/linux.mh b/gdb/config/s390/linux.mh
> deleted file mode 100644
> index 4a137cd..0000000
> --- a/gdb/config/s390/linux.mh
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# Host: S390, running Linux
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
> -	linux-thread-db.o proc-service.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-personality.o \
> -	linux-waitpid.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/sh/nbsd.mh b/gdb/config/sh/nbsd.mh
> deleted file mode 100644
> index 14d7e8c..0000000
> --- a/gdb/config/sh/nbsd.mh
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# Host: NetBSD/sh
> -NATDEPFILES= fork-child.o inf-ptrace.o sh-nbsd-nat.o
> diff --git a/gdb/config/sparc/fbsd.mh b/gdb/config/sparc/fbsd.mh
> deleted file mode 100644
> index bdc272c..0000000
> --- a/gdb/config/sparc/fbsd.mh
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -# Host: FreeBSD/sparc64
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
> -	bsd-kvm.o
> -HAVE_NATIVE_GCORE_HOST = 1
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
> deleted file mode 100644
> index 385f640..0000000
> --- a/gdb/config/sparc/linux.mh
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# Host: GNU/Linux SPARC
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
> -	fork-child.o inf-ptrace.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh
> deleted file mode 100644
> index 8df0de1..0000000
> --- a/gdb/config/sparc/linux64.mh
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# Host: GNU/Linux UltraSPARC
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
> -	fork-child.o inf-ptrace.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/sparc/nbsd64.mh b/gdb/config/sparc/nbsd64.mh
> deleted file mode 100644
> index aa15b1d..0000000
> --- a/gdb/config/sparc/nbsd64.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: NetBSD/sparc64
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
> deleted file mode 100644
> index 97d07b3..0000000
> --- a/gdb/config/sparc/nbsdelf.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: NetBSD/sparc ELF
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/sparc/obsd64.mh b/gdb/config/sparc/obsd64.mh
> deleted file mode 100644
> index e9f2fb9..0000000
> --- a/gdb/config/sparc/obsd64.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: OpenBSD/sparc64
> -NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
> -	sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
> deleted file mode 100644
> index 220c61f..0000000
> --- a/gdb/config/sparc/sol2.mh
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -# Host: Solaris SPARC & UltraSPARC
> -NAT_FILE= nm-sol2.h
> -NATDEPFILES= sparc-sol2-nat.o \
> -	fork-child.o \
> -	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
> -HAVE_NATIVE_GCORE_HOST = 1
> diff --git a/gdb/config/tilegx/linux.mh b/gdb/config/tilegx/linux.mh
> deleted file mode 100644
> index ec648d3..0000000
> --- a/gdb/config/tilegx/linux.mh
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# Host: Tilera TILE-Gx running GNU/Linux.
> -
> -NAT_FILE= config/nm-linux.h
> -NATDEPFILES= inf-ptrace.o fork-child.o \
> -	tilegx-linux-nat.o \
> -	proc-service.o linux-thread-db.o \
> -	linux-nat.o linux-osdata.o linux-fork.o \
> -	linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -	linux-personality.o linux-namespaces.o
> -
> -# The dynamically loaded libthread_db needs access to symbols in the
> -# gdb executable.
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/config/vax/nbsdelf.mh b/gdb/config/vax/nbsdelf.mh
> deleted file mode 100644
> index bf0f0b9..0000000
> --- a/gdb/config/vax/nbsdelf.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: NetBSD/vax ELF
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	vax-bsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/vax/obsd.mh b/gdb/config/vax/obsd.mh
> deleted file mode 100644
> index cef99d3..0000000
> --- a/gdb/config/vax/obsd.mh
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# Host: OpenBSD/vax
> -NATDEPFILES= fork-child.o inf-ptrace.o \
> -	vax-bsd-nat.o bsd-kvm.o
> -
> -LOADLIBES= -lkvm
> diff --git a/gdb/config/xtensa/linux.mh b/gdb/config/xtensa/linux.mh
> deleted file mode 100644
> index d5b8f91..0000000
> --- a/gdb/config/xtensa/linux.mh
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -# Host: Xtensa, running GNU/Linux.
> -
> -NAT_FILE= config/nm-linux.h
> -
> -NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
> -	linux-thread-db.o proc-service.o \
> -	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -	linux-waitpid.o linux-personality.o linux-namespaces.o
> -NAT_CDEPS = $(srcdir)/proc-service.list
> -
> -LOADLIBES = -ldl $(RDYNAMIC)
> diff --git a/gdb/configure b/gdb/configure
> index 9f05b4b..f1068ba 100755
> --- a/gdb/configure
> +++ b/gdb/configure
> @@ -598,7 +598,13 @@ GDB_NM_FILE
>  LTLIBBABELTRACE
>  LIBBABELTRACE
>  HAVE_LIBBABELTRACE
> -frags
> +NAT_GENERATED_FILES
> +XM_CLIBS
> +MH_CFLAGS
> +LOADLIBES
> +NAT_CDEPS
> +NATDEPFILES
> +NAT_FILE
>  target_subdir
>  CONFIG_UNINSTALL
>  CONFIG_INSTALL
> @@ -799,7 +805,7 @@ PACKAGE_TARNAME
>  PACKAGE_NAME
>  PATH_SEPARATOR
>  SHELL'
> -ac_subst_files='host_makefile_frag'
> +ac_subst_files='NAT_EXTRA_FRAGS_FILE'
>  ac_user_opts='
>  enable_option_checking
>  enable_maintainer_mode
> @@ -16724,27 +16730,21 @@ if test "${host}" != "${target}"; then
>  fi
>  
>  
> -frags=
> +# Importing nat definitions.
> +NAT_EXTRA_FRAGS_FILE=/dev/null
>  if test "${gdb_native}" = "yes"; then
> -  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
> -  if test ! -f ${host_makefile_frag}; then
> -    as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5
> -  fi
> -  frags="$frags $host_makefile_frag"
> -else
> -  host_makefile_frag=/dev/null
> +  . ${srcdir}/configure.nat
> +  nativefile=$NAT_FILE
>  fi
>  
>  
>  
>  
> -if test "${gdb_native}" = "yes"; then
> -# We pick this up from the host configuration file (.mh) because we
> -# do not have a native configuration Makefile fragment.
> -nativefile=`sed -n '
> -s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
> -' ${host_makefile_frag}`
> -fi
> +
> +
> +
> +
> +
>  
>  
>  if test x"${gdb_osabi}" != x ; then
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 50f6f59..f9d8aac 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
>  fi
>  AC_SUBST(target_subdir)
>  
> -frags=
> +# Importing nat definitions.
> +NAT_EXTRA_FRAGS_FILE=/dev/null
>  if test "${gdb_native}" = "yes"; then
> -  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
> -  if test ! -f ${host_makefile_frag}; then
> -    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
> -  fi
> -  frags="$frags $host_makefile_frag"
> -else
> -  host_makefile_frag=/dev/null
> +  . ${srcdir}/configure.nat
> +  nativefile=$NAT_FILE
>  fi
>  
> -AC_SUBST_FILE(host_makefile_frag)
> -AC_SUBST(frags)
> -
> -changequote(,)dnl
> -if test "${gdb_native}" = "yes"; then
> -# We pick this up from the host configuration file (.mh) because we
> -# do not have a native configuration Makefile fragment.
> -nativefile=`sed -n '
> -s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
> -' ${host_makefile_frag}`
> -fi
> -changequote([,])
> +AC_SUBST(NAT_FILE)
> +AC_SUBST(NATDEPFILES)
> +AC_SUBST(NAT_CDEPS)
> +AC_SUBST(LOADLIBES)
> +AC_SUBST(MH_CFLAGS)
> +AC_SUBST(XM_CLIBS)
> +AC_SUBST(NAT_GENERATED_FILES)
> +AC_SUBST(HAVE_NATIVE_GCORE_TARGET)
> +AC_SUBST_FILE(NAT_EXTRA_FRAGS_FILE)
>  
>  if test x"${gdb_osabi}" != x ; then
>      AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
> diff --git a/gdb/configure.nat b/gdb/configure.nat
> new file mode 100644
> index 0000000..585f94f
> --- /dev/null
> +++ b/gdb/configure.nat
> @@ -0,0 +1,591 @@
> +# Copyright (C) 2013-2017 Free Software Foundation, Inc.
> +#
> +# This file is part of GDB.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +# Variables defined here:
> +#
> +# NAT_FILE
> +# NATDEPFILES
> +# NAT_CDEPS
> +# LOADLIBES
> +# MH_CFLAGS
> +# XM_CLIBS
> +# NAT_GENERATED_FILES
> +# HAVE_NATIVE_GCORE_HOST
> +# NAT_EXTRA_FRAGS_FILE
> +#
> +# - To avoid shell expansion of variables, declare them with single
> +#   quotes.
> +#
> +# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
> +
> +case ${gdb_host_cpu} in
> +  aarch64)
> +    case ${gdb_host} in
> +      linux)
> +	#  Host: AArch64 based machine running GNU/Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
> +		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
> +		aarch64-linux.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +  alpha)
> +    case ${gdb_host} in
> +      alpha-linux)
> +	# Host: Little-endian Alpha running Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
> +		fork-child.o proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +
> +	# doublest.c currently assumes some properties of FP arithmetic
> +	# on the host which require this.
> +	MH_CFLAGS='-mieee'
> +	;;
> +      nbsd)
> +	# Host: NetBSD/alpha
> +	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +    esac
> +    ;;
> +  arm)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: ARM based machine running GNU/Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
> +		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsdelf)
> +	# Host: NetBSD/arm
> +	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
> +	;;
> +    esac
> +    ;;
> +  i386)
> +    case ${gdb_host} in
> +      cygwin64)
> +	#  Native config information for GDB on PowerPC systems running FreeBSD.
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
> +	;;
> +      cygwin)
> +	MH_CFLAGS=
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
> +	XM_CLIBS=
> +	;;
> +      darwin)
> +	# Host: IA86 running Darwin
> +	NATDEPFILES='fork-child.o darwin-nat.o \
> +	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
> +	;;
> +      fbsd64)
> +	# Host: FreeBSD/amd64
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
> +		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      fbsd)
> +	# Host: FreeBSD/i386
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
> +		i386-fbsd-nat.o bsd-kvm.o'
> +	NAT_FILE='nm-fbsd.h'
> +	HAVE_NATIVE_GCORE_HOST=1
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      go32)
> +	# Host: Intel x86 running DJGPP
> +
> +	# We include several header files from config/djgpp
> +	MH_CFLAGS='-I$(srcdir)/config/djgpp'
> +
> +	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
> +
> +	XM_CLIBS='-ldbg'
> +	;;
> +      i386gnu)
> +	# Host: Intel 386 running the GNU Hurd
> +	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
> +		     x86-nat.o x86-dregs.o fork-child.o \
> +		     notify_S.o process_reply_S.o msg_reply_S.o \
> +		     msg_U.o exc_request_U.o exc_request_S.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +
> +	NAT_FILE='nm-i386gnu.h'
> +	MH_CFLAGS='-D_GNU_SOURCE'
> +
> +	XM_CLIBS='-lshouldbeinlibc'
> +
> +	NAT_EXTRA_FRAGS_FILE="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
> +
> +	NAT_GENERATED_FILES='notify_S.h notify_S.c \
> +		process_reply_S.h process_reply_S.c \
> +		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
> +		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c'
> +	;;
> +      i386sol2)
> +	# Host: Solaris x86
> +	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
> +		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +	;;
> +      linux64)
> +	# Host: GNU/Linux x86-64
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
> +		x86-linux-nat.o \
> +		linux-nat.o linux-osdata.o \
> +		proc-service.o linux-thread-db.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-btrace.o \
> +		linux-waitpid.o linux-personality.o x86-linux.o \
> +		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
> +	NAT_FILE='config/nm-linux.h'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      linux)
> +	# Host: Intel 386 running GNU/Linux.
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
> +		x86-linux-dregs.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      mingw64)
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
> +	;;
> +      mingw)
> +	MH_CFLAGS=
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
> +	XM_CLIBS=
> +	;;
> +      nbsd64)
> +	# Host: NetBSD/amd64
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
> +	;;
> +      nbsdelf)
> +	# Host: NetBSD/i386 ELF
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      nto)
> +	# Host: Intel 386 running QNX.
> +	NATDEPFILES='nto-procfs.o'
> +	NAT_FILE='config/nm-nto.h'
> +	;;
> +      obsd64)
> +	# Host: OpenBSD/amd64
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> +		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      obsd)
> +	# Host: OpenBSD/i386 ELF
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> +		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      sol2-64)
> +	# Host: Solaris x86_64
> +	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
> +		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +	;;
> +    esac
> +    ;;
> +  ia64)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: Intel IA-64 running GNU/Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		ia64-linux-nat.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-personality.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +  m32r)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: M32R based machine running GNU/Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o				\
> +		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +  m68k)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: Motorola m68k running GNU/Linux.
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		m68k-linux-nat.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-personality.o \
> +		linux-waitpid.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsdelf)
> +	# Host: NetBSD/m68k ELF
> +	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      obsd)
> +	# Host: OpenBSD/m68k
> +	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +    esac
> +    ;;
> +  m88k)
> +    case ${gdb_host} in
> +      obsd)
> +	# Host: OpenBSD/m88k
> +	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
> +	;;
> +    esac
> +    ;;
> +  mips)
> +    case ${gdb_host} in
> +      fbsd)
> +	# Host: FreeBSD/mips
> +	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +	;;
> +      linux)
> +	# Host: Linux/MIPS
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
> +		linux-thread-db.o proc-service.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o \
> +		mips-linux-watch.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsd)
> +	# Host: NetBSD/mips
> +	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
> +	;;
> +      obsd64)
> +	# Host: OpenBSD/mips64
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
> +	;;
> +    esac
> +    ;;
> +  pa)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: Hewlett-Packard PA-RISC machine, running Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		hppa-linux-nat.o proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsd)
> +	# Host: NetBSD/hppa
> +	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
> +	;;
> +      obsd)
> +	# Host: OpenBSD/hppa
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
> +	;;
> +    esac
> +    ;;
> +  powerpc)
> +    case ${gdb_host} in
> +      aix)
> +	# Host: IBM PowerPC running AIX
> +	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
> +	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
> +
> +	# When compiled with cc, for debugging, this argument should be passed.
> +	# We have no idea who our current compiler is though, so we skip it.
> +	# MH_CFLAGS='-bnodelcsect'
> +	;;
> +      fbsd)
> +	#  Native config information for GDB on PowerPC systems running FreeBSD.
> +	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      linux)
> +	# Host: PowerPC, running Linux
> +	XM_CLIBS=
> +
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		ppc-linux-nat.o proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsd)
> +	# Host: NetBSD/powerpc
> +	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      obsd)
> +	# Host: OpenBSD/powerpc
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      ppc64-linux)
> +	# Host: PowerPC64, running Linux
> +	XM_CLIBS=
> +
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		ppc-linux-nat.o proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o ppc-linux.o linux-personality.o \
> +		linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      spu-linux)
> +	# Target: Cell BE (PowerPC64 + SPU)
> +	# This implements a 'pseudo-native' GDB running on the
> +	# PPU side of the Cell BE and debugging the SPU side.
> +
> +	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
> +		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		      linux-personality.o linux-namespaces.o'
> +	;;
> +    esac
> +    ;;
> +  s390)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: S390, running Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
> +		linux-thread-db.o proc-service.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-personality.o \
> +		linux-waitpid.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +  sh)
> +    case ${gdb_host} in
> +      nbsd)
> +	# Host: NetBSD/sh
> +	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
> +	;;
> +    esac
> +    ;;
> +  sparc)
> +    case ${gdb_host} in
> +      fbsd)
> +	# Host: FreeBSD/sparc64
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
> +		bsd-kvm.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      linux64)
> +	# Host: GNU/Linux UltraSPARC
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
> +		fork-child.o inf-ptrace.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      linux)
> +	# Host: GNU/Linux SPARC
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
> +		fork-child.o inf-ptrace.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +      nbsd64)
> +	# Host: NetBSD/sparc64
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      nbsdelf)
> +	# Host: NetBSD/sparc ELF
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      obsd64)
> +	# Host: OpenBSD/sparc64
> +	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> +		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      sol2)
> +	# Host: Solaris SPARC & UltraSPARC
> +	NAT_FILE='nm-sol2.h'
> +	NATDEPFILES='sparc-sol2-nat.o \
> +		fork-child.o \
> +		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> +	HAVE_NATIVE_GCORE_HOST=1
> +	;;
> +    esac
> +    ;;
> +  tilegx)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: Tilera TILE-Gx running GNU/Linux.
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o \
> +		tilegx-linux-nat.o \
> +		proc-service.o linux-thread-db.o \
> +		linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o'
> +
> +	# The dynamically loaded libthread_db needs access to symbols in the
> +	# gdb executable.
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +  vax)
> +    case ${gdb_host} in
> +      nbsdelf)
> +	# Host: NetBSD/vax ELF
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		vax-bsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +      obsd)
> +	# Host: OpenBSD/vax
> +	NATDEPFILES='fork-child.o inf-ptrace.o \
> +		vax-bsd-nat.o bsd-kvm.o'
> +
> +	LOADLIBES='-lkvm'
> +	;;
> +    esac
> +    ;;
> +  xtensa)
> +    case ${gdb_host} in
> +      linux)
> +	# Host: Xtensa, running GNU/Linux.
> +	NAT_FILE='config/nm-linux.h'
> +
> +	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
> +		linux-thread-db.o proc-service.o \
> +		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> +		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NAT_CDEPS='$(srcdir)/proc-service.list'
> +
> +	LOADLIBES='-ldl $(RDYNAMIC)'
> +	;;
> +    esac
> +    ;;
> +esac
> diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
> index 5a58fa7..e0e50c1 100644
> --- a/gdb/doc/Makefile.in
> +++ b/gdb/doc/Makefile.in
> @@ -178,9 +178,6 @@ MAN1S = gdb.1 gdbserver.1 gcore.1
>  MAN5S = gdbinit.5
>  MANS = $(MAN1S) $(MAN5S)
>  
> -# Host-dependent makefile fragment comes in here.
> -@host_makefile_frag@
> -# End of host-dependent makefile fragment
>  HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
>  
>  ###
> -- 
> 2.9.3

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete  "gdb/config/*/*.mh" files)
  2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
  2017-04-25 21:08 ` John Baldwin
  2017-05-01 18:45 ` Sergio Durigan Junior
@ 2017-05-02  2:44 ` Simon Marchi
  2017-05-02 14:57   ` John Baldwin
  2017-05-02 19:28   ` Sergio Durigan Junior
  2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
  2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
  4 siblings, 2 replies; 30+ messages in thread
From: Simon Marchi @ 2017-05-02  2:44 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Pedro Alves

> +++ b/gdb/configure.nat
> @@ -0,0 +1,591 @@
> +# Copyright (C) 2013-2017 Free Software Foundation, Inc.
> +#
> +# This file is part of GDB.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see 
> <http://www.gnu.org/licenses/>.
> +
> +# Variables defined here:
> +#
> +# NAT_FILE
> +# NATDEPFILES
> +# NAT_CDEPS
> +# LOADLIBES
> +# MH_CFLAGS
> +# XM_CLIBS
> +# NAT_GENERATED_FILES
> +# HAVE_NATIVE_GCORE_HOST
> +# NAT_EXTRA_FRAGS_FILE

Could you document (if you know it) what each variable does?

> +# - To avoid shell expansion of variables, declare them with single
> +#   quotes.
> +#
> +# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
> +
> +case ${gdb_host_cpu} in
> +  aarch64)
> +    case ${gdb_host} in
> +      linux)
> +	#  Host: AArch64 based machine running GNU/Linux
> +	NAT_FILE='config/nm-linux.h'
> +	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o
> aarch32-linux-nat.o \
> +		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
> +		aarch64-linux.o'

IMO, the interest of having all of this in a single file is to be able 
to factor out common things.  A lot of NATDEPFILES are repeated Would it 
be possible to have a switch on ${gdb_host} at the top level, and 
specify all the files specific to OSes but machine-agnostic?  For 
example, fork-child.o and inf-ptrace.o probably appear in all the linux 
ports.

Thanks,

Simon

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete  "gdb/config/*/*.mh" files)
  2017-05-02  2:44 ` Simon Marchi
@ 2017-05-02 14:57   ` John Baldwin
  2017-05-02 17:01     ` Simon Marchi
  2017-05-02 19:28   ` Sergio Durigan Junior
  1 sibling, 1 reply; 30+ messages in thread
From: John Baldwin @ 2017-05-02 14:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi, Sergio Durigan Junior, Pedro Alves

On Monday, May 01, 2017 10:44:39 PM Simon Marchi wrote:
> > +++ b/gdb/configure.nat
> > @@ -0,0 +1,591 @@
> > +# Copyright (C) 2013-2017 Free Software Foundation, Inc.
> > +#
> > +# This file is part of GDB.
> > +#
> > +# This program is free software; you can redistribute it and/or modify
> > +# it under the terms of the GNU General Public License as published by
> > +# the Free Software Foundation; either version 3 of the License, or
> > +# (at your option) any later version.
> > +#
> > +# This program is distributed in the hope that it will be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > +# GNU General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License
> > +# along with this program.  If not, see 
> > <http://www.gnu.org/licenses/>.
> > +
> > +# Variables defined here:
> > +#
> > +# NAT_FILE
> > +# NATDEPFILES
> > +# NAT_CDEPS
> > +# LOADLIBES
> > +# MH_CFLAGS
> > +# XM_CLIBS
> > +# NAT_GENERATED_FILES
> > +# HAVE_NATIVE_GCORE_HOST
> > +# NAT_EXTRA_FRAGS_FILE
> 
> Could you document (if you know it) what each variable does?
> 
> > +# - To avoid shell expansion of variables, declare them with single
> > +#   quotes.
> > +#
> > +# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
> > +
> > +case ${gdb_host_cpu} in
> > +  aarch64)
> > +    case ${gdb_host} in
> > +      linux)
> > +	#  Host: AArch64 based machine running GNU/Linux
> > +	NAT_FILE='config/nm-linux.h'
> > +	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o
> > aarch32-linux-nat.o \
> > +		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
> > +		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
> > +		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
> > +		aarch64-linux.o'
> 
> IMO, the interest of having all of this in a single file is to be able 
> to factor out common things.  A lot of NATDEPFILES are repeated Would it 
> be possible to have a switch on ${gdb_host} at the top level, and 
> specify all the files specific to OSes but machine-agnostic?  For 
> example, fork-child.o and inf-ptrace.o probably appear in all the linux 
> ports.

I had a similar thought about FreeBSD, FWIW.  I wasn't sure if we wanted to
wait for a followup to do that so that for this commit you could directly
compare the old foo.mh file to a new clause in configure.nat as a way to
check for any typos in case there is a regression reported in the future.
You could perhaps include a second patch as a followup in a single series to
add a host clause, but I think the intermediate step as its own commit has
some merit.

-- 
John Baldwin

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-02 14:57   ` John Baldwin
@ 2017-05-02 17:01     ` Simon Marchi
  0 siblings, 0 replies; 30+ messages in thread
From: Simon Marchi @ 2017-05-02 17:01 UTC (permalink / raw)
  To: John Baldwin, gdb-patches
  Cc: Simon Marchi, Sergio Durigan Junior, Pedro Alves

On 17-05-02 10:21 AM, John Baldwin wrote:
> I had a similar thought about FreeBSD, FWIW.  I wasn't sure if we wanted to
> wait for a followup to do that so that for this commit you could directly
> compare the old foo.mh file to a new clause in configure.nat as a way to
> check for any typos in case there is a regression reported in the future.
> You could perhaps include a second patch as a followup in a single series to
> add a host clause, but I think the intermediate step as its own commit has
> some merit.

Yes, I completely agree.


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete  "gdb/config/*/*.mh" files)
  2017-05-02  2:44 ` Simon Marchi
  2017-05-02 14:57   ` John Baldwin
@ 2017-05-02 19:28   ` Sergio Durigan Junior
  2017-05-02 20:16     ` Simon Marchi
  1 sibling, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-02 19:28 UTC (permalink / raw)
  To: Simon Marchi; +Cc: GDB Patches, Pedro Alves, John Baldwin

On Monday, May 01 2017, Simon Marchi wrote:

>> +++ b/gdb/configure.nat
>> @@ -0,0 +1,591 @@
>> +# Copyright (C) 2013-2017 Free Software Foundation, Inc.
>> +#
>> +# This file is part of GDB.
>> +#
>> +# This program is free software; you can redistribute it and/or modify
>> +# it under the terms of the GNU General Public License as published by
>> +# the Free Software Foundation; either version 3 of the License, or
>> +# (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program.  If not, see
>> <http://www.gnu.org/licenses/>.
>> +
>> +# Variables defined here:
>> +#
>> +# NAT_FILE
>> +# NATDEPFILES
>> +# NAT_CDEPS
>> +# LOADLIBES
>> +# MH_CFLAGS
>> +# XM_CLIBS
>> +# NAT_GENERATED_FILES
>> +# HAVE_NATIVE_GCORE_HOST
>> +# NAT_EXTRA_FRAGS_FILE
>
> Could you document (if you know it) what each variable does?

Sure.  Here's what I know what them.  What do you think?

# Variables defined here:
#
# NAT_FILE - The header file with definitions for this host
#
# NATDEPFILES - The depfiles to be compiled for this host
#
# NAT_CDEPS - Dynamic symbols to be exported for libthread_db
#
# LOADLIBES - Libraries that will be linked against GDB for this host
#
# MH_CFLAGS - Additional CFLAGS for this host
#
# XM_CLIBS - Host-dependent libs to be linked against GDB.
#
# NAT_GENERATED_FILES - Generated files by this host
#
# HAVE_NATIVE_GCORE_HOST - 
#
# NAT_EXTRA_FRAGS_FILE - File containing extra fragments of Makefile
#                        that will be used by this host.
#
# Notes:
#
# - To avoid shell expansion of variables, declare them with single
#   quotes.
#
# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.

>> +# - To avoid shell expansion of variables, declare them with single
>> +#   quotes.
>> +#
>> +# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
>> +
>> +case ${gdb_host_cpu} in
>> +  aarch64)
>> +    case ${gdb_host} in
>> +      linux)
>> +	#  Host: AArch64 based machine running GNU/Linux
>> +	NAT_FILE='config/nm-linux.h'
>> +	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o
>> aarch32-linux-nat.o \
>> +		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
>> +		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
>> +		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
>> +		aarch64-linux.o'
>
> IMO, the interest of having all of this in a single file is to be able
> to factor out common things.  A lot of NATDEPFILES are repeated Would
> it be possible to have a switch on ${gdb_host} at the top level, and
> specify all the files specific to OSes but machine-agnostic?  For
> example, fork-child.o and inf-ptrace.o probably appear in all the
> linux ports.

Fair point.  I will address what you and Jon mentioned, and resubmit the
patch with the modifications.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete   "gdb/config/*/*.mh" files)
  2017-05-02 19:28   ` Sergio Durigan Junior
@ 2017-05-02 20:16     ` Simon Marchi
  2017-05-02 21:30       ` Pedro Alves
  2017-05-02 22:17       ` Sergio Durigan Junior
  0 siblings, 2 replies; 30+ messages in thread
From: Simon Marchi @ 2017-05-02 20:16 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Pedro Alves, John Baldwin

On 2017-05-02 15:28, Sergio Durigan Junior wrote:
>>> +# Variables defined here:
>>> +#
>>> +# NAT_FILE
>>> +# NATDEPFILES
>>> +# NAT_CDEPS
>>> +# LOADLIBES
>>> +# MH_CFLAGS
>>> +# XM_CLIBS
>>> +# NAT_GENERATED_FILES
>>> +# HAVE_NATIVE_GCORE_HOST
>>> +# NAT_EXTRA_FRAGS_FILE
>> 
>> Could you document (if you know it) what each variable does?
> 
> Sure.  Here's what I know what them.  What do you think?
> 
> # Variables defined here:
> #
> # NAT_FILE - The header file with definitions for this host

Looks good.

> #
> # NATDEPFILES - The depfiles to be compiled for this host

"depfiles" is not so clear I think.  Perhaps

   NATDEPFILES - Source files required for native debugging on this host.

> #
> # NAT_CDEPS - Dynamic symbols to be exported for libthread_db

Looks good.

> #
> # LOADLIBES - Libraries that will be linked against GDB for this host

Don't we usually say the reverse, the program is linked against the 
libraries?

   LOADLIBES - Libraries against which GDB will be linked for this host.

> #
> # MH_CFLAGS - Additional CFLAGS for this host

Looks good.

> #
> # XM_CLIBS - Host-dependent libs to be linked against GDB.

Same comment about "linked against".

> # NAT_GENERATED_FILES - Generated files by this host

by -> for?

   NAT_GENERATED_FILES - Generated files for this host.

> # HAVE_NATIVE_GCORE_HOST -

I just noticed that this variable is not defined in Makefile.in.  
configure.ac AC_SUBST's _TARGET twice, but not _HOST, so I think you 
confused them.

But to be honest, I am also completely confused by what those two 
variables do.

> # NAT_EXTRA_FRAGS_FILE - Extra Makefile fragmentsFile containing extra 
> fragments of Makefile
> #                        that will be used by this host.

That could be shortened to

   NAT_EXTRA_FRAGS_FILE - Extra Makefile fragments that will be used for 
this host.

Make sure they all end (or don't end) with a period, for consistency.

Perhaps someone could shed some light on the obscure variables names?  
What do the XM_ and MH_ prefixes stand for?  What's the difference 
between XM_CLIBS and LOADLIBES (and why is it called "LIBES"?) ?

>> IMO, the interest of having all of this in a single file is to be able
>> to factor out common things.  A lot of NATDEPFILES are repeated Would
>> it be possible to have a switch on ${gdb_host} at the top level, and
>> specify all the files specific to OSes but machine-agnostic?  For
>> example, fork-child.o and inf-ptrace.o probably appear in all the
>> linux ports.
> 
> Fair point.  I will address what you and Jon mentioned, and resubmit 
> the
> patch with the modifications.

Ok.  But as John mentioned, it's probably better if this patch is a 
simple translation of what's already there, and any "optimization" 
coming in a subsequent patch.  It will be easier to track the changes.

Thanks,

Simon

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-02 20:16     ` Simon Marchi
@ 2017-05-02 21:30       ` Pedro Alves
  2017-05-02 22:17       ` Sergio Durigan Junior
  1 sibling, 0 replies; 30+ messages in thread
From: Pedro Alves @ 2017-05-02 21:30 UTC (permalink / raw)
  To: Simon Marchi, Sergio Durigan Junior; +Cc: GDB Patches, John Baldwin

Let's try to avoid mixing terminology here -- the NAT_ variables should
not be described in terms of "host", but instead in terms
of "native target".  That's why they're called NAT_*.  

Host-dependent variables would be better (at some point, not
in this particular patch) moved/left to configure.host
instead.  Those are supposedly bits that are necessary even if
the native target backend is not included in the build.

If the native target backends of gdb and gdbserver were already fully
shared, then configure.nat would be shared, while gdb/configure.host
would not.

See also:
  https://sourceware.org/gdb/wiki/Internals%20Adding-a-New-Host
  https://sourceware.org/gdb/wiki/Internals%20Native-Debugging

(/me mutters something about wikified internals manual being hard
to search and browse.)

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH] Introduce "gdb/configure.nat" (and delete   "gdb/config/*/*.mh" files)
  2017-05-02 20:16     ` Simon Marchi
  2017-05-02 21:30       ` Pedro Alves
@ 2017-05-02 22:17       ` Sergio Durigan Junior
  1 sibling, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-02 22:17 UTC (permalink / raw)
  To: Simon Marchi; +Cc: GDB Patches, Pedro Alves, John Baldwin

On Tuesday, May 02 2017, Simon Marchi wrote:

> On 2017-05-02 15:28, Sergio Durigan Junior wrote:
>>>> +# Variables defined here:
>>>> +#
>>>> +# NAT_FILE
>>>> +# NATDEPFILES
>>>> +# NAT_CDEPS
>>>> +# LOADLIBES
>>>> +# MH_CFLAGS
>>>> +# XM_CLIBS
>>>> +# NAT_GENERATED_FILES
>>>> +# HAVE_NATIVE_GCORE_HOST
>>>> +# NAT_EXTRA_FRAGS_FILE
>>>
>>> Could you document (if you know it) what each variable does?
>>
>> Sure.  Here's what I know what them.  What do you think?
>>
>> # Variables defined here:
>> #
>> # NAT_FILE - The header file with definitions for this host
>
> Looks good.
>
>> #
>> # NATDEPFILES - The depfiles to be compiled for this host
>
> "depfiles" is not so clear I think.  Perhaps
>
>   NATDEPFILES - Source files required for native debugging on this host.

Adopted.

>> #
>> # NAT_CDEPS - Dynamic symbols to be exported for libthread_db
>
> Looks good.
>
>> #
>> # LOADLIBES - Libraries that will be linked against GDB for this host
>
> Don't we usually say the reverse, the program is linked against the
> libraries?
>
>   LOADLIBES - Libraries against which GDB will be linked for this host.

You're right.  Fixed.

>> #
>> # MH_CFLAGS - Additional CFLAGS for this host
>
> Looks good.
>
>> #
>> # XM_CLIBS - Host-dependent libs to be linked against GDB.
>
> Same comment about "linked against".

Fixed.

>> # NAT_GENERATED_FILES - Generated files by this host
>
> by -> for?
>
>   NAT_GENERATED_FILES - Generated files for this host.

Right, fixed.

>> # HAVE_NATIVE_GCORE_HOST -
>
> I just noticed that this variable is not defined in Makefile.in.
> configure.ac AC_SUBST's _TARGET twice, but not _HOST, so I think you
> confused them.

Yeah, I did confuse.  Fixed on gdb/Makefile.in.

> But to be honest, I am also completely confused by what those two
> variables do.

So, doing a bit of archaeology I found that these flags were added by
b292c7831823605b02a564b0a9274f95141c92ee.  According to the discussions
relevant to this commit
(<https://sourceware.org/ml/gdb-patches/2013-04/msg00321.html>), I see
that these flags serve to signalize whether the gcore script will be
installed or not.

>> # NAT_EXTRA_FRAGS_FILE - Extra Makefile fragmentsFile containing
>> extra fragments of Makefile
>> #                        that will be used by this host.
>
> That could be shortened to
>
>   NAT_EXTRA_FRAGS_FILE - Extra Makefile fragments that will be used
> for this host.

Hm, not sure.  My intention was to make it clear that this variable
needs to contain a filename.  Your proposed description could be
interpreted differently, I'm afraid.

> Make sure they all end (or don't end) with a period, for consistency.

Sure; this was just a quick draft, I fixed the inconsistencies now :-).

> Perhaps someone could shed some light on the obscure variables names?
> What do the XM_ and MH_ prefixes stand for?  What's the difference
> between XM_CLIBS and LOADLIBES (and why is it called "LIBES"?) ?

Good question, I was also wondering that myself :-).

>>> IMO, the interest of having all of this in a single file is to be able
>>> to factor out common things.  A lot of NATDEPFILES are repeated Would
>>> it be possible to have a switch on ${gdb_host} at the top level, and
>>> specify all the files specific to OSes but machine-agnostic?  For
>>> example, fork-child.o and inf-ptrace.o probably appear in all the
>>> linux ports.
>>
>> Fair point.  I will address what you and Jon mentioned, and resubmit
>> the
>> patch with the modifications.
>
> Ok.  But as John mentioned, it's probably better if this patch is a
> simple translation of what's already there, and any "optimization"
> coming in a subsequent patch.  It will be easier to track the changes.

Sure.  I'll send a series of 2 patches, the first one containing the
original patch (+ the proposed modifications by you and Pedro), and the
second one containing the rearrangement to make things clearer.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
  2017-05-03  3:49   ` [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
@ 2017-05-03  3:49   ` Sergio Durigan Junior
  2017-05-03 16:45     ` John Baldwin
  2017-05-04 16:34     ` Pedro Alves
  1 sibling, 2 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-03  3:49 UTC (permalink / raw)
  To: GDB Patches
  Cc: Pedro Alves, Simon Marchi, John Baldwin, Sergio Durigan Junior

The previous commit introduced gdb/configure.nat, but it was just a
copy-and-past (with the necessary adjustments) from the files under
gdb/config/.  We can do better than that.

Instead of using one big 'case' statement that matches the
${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
remove a lof of redundancy by matching the most common ${gdb_host}'s
first, setting the common variables for each, and then proceed to
matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
words, reverse the order of the 'case's and take advantage of the fact
that a lot of parameters are the same for each host.

This commit was tested on x86_64 without regressions.

yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* configure.nat: Rearrange 'case' statements to make the code
          simpler and less redundant.
---
 gdb/configure.nat | 943 ++++++++++++++++++++++++------------------------------
 1 file changed, 413 insertions(+), 530 deletions(-)

diff --git a/gdb/configure.nat b/gdb/configure.nat
index a634031..32ae9b5 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -49,560 +49,443 @@
 # - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
 
 
-case ${gdb_host_cpu} in
-  aarch64)
-    case ${gdb_host} in
-      linux)
-	#  Host: AArch64 based machine running GNU/Linux
+# This first case is useful for filling default values for each
+# gdb_host.
+case ${gdb_host} in
+    *linux*)
 	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
-		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
-		aarch64-linux.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  alpha)
-    case ${gdb_host} in
-      alpha-linux)
-	# Host: Little-endian Alpha running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
-		fork-child.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NATDEPFILES='inf-ptrace.o fork-child.o proc-service.o \
+		linux-thread-db.o linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
 	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
 	LOADLIBES='-ldl $(RDYNAMIC)'
-
-	# doublest.c currently assumes some properties of FP arithmetic
-	# on the host which require this.
-	MH_CFLAGS='-mieee'
 	;;
-      nbsd)
-	# Host: NetBSD/alpha
-	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
-
+    fbsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
 	LOADLIBES='-lkvm'
 	;;
-    esac
-    ;;
-  arm)
-    case ${gdb_host} in
-      linux)
-	# Host: ARM based machine running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
-		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
+    nbsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o'
 	;;
-      nbsdelf)
-	# Host: NetBSD/arm
-	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
+    obsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o'
 	;;
-    esac
-    ;;
-  i386)
-    case ${gdb_host} in
-      cygwin64)
-	#  Native config information for GDB on PowerPC systems running FreeBSD.
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+    cygwin*)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
 	;;
-      cygwin)
-	MH_CFLAGS=
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
-	XM_CLIBS=
+    mingw*)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
 	;;
-      darwin)
-	# Host: IA86 running Darwin
-	NATDEPFILES='fork-child.o darwin-nat.o \
-	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
-	;;
-      fbsd64)
-	# Host: FreeBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
-		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      fbsd)
-	# Host: FreeBSD/i386
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
-		i386-fbsd-nat.o bsd-kvm.o'
-	NAT_FILE='nm-fbsd.h'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      go32)
-	# Host: Intel x86 running DJGPP
-
-	# We include several header files from config/djgpp
-	MH_CFLAGS='-I$(srcdir)/config/djgpp'
-
-	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+esac
 
-	XM_CLIBS='-ldbg'
-	;;
-      i386gnu)
-	# Host: Intel 386 running the GNU Hurd
-	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
+# This is where we actually filter by host and host CPU.
+case ${gdb_host} in
+    aix)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Host: IBM PowerPC running AIX aix-thread.o is not
+		# listed in NATDEPFILES as it is pulled in by
+		# configure.
+		NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+
+		# When compiled with cc, for debugging, this argument
+		# should be passed.  We have no idea who our current
+		# compiler is though, so we skip it.
+		# MH_CFLAGS='-bnodelcsect'
+		;;
+	esac
+	;;
+    alpha-linux)
+	case ${gdb_host_cpu} in
+	    alpha)
+		# Host: Little-endian Alpha running Linux
+		NATDEPFILES="${NATDEPFILES} alpha-linux-nat.o"
+		# doublest.c currently assumes some properties of FP arithmetic
+		# on the host which require this.
+		MH_CFLAGS='-mieee'
+		;;
+	esac
+	;;
+    cygwin)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Native config information for GDB on i386
+		# systems running Cygwin.
+		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+		;;
+	esac
+	;;
+    cygwin64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Native config information for GDB on amd64
+		# systems running Cygwin.
+		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
+		;;
+	esac
+	;;
+    darwin)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: IA86 running Darwin
+		NATDEPFILES='fork-child.o darwin-nat.o \
+		i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o \
+		darwin-nat-info.o'
+		;;
+	esac
+	;;
+    fbsd)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: FreeBSD/i386
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
+		NAT_FILE='nm-fbsd.h'
+		;;
+	    mips)
+		# Host: FreeBSD/mips
+		NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
+		HAVE_NATIVE_GCORE_HOST=1
+		LOADLIBES=
+		;;
+	    powerpc)
+		# Native config information for GDB on PowerPC
+		# systems running FreeBSD.
+		NATDEPFILES="${NATDEPFILES} ppc-fbsd-nat.o bsd-kvm.o"
+		;;
+	    sparc)
+		# Host: FreeBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
+		sparc64-fbsd-nat.o bsd-kvm.o"
+		;;
+	esac
+	;;
+    fbsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: FreeBSD/amd64
+		NATDEPFILES="${NATDEPFILES} amd64-nat.o amd64-bsd-nat.o \
+		amd64-fbsd-nat.o bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o"
+		;;
+	esac
+	;;
+    go32)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel x86 running DJGPP
+		# We include several header files from config/djgpp
+		MH_CFLAGS='-I$(srcdir)/config/djgpp'
+		NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+		XM_CLIBS='-ldbg'
+		;;
+	esac
+	;;
+    i386gnu)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel 386 running the GNU Hurd
+		NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
 		     x86-nat.o x86-dregs.o fork-child.o \
 		     notify_S.o process_reply_S.o msg_reply_S.o \
 		     msg_U.o exc_request_U.o exc_request_S.o'
-	HAVE_NATIVE_GCORE_HOST=1
+		HAVE_NATIVE_GCORE_HOST=1
 
-	NAT_FILE='nm-i386gnu.h'
-	MH_CFLAGS='-D_GNU_SOURCE'
+		NAT_FILE='nm-i386gnu.h'
+		MH_CFLAGS='-D_GNU_SOURCE'
 
-	XM_CLIBS='-lshouldbeinlibc'
+		XM_CLIBS='-lshouldbeinlibc'
 
-	NAT_EXTRA_FRAGS_FILE="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+		NAT_EXTRA_FRAGS_FILE="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
 
-	NAT_GENERATED_FILES='notify_S.h notify_S.c \
+		NAT_GENERATED_FILES='notify_S.h notify_S.c \
 		process_reply_S.h process_reply_S.c \
 		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
 		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c'
-	;;
-      i386sol2)
-	# Host: Solaris x86
-	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+		;;
+	esac
+	;;
+    i386sol2)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Solaris x86
+		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
 		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-      linux64)
-	# Host: GNU/Linux x86-64
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
-		x86-linux-nat.o \
-		linux-nat.o linux-osdata.o \
-		proc-service.o linux-thread-db.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-btrace.o \
-		linux-waitpid.o linux-personality.o x86-linux.o \
-		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
-	NAT_FILE='config/nm-linux.h'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      linux)
-	# Host: Intel 386 running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
-		x86-linux-dregs.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      mingw64)
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
-	;;
-      mingw)
-	MH_CFLAGS=
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
-	XM_CLIBS=
-	;;
-      nbsd64)
-	# Host: NetBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
-	;;
-      nbsdelf)
-	# Host: NetBSD/i386 ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      nto)
-	# Host: Intel 386 running QNX.
-	NATDEPFILES='nto-procfs.o'
-	NAT_FILE='config/nm-nto.h'
-	;;
-      obsd64)
-	# Host: OpenBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/i386 ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      sol2-64)
-	# Host: Solaris x86_64
-	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    linux)
+	case ${gdb_host_cpu} in
+	    aarch64)
+		#  Host: AArch64 based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} aarch64-linux-nat.o \
+		aarch32-linux-nat.o aarch64-linux-hw-point.o aarch64-linux.o"
+		;;
+	    arm)
+		# Host: ARM based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \
+		aarch32-linux-nat.o"
+		;;
+	    i386)
+		# Host: Intel 386 running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
+		x86-linux.o x86-linux-dregs.o"
+		;;
+	    ia64)
+		# Host: Intel IA-64 running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} ia64-linux-nat.o"
+		;;
+	    m32r)
+		# Host: M32R based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} m32r-linux-nat.o"
+		;;
+	    m68k)
+		# Host: Motorola m68k running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o"
+		;;
+	    mips)
+		# Host: Linux/MIPS
+		NATDEPFILES="${NATDEPFILES} mips-linux-nat.o \
+		mips-linux-watch.o"
+		;;
+	    pa)
+		# Host: Hewlett-Packard PA-RISC machine, running Linux
+		NATDEPFILES="${NATDEPFILES} hppa-linux-nat.o"
+		;;
+	    powerpc)
+		# Host: PowerPC, running Linux
+		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o"
+		;;
+	    s390)
+		# Host: S390, running Linux
+		NATDEPFILES="${NATDEPFILES} s390-linux-nat.o"
+		;;
+	    sparc)
+		# Host: GNU/Linux SPARC
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-linux-nat.o"
+		;;
+	    tilegx)
+		# Host: Tilera TILE-Gx running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} tilegx-linux-nat.o"
+		NAT_CDEPS=
+		;;
+	    xtensa)
+		# Host: Xtensa, running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} xtensa-linux-nat.o"
+		;;
+	esac
+	;;
+    linux64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: GNU/Linux x86-64
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
+		x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
+		;;
+	    sparc)
+		# Host: GNU/Linux UltraSPARC
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
+		sparc64-linux-nat.o"
+		;;
+	esac
+	;;
+    mingw)
+	case ${gdb_host_cpu} in
+	    i386)
+		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+		;;
+	esac
+	;;
+    mingw64)
+	case ${gdb_host_cpu} in
+	    i386)
+		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
+		;;
+	esac
+	;;
+    nbsd)
+	case ${gdb_host_cpu} in
+	    alpha)
+		# Host: NetBSD/alpha
+		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    mips)
+		# Host: NetBSD/mips
+		NATDEPFILES="${NATDEPFILES} mips-nbsd-nat.o"
+		;;
+	    pa)
+		# Host: NetBSD/hppa
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o hppa-nbsd-nat.o"
+		;;
+	    powerpc)
+		# Host: NetBSD/powerpc
+		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    sh)
+		# Host: NetBSD/sh
+		NATDEPFILES="${NATDEPFILES} sh-nbsd-nat.o"
+		;;
+
+	esac
+	;;
+    nbsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: NetBSD/amd64
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o \
+		x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o"
+		;;
+	    sparc)
+		# Host: NetBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o \
+		bsd-kvm.o"
+		;;
+
+	esac
+	;;
+    nbdself)
+	case ${gdb_host_cpu} in
+	    arm)
+		# Host: NetBSD/arm
+		NATDEPFILES="${NATDEPFILES} arm-nbsd-nat.o"
+		;;
+	    i386)
+		# Host: NetBSD/i386 ELF
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-bsd-nat.o \
+		i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m68k)
+		# Host: NetBSD/m68k ELF
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    sparc)
+		# Host: NetBSD/sparc ELF
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o \
+		bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    vax)
+		# Host: NetBSD/vax ELF
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+
+	esac
+	;;
+    nto)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel 386 running QNX.
+		NATDEPFILES='nto-procfs.o'
+		NAT_FILE='config/nm-nto.h'
+		;;
+	esac
+	;;
+    obsd)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: OpenBSD/i386 ELF
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o x86-bsd-nat.o \
+		i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m68k)
+		# Host: OpenBSD/m68k
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m88k)
+		# Host: OpenBSD/m88k
+		NATDEPFILES="${NATDEPFILES} m88k-bsd-nat.o"
+		;;
+	    pa)
+		# Host: OpenBSD/hppa
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o hppa-obsd-nat.o"
+		;;
+	    powerpc)
+		# Host: OpenBSD/powerpc
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o ppc-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    vax)
+		# Host: OpenBSD/vax
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	esac
+	;;
+    obsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: OpenBSD/amd64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o \
+		x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    mips)
+		# Host: OpenBSD/mips64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o mips64-obsd-nat.o"
+		;;
+	    sparc)
+		# Host: OpenBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o sparc64-obsd-nat.o \
+		sparc-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	esac
+	;;
+    ppc64-linux)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Host: PowerPC64, running Linux
+		XM_CLIBS=
+		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o ppc-linux.o"
+		;;
+	esac
+	;;
+    sol2)
+	case ${gdb_host_cpu} in
+	    sparc)
+		# Host: Solaris SPARC & UltraSPARC
+		NAT_FILE='nm-sol2.h'
+		NATDEPFILES='sparc-sol2-nat.o \
+		fork-child.o \
 		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-    esac
-    ;;
-  ia64)
-    case ${gdb_host} in
-      linux)
-	# Host: Intel IA-64 running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ia64-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-personality.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  m32r)
-    case ${gdb_host} in
-      linux)
-	# Host: M32R based machine running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o				\
-		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  m68k)
-    case ${gdb_host} in
-      linux)
-	# Host: Motorola m68k running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		m68k-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-personality.o \
-		linux-waitpid.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsdelf)
-	# Host: NetBSD/m68k ELF
-	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/m68k
-	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
-
-	LOADLIBES='-lkvm'
-	;;
-    esac
-    ;;
-  m88k)
-    case ${gdb_host} in
-      obsd)
-	# Host: OpenBSD/m88k
-	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
-	;;
-    esac
-    ;;
-  mips)
-    case ${gdb_host} in
-      fbsd)
-	# Host: FreeBSD/mips
-	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-      linux)
-	# Host: Linux/MIPS
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o \
-		mips-linux-watch.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/mips
-	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
-	;;
-      obsd64)
-	# Host: OpenBSD/mips64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
-	;;
-    esac
-    ;;
-  pa)
-    case ${gdb_host} in
-      linux)
-	# Host: Hewlett-Packard PA-RISC machine, running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		hppa-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/hppa
-	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
-	;;
-      obsd)
-	# Host: OpenBSD/hppa
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
-	;;
-    esac
-    ;;
-  powerpc)
-    case ${gdb_host} in
-      aix)
-	# Host: IBM PowerPC running AIX
-	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
-	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
-
-	# When compiled with cc, for debugging, this argument should be passed.
-	# We have no idea who our current compiler is though, so we skip it.
-	# MH_CFLAGS='-bnodelcsect'
-	;;
-      fbsd)
-	#  Native config information for GDB on PowerPC systems running FreeBSD.
-	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      linux)
-	# Host: PowerPC, running Linux
-	XM_CLIBS=
-
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ppc-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/powerpc
-	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/powerpc
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      ppc64-linux)
-	# Host: PowerPC64, running Linux
-	XM_CLIBS=
-
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ppc-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o ppc-linux.o linux-personality.o \
-		linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      spu-linux)
-	# Target: Cell BE (PowerPC64 + SPU)
-	# This implements a 'pseudo-native' GDB running on the
-	# PPU side of the Cell BE and debugging the SPU side.
-
-	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    sol2-64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Solaris x86_64
+		NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    spu-linux)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Target: Cell BE (PowerPC64 + SPU)
+		# This implements a 'pseudo-native' GDB running on the
+		# PPU side of the Cell BE and debugging the SPU side.
+		NAT_FILE=
+		NAT_CDEPS=
+		LOADLIBES=
+		NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
 		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
 		      linux-personality.o linux-namespaces.o'
+		;;
+	esac
 	;;
-    esac
-    ;;
-  s390)
-    case ${gdb_host} in
-      linux)
-	# Host: S390, running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-personality.o \
-		linux-waitpid.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  sh)
-    case ${gdb_host} in
-      nbsd)
-	# Host: NetBSD/sh
-	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
-	;;
-    esac
-    ;;
-  sparc)
-    case ${gdb_host} in
-      fbsd)
-	# Host: FreeBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
-		bsd-kvm.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      linux64)
-	# Host: GNU/Linux UltraSPARC
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
-		fork-child.o inf-ptrace.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      linux)
-	# Host: GNU/Linux SPARC
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
-		fork-child.o inf-ptrace.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd64)
-	# Host: NetBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      nbsdelf)
-	# Host: NetBSD/sparc ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd64)
-	# Host: OpenBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      sol2)
-	# Host: Solaris SPARC & UltraSPARC
-	NAT_FILE='nm-sol2.h'
-	NATDEPFILES='sparc-sol2-nat.o \
-		fork-child.o \
-		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-    esac
-    ;;
-  tilegx)
-    case ${gdb_host} in
-      linux)
-	# Host: Tilera TILE-Gx running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		tilegx-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  vax)
-    case ${gdb_host} in
-      nbsdelf)
-	# Host: NetBSD/vax ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		vax-bsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/vax
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		vax-bsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-    esac
-    ;;
-  xtensa)
-    case ${gdb_host} in
-      linux)
-	# Host: Xtensa, running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-
-	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
 esac
-- 
2.9.3

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v2 0/2] Introduce gdb/configure.nat
  2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
                   ` (2 preceding siblings ...)
  2017-05-02  2:44 ` Simon Marchi
@ 2017-05-03  3:49 ` Sergio Durigan Junior
  2017-05-03  3:49   ` [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
  2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
  2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
  4 siblings, 2 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-03  3:49 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Simon Marchi, John Baldwin

Hi there,

Thanks to Simon, Pedro and John, this is the second version of the
patch.  It basically addresses a few typos/grammar mistakes noticed by
Simon, the s/host/native target/ noticed by Pedro, and reorganizes the
code to make things simpler and less redundant, as suggested by both
Simon and John.

Thanks,

Sergio.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
@ 2017-05-03  3:49   ` Sergio Durigan Junior
  2017-05-04 16:16     ` Pedro Alves
  2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
  1 sibling, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-03  3:49 UTC (permalink / raw)
  To: GDB Patches
  Cc: Pedro Alves, Simon Marchi, John Baldwin, Sergio Durigan Junior

Due to my ongoing work to make it possible for gdbserver to start the
inferior using the shell, I had to share the fork_inferior function
under the "nat/" directory.  In order to do that, I created a new file
and put the function there; however, this meant that I now had to
update some of the *.mh files (under "gdb/config") and add the new
file as a dependency to be built natively.  Bleh...

After talking a bit to Pedro about this, the idea came up to write a
new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
concentrate all of the native settings for each host/system.  I
decided to tackle this issue.

The patch is simple.  All of the previous Makefile variables that were
being declared inside the *.mh files are now inside "gdb/Makefile.in",
and "gdb/configure" is responsible for AC_SUBST'ing them.  The
definitions of these variables were put inside "gdb/configure.nat", so
now they're shell variables.  For excerpts of Makefile code, one must
create a file under "gdb/config/${gdb_cpu_host}" and reference it on
the "NAT_EXTRA_FRAGS_FILE" variable.

It should now be easier to update the native dependencies of hosts in
this single file.

This has been tested on x86_64 without regressions.

gdb/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile.in: Remove "@host_makefile_frag@".  Add variables
	NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
	NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_TARGET.  Add
	"@NAT_EXTRA_FRAGS_FILE@".
	(Makefile): Remove dependency on "@frags@".
	($(GNULIB_BUILDDIR)/Makefile): Likewise.
	(data-directory/Makefile): Likewise.
	* config/aarch64/linux.mh: Deleted; moved contents to
	"gdb/configure.nat".
	* config/alpha/alpha-linux.mh: Likewise.
	* config/alpha/nbsd.mh: Likewise.
	* config/arm/linux.mh: Likewise.
	* config/arm/nbsdelf.mh: Likewise.
	* config/i386/cygwin.mh: Likewise.
	* config/i386/cygwin64.mh: Likewise.
	* config/i386/darwin.mh: Likewise.
	* config/i386/fbsd.mh: Likewise.
	* config/i386/fbsd64.mh: Likewise.
	* config/i386/go32.mh: Likewise.
	* config/i386/i386gnu.mh: Likewise.
	* config/i386/i386sol2.mh: Likewise.
	* config/i386/linux.mh: Likewise.
	* config/i386/linux64.mh: Likewise.
	* config/i386/mingw.mh: Likewise.
	* config/i386/mingw64.mh: Likewise.
	* config/i386/nbsd64.mh: Likewise.
	* config/i386/nbsdelf.mh: Likewise.
	* config/i386/nto.mh: Likewise.
	* config/i386/obsd.mh: Likewise.
	* config/i386/obsd64.mh: Likewise.
	* config/i386/sol2-64.mh: Likewise.
	* config/ia64/linux.mh: Likewise.
	* config/m32r/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/m68k/nbsdelf.mh: Likewise.
	* config/m68k/obsd.mh: Likewise.
	* config/m88k/obsd.mh: Likewise.
	* config/mips/fbsd.mh: Likewise.
	* config/mips/linux.mh: Likewise.
	* config/mips/nbsd.mh: Likewise.
	* config/mips/obsd64.mh: Likewise.
	* config/pa/linux.mh: Likewise.
	* config/pa/nbsd.mh: Likewise.
	* config/pa/obsd.mh: Likewise.
	* config/powerpc/aix.mh: Likewise.
	* config/powerpc/fbsd.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/powerpc/nbsd.mh: Likewise.
	* config/powerpc/obsd.mh: Likewise.
	* config/powerpc/ppc64-linux.mh: Likewise.
	* config/powerpc/spu-linux.mh: Likewise.
	* config/s390/linux.mh: Likewise.
	* config/sh/nbsd.mh: Likewise.
	* config/sparc/fbsd.mh: Likewise.
	* config/sparc/linux.mh: Likewise.
	* config/sparc/linux64.mh: Likewise.
	* config/sparc/nbsd64.mh: Likewise.
	* config/sparc/nbsdelf.mh: Likewise.
	* config/sparc/obsd64.mh: Likewise.
	* config/sparc/sol2.mh: Likewise.
	* config/tilegx/linux.mh: Likewise.
	* config/vax/nbsdelf.mh: Likewise.
	* config/vax/obsd.mh: Likewise.
	* config/xtensa/linux.mh: Likewise.
	* config/i386/i386gnu-extra.mh: New file.
	* configure: Regenerate.
	* configure.ac: Rewrite code to use "gdb/configure.nat" instead of
	*.mh files under "gdb/config".
	* configure.nat: New file, with contents from the
	"gdb/config/*/*.mh" files.

gdb/doc/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile: Remove "@host_makefile_frag".
---
 gdb/Makefile.in                                  |  17 +-
 gdb/config/aarch64/linux.mh                      |  29 --
 gdb/config/alpha/alpha-linux.mh                  |  15 -
 gdb/config/alpha/nbsd.mh                         |   4 -
 gdb/config/arm/linux.mh                          |  10 -
 gdb/config/arm/nbsdelf.mh                        |   2 -
 gdb/config/i386/cygwin.mh                        |   3 -
 gdb/config/i386/cygwin64.mh                      |  20 -
 gdb/config/i386/darwin.mh                        |   4 -
 gdb/config/i386/fbsd.mh                          |   8 -
 gdb/config/i386/fbsd64.mh                        |   7 -
 gdb/config/i386/go32.mh                          |  11 -
 gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} |  23 +-
 gdb/config/i386/i386sol2.mh                      |   4 -
 gdb/config/i386/linux.mh                         |  14 -
 gdb/config/i386/linux64.mh                       |  15 -
 gdb/config/i386/mingw.mh                         |   3 -
 gdb/config/i386/mingw64.mh                       |   1 -
 gdb/config/i386/nbsd64.mh                        |   3 -
 gdb/config/i386/nbsdelf.mh                       |   5 -
 gdb/config/i386/nto.mh                           |   4 -
 gdb/config/i386/obsd.mh                          |   5 -
 gdb/config/i386/obsd64.mh                        |   5 -
 gdb/config/i386/sol2-64.mh                       |   4 -
 gdb/config/ia64/linux.mh                         |  13 -
 gdb/config/m32r/linux.mh                         |  10 -
 gdb/config/m68k/linux.mh                         |  14 -
 gdb/config/m68k/nbsdelf.mh                       |   4 -
 gdb/config/m68k/obsd.mh                          |   4 -
 gdb/config/m88k/obsd.mh                          |   2 -
 gdb/config/mips/fbsd.mh                          |   3 -
 gdb/config/mips/linux.mh                         |  11 -
 gdb/config/mips/nbsd.mh                          |   2 -
 gdb/config/mips/obsd64.mh                        |   2 -
 gdb/config/pa/linux.mh                           |  10 -
 gdb/config/pa/nbsd.mh                            |   2 -
 gdb/config/pa/obsd.mh                            |   2 -
 gdb/config/powerpc/aix.mh                        |   8 -
 gdb/config/powerpc/fbsd.mh                       |  24 -
 gdb/config/powerpc/linux.mh                      |  12 -
 gdb/config/powerpc/nbsd.mh                       |   4 -
 gdb/config/powerpc/obsd.mh                       |   4 -
 gdb/config/powerpc/ppc64-linux.mh                |  15 -
 gdb/config/powerpc/spu-linux.mh                  |   8 -
 gdb/config/s390/linux.mh                         |   9 -
 gdb/config/sh/nbsd.mh                            |   2 -
 gdb/config/sparc/fbsd.mh                         |   7 -
 gdb/config/sparc/linux.mh                        |  13 -
 gdb/config/sparc/linux64.mh                      |  13 -
 gdb/config/sparc/nbsd64.mh                       |   5 -
 gdb/config/sparc/nbsdelf.mh                      |   5 -
 gdb/config/sparc/obsd64.mh                       |   5 -
 gdb/config/sparc/sol2.mh                         |   6 -
 gdb/config/tilegx/linux.mh                       |  13 -
 gdb/config/vax/nbsdelf.mh                        |   5 -
 gdb/config/vax/obsd.mh                           |   5 -
 gdb/config/xtensa/linux.mh                       |  11 -
 gdb/configure                                    |  34 +-
 gdb/configure.ac                                 |  33 +-
 gdb/configure.nat                                | 608 +++++++++++++++++++++++
 gdb/doc/Makefile.in                              |   3 -
 61 files changed, 654 insertions(+), 493 deletions(-)
 delete mode 100644 gdb/config/aarch64/linux.mh
 delete mode 100644 gdb/config/alpha/alpha-linux.mh
 delete mode 100644 gdb/config/alpha/nbsd.mh
 delete mode 100644 gdb/config/arm/linux.mh
 delete mode 100644 gdb/config/arm/nbsdelf.mh
 delete mode 100644 gdb/config/i386/cygwin.mh
 delete mode 100644 gdb/config/i386/cygwin64.mh
 delete mode 100644 gdb/config/i386/darwin.mh
 delete mode 100644 gdb/config/i386/fbsd.mh
 delete mode 100644 gdb/config/i386/fbsd64.mh
 delete mode 100644 gdb/config/i386/go32.mh
 rename gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} (58%)
 delete mode 100644 gdb/config/i386/i386sol2.mh
 delete mode 100644 gdb/config/i386/linux.mh
 delete mode 100644 gdb/config/i386/linux64.mh
 delete mode 100644 gdb/config/i386/mingw.mh
 delete mode 100644 gdb/config/i386/mingw64.mh
 delete mode 100644 gdb/config/i386/nbsd64.mh
 delete mode 100644 gdb/config/i386/nbsdelf.mh
 delete mode 100644 gdb/config/i386/nto.mh
 delete mode 100644 gdb/config/i386/obsd.mh
 delete mode 100644 gdb/config/i386/obsd64.mh
 delete mode 100644 gdb/config/i386/sol2-64.mh
 delete mode 100644 gdb/config/ia64/linux.mh
 delete mode 100644 gdb/config/m32r/linux.mh
 delete mode 100644 gdb/config/m68k/linux.mh
 delete mode 100644 gdb/config/m68k/nbsdelf.mh
 delete mode 100644 gdb/config/m68k/obsd.mh
 delete mode 100644 gdb/config/m88k/obsd.mh
 delete mode 100644 gdb/config/mips/fbsd.mh
 delete mode 100644 gdb/config/mips/linux.mh
 delete mode 100644 gdb/config/mips/nbsd.mh
 delete mode 100644 gdb/config/mips/obsd64.mh
 delete mode 100644 gdb/config/pa/linux.mh
 delete mode 100644 gdb/config/pa/nbsd.mh
 delete mode 100644 gdb/config/pa/obsd.mh
 delete mode 100644 gdb/config/powerpc/aix.mh
 delete mode 100644 gdb/config/powerpc/fbsd.mh
 delete mode 100644 gdb/config/powerpc/linux.mh
 delete mode 100644 gdb/config/powerpc/nbsd.mh
 delete mode 100644 gdb/config/powerpc/obsd.mh
 delete mode 100644 gdb/config/powerpc/ppc64-linux.mh
 delete mode 100644 gdb/config/powerpc/spu-linux.mh
 delete mode 100644 gdb/config/s390/linux.mh
 delete mode 100644 gdb/config/sh/nbsd.mh
 delete mode 100644 gdb/config/sparc/fbsd.mh
 delete mode 100644 gdb/config/sparc/linux.mh
 delete mode 100644 gdb/config/sparc/linux64.mh
 delete mode 100644 gdb/config/sparc/nbsd64.mh
 delete mode 100644 gdb/config/sparc/nbsdelf.mh
 delete mode 100644 gdb/config/sparc/obsd64.mh
 delete mode 100644 gdb/config/sparc/sol2.mh
 delete mode 100644 gdb/config/tilegx/linux.mh
 delete mode 100644 gdb/config/vax/nbsdelf.mh
 delete mode 100644 gdb/config/vax/obsd.mh
 delete mode 100644 gdb/config/xtensa/linux.mh
 create mode 100644 gdb/configure.nat

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index b865b7c..e26079a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -903,7 +903,16 @@ ALL_TARGET_OBS = \
 	xtensa-tdep.o
 
 # Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
+NAT_FILE = @NAT_FILE@
+NATDEPFILES = @NATDEPFILES@
+NAT_CDEPS = @NAT_CDEPS@
+LOADLIBES = @LOADLIBES@
+MH_CFLAGS = @MH_CFLAGS@
+XM_CLIBS = @XM_CLIBS@
+NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
+HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
+
+@NAT_EXTRA_FRAGS_FILE@
 # End of host-dependent makefile fragment
 
 FLAGS_TO_PASS = \
@@ -2315,21 +2324,21 @@ subdir_do: force
 		else true ; fi ; \
 	done
 
-Makefile: Makefile.in config.status @frags@
+Makefile: Makefile.in config.status
 	# Regenerate the Makefile and the tm.h / nm.h links.
 	CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS= \
 	  CONFIG_HEADERS= \
 	  $(SHELL) config.status
 
-$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status @frags@
+$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
 	@cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
 	  CONFIG_LINKS= \
 	  $(SHELL) config.status
 
-data-directory/Makefile: data-directory/Makefile.in config.status @frags@
+data-directory/Makefile: data-directory/Makefile.in config.status
 	CONFIG_FILES="data-directory/Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh
deleted file mode 100644
index d184a79..0000000
--- a/gdb/config/aarch64/linux.mh
+++ /dev/null
@@ -1,29 +0,0 @@
-#  Host: AArch64 based machine running GNU/Linux
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#  Contributed by ARM Ltd.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
-	proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
-	aarch64-linux.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
deleted file mode 100644
index 4991dd2..0000000
--- a/gdb/config/alpha/alpha-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: Little-endian Alpha running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
-	fork-child.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
-
-# doublest.c currently assumes some properties of FP arithmetic
-# on the host which require this.
-MH_CFLAGS = -mieee
diff --git a/gdb/config/alpha/nbsd.mh b/gdb/config/alpha/nbsd.mh
deleted file mode 100644
index a46739e..0000000
--- a/gdb/config/alpha/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/alpha
-NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh
deleted file mode 100644
index 003ca1f..0000000
--- a/gdb/config/arm/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: ARM based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
-	aarch32-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/arm/nbsdelf.mh b/gdb/config/arm/nbsdelf.mh
deleted file mode 100644
index 042b583..0000000
--- a/gdb/config/arm/nbsdelf.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o arm-nbsd-nat.o
diff --git a/gdb/config/i386/cygwin.mh b/gdb/config/i386/cygwin.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/cygwin.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/cygwin64.mh b/gdb/config/i386/cygwin64.mh
deleted file mode 100644
index 4f70adc..0000000
--- a/gdb/config/i386/cygwin64.mh
+++ /dev/null
@@ -1,20 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
deleted file mode 100644
index 16c1558..0000000
--- a/gdb/config/i386/darwin.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: IA86 running Darwin
-
-NATDEPFILES = fork-child.o darwin-nat.o \
-     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
deleted file mode 100644
index 69e0a8b..0000000
--- a/gdb/config/i386/fbsd.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: FreeBSD/i386
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
-	i386-fbsd-nat.o bsd-kvm.o
-NAT_FILE= nm-fbsd.h
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
deleted file mode 100644
index 461ff9a..0000000
--- a/gdb/config/i386/fbsd64.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
-	bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh
deleted file mode 100644
index f1edfad..0000000
--- a/gdb/config/i386/go32.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Intel x86 running DJGPP
-
-# We include several header files from config/djgpp
-MH_CFLAGS= -I$(srcdir)/config/djgpp
-
-NATDEPFILES= go32-nat.o x86-nat.o x86-dregs.o
-
-HOST_IPC=
-XM_CLIBS= -ldbg
-
-
diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
similarity index 58%
rename from gdb/config/i386/i386gnu.mh
rename to gdb/config/i386/i386gnu-extra.mh
index 070497f..1f2d937 100644
--- a/gdb/config/i386/i386gnu.mh
+++ b/gdb/config/i386/i386gnu-extra.mh
@@ -1,21 +1,9 @@
-# Host: Intel 386 running the GNU Hurd
-NATDEPFILES= i386-gnu-nat.o gnu-nat.o \
-	     x86-nat.o x86-dregs.o fork-child.o \
-	     notify_S.o process_reply_S.o msg_reply_S.o \
-	     msg_U.o exc_request_U.o exc_request_S.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-NAT_FILE= nm-i386gnu.h
-MH_CFLAGS = -D_GNU_SOURCE
-
-XM_CLIBS = -lshouldbeinlibc
-
 # Use our own user stubs for the msg rpcs, so we can make them time out, in
 # case the program is fucked, or we guess the wrong signal thread.
-msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
+msg-MIGUFLAGS=-D'MSG_IMPORTS=waittime 1000;'
 
 # ick
-MIGCOM = $(MIG) -cc cat - /dev/null
+MIGCOM=$(MIG) -cc cat - /dev/null
 
 # Reply servers need special massaging of the code mig generates, to make
 # them work correctly for error returns in some cases.
@@ -33,9 +21,4 @@ MIGCOM = $(MIG) -cc cat - /dev/null
 	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
 
 # MIG stubs are not yet ready for C++ compilation.
-%_S.o %_U.o : COMPILE.post += -x c
-
-NAT_GENERATED_FILES = notify_S.h notify_S.c \
-	process_reply_S.h process_reply_S.c \
-	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
-	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
+%_S.o %_U.o : COMPILE.post +=-x c"
diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
deleted file mode 100644
index 787a3c1..0000000
--- a/gdb/config/i386/i386sol2.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86
-NATDEPFILES= fork-child.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
deleted file mode 100644
index 421c56f..0000000
--- a/gdb/config/i386/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Intel 386 running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
deleted file mode 100644
index 42d8df5..0000000
--- a/gdb/config/i386/linux64.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: GNU/Linux x86-64
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
-	x86-linux-nat.o \
-	linux-nat.o linux-osdata.o \
-	proc-service.o linux-thread-db.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-btrace.o \
-	linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/mingw.mh b/gdb/config/i386/mingw.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/mingw.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/mingw64.mh b/gdb/config/i386/mingw64.mh
deleted file mode 100644
index 0ee2e2c..0000000
--- a/gdb/config/i386/mingw64.mh
+++ /dev/null
@@ -1 +0,0 @@
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
deleted file mode 100644
index 91d21f3..0000000
--- a/gdb/config/i386/nbsd64.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: NetBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
deleted file mode 100644
index 5954b3f..0000000
--- a/gdb/config/i386/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/nto.mh b/gdb/config/i386/nto.mh
deleted file mode 100644
index b9e2f84..0000000
--- a/gdb/config/i386/nto.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Intel 386 running QNX.
-
-NATDEPFILES= nto-procfs.o
-NAT_FILE= config/nm-nto.h
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
deleted file mode 100644
index fac7282..0000000
--- a/gdb/config/i386/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
deleted file mode 100644
index 51deea7..0000000
--- a/gdb/config/i386/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/sol2-64.mh b/gdb/config/i386/sol2-64.mh
deleted file mode 100644
index 7a3ab73..0000000
--- a/gdb/config/i386/sol2-64.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86_64
-NATDEPFILES= fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh
deleted file mode 100644
index b05f834..0000000
--- a/gdb/config/ia64/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Intel IA-64 running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ia64-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-personality.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
deleted file mode 100644
index 277d8bd..0000000
--- a/gdb/config/m32r/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: M32R based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o				\
-	m32r-linux-nat.o proc-service.o linux-thread-db.o	\
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh
deleted file mode 100644
index 7c1f4ac..0000000
--- a/gdb/config/m68k/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Motorola m68k running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	m68k-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/nbsdelf.mh b/gdb/config/m68k/nbsdelf.mh
deleted file mode 100644
index 1d00cbc..0000000
--- a/gdb/config/m68k/nbsdelf.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/m68k ELF
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m68k/obsd.mh b/gdb/config/m68k/obsd.mh
deleted file mode 100644
index 902a24b..0000000
--- a/gdb/config/m68k/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/m68k
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m88k/obsd.mh b/gdb/config/m88k/obsd.mh
deleted file mode 100644
index 3c4d8d5..0000000
--- a/gdb/config/m88k/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/m88k
-NATDEPFILES= fork-child.o inf-ptrace.o m88k-bsd-nat.o
diff --git a/gdb/config/mips/fbsd.mh b/gdb/config/mips/fbsd.mh
deleted file mode 100644
index f433347..0000000
--- a/gdb/config/mips/fbsd.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: FreeBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh
deleted file mode 100644
index 11ff903..0000000
--- a/gdb/config/mips/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Linux/MIPS
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o \
-	mips-linux-watch.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/mips/nbsd.mh b/gdb/config/mips/nbsd.mh
deleted file mode 100644
index a80da95..0000000
--- a/gdb/config/mips/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o mips-nbsd-nat.o
diff --git a/gdb/config/mips/obsd64.mh b/gdb/config/mips/obsd64.mh
deleted file mode 100644
index 6aeac34..0000000
--- a/gdb/config/mips/obsd64.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/mips64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o
diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
deleted file mode 100644
index 1b73ecd..0000000
--- a/gdb/config/pa/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: Hewlett-Packard PA-RISC machine, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	hppa-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/pa/nbsd.mh b/gdb/config/pa/nbsd.mh
deleted file mode 100644
index 791cd9f..0000000
--- a/gdb/config/pa/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o
diff --git a/gdb/config/pa/obsd.mh b/gdb/config/pa/obsd.mh
deleted file mode 100644
index 95dd416..0000000
--- a/gdb/config/pa/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o
diff --git a/gdb/config/powerpc/aix.mh b/gdb/config/powerpc/aix.mh
deleted file mode 100644
index 141501d..0000000
--- a/gdb/config/powerpc/aix.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: IBM PowerPC running AIX
-
-# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
-NATDEPFILES= fork-child.o inf-ptrace.o rs6000-nat.o
-
-# When compiled with cc, for debugging, this argument should be passed.
-# We have no idea who our current compiler is though, so we skip it.
-# MH_CFLAGS = -bnodelcsect
diff --git a/gdb/config/powerpc/fbsd.mh b/gdb/config/powerpc/fbsd.mh
deleted file mode 100644
index 9c2e6b4..0000000
--- a/gdb/config/powerpc/fbsd.mh
+++ /dev/null
@@ -1,24 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
-
diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
deleted file mode 100644
index f4a52c3..0000000
--- a/gdb/config/powerpc/linux.mh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Host: PowerPC, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh
deleted file mode 100644
index f02a0f9..0000000
--- a/gdb/config/powerpc/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/obsd.mh b/gdb/config/powerpc/obsd.mh
deleted file mode 100644
index 3743254..0000000
--- a/gdb/config/powerpc/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
deleted file mode 100644
index 8681d00..0000000
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: PowerPC64, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o ppc-linux.o linux-personality.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/spu-linux.mh b/gdb/config/powerpc/spu-linux.mh
deleted file mode 100644
index 9205b62..0000000
--- a/gdb/config/powerpc/spu-linux.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Cell BE (PowerPC64 + SPU)
-
-# This implements a 'pseudo-native' GDB running on the
-# PPU side of the Cell BE and debugging the SPU side.
-
-NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
-	      linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	      linux-personality.o linux-namespaces.o
diff --git a/gdb/config/s390/linux.mh b/gdb/config/s390/linux.mh
deleted file mode 100644
index 4a137cd..0000000
--- a/gdb/config/s390/linux.mh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Host: S390, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sh/nbsd.mh b/gdb/config/sh/nbsd.mh
deleted file mode 100644
index 14d7e8c..0000000
--- a/gdb/config/sh/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/sh
-NATDEPFILES= fork-child.o inf-ptrace.o sh-nbsd-nat.o
diff --git a/gdb/config/sparc/fbsd.mh b/gdb/config/sparc/fbsd.mh
deleted file mode 100644
index bdc272c..0000000
--- a/gdb/config/sparc/fbsd.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
-	bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
deleted file mode 100644
index 385f640..0000000
--- a/gdb/config/sparc/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux SPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh
deleted file mode 100644
index 8df0de1..0000000
--- a/gdb/config/sparc/linux64.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux UltraSPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/nbsd64.mh b/gdb/config/sparc/nbsd64.mh
deleted file mode 100644
index aa15b1d..0000000
--- a/gdb/config/sparc/nbsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
deleted file mode 100644
index 97d07b3..0000000
--- a/gdb/config/sparc/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/obsd64.mh b/gdb/config/sparc/obsd64.mh
deleted file mode 100644
index e9f2fb9..0000000
--- a/gdb/config/sparc/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
deleted file mode 100644
index 220c61f..0000000
--- a/gdb/config/sparc/sol2.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Solaris SPARC & UltraSPARC
-NAT_FILE= nm-sol2.h
-NATDEPFILES= sparc-sol2-nat.o \
-	fork-child.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/tilegx/linux.mh b/gdb/config/tilegx/linux.mh
deleted file mode 100644
index ec648d3..0000000
--- a/gdb/config/tilegx/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Tilera TILE-Gx running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	tilegx-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/vax/nbsdelf.mh b/gdb/config/vax/nbsdelf.mh
deleted file mode 100644
index bf0f0b9..0000000
--- a/gdb/config/vax/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/vax/obsd.mh b/gdb/config/vax/obsd.mh
deleted file mode 100644
index cef99d3..0000000
--- a/gdb/config/vax/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/vax
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/xtensa/linux.mh b/gdb/config/xtensa/linux.mh
deleted file mode 100644
index d5b8f91..0000000
--- a/gdb/config/xtensa/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Xtensa, running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-
-NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/configure b/gdb/configure
index 9f05b4b..f1068ba 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -598,7 +598,13 @@ GDB_NM_FILE
 LTLIBBABELTRACE
 LIBBABELTRACE
 HAVE_LIBBABELTRACE
-frags
+NAT_GENERATED_FILES
+XM_CLIBS
+MH_CFLAGS
+LOADLIBES
+NAT_CDEPS
+NATDEPFILES
+NAT_FILE
 target_subdir
 CONFIG_UNINSTALL
 CONFIG_INSTALL
@@ -799,7 +805,7 @@ PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files='host_makefile_frag'
+ac_subst_files='NAT_EXTRA_FRAGS_FILE'
 ac_user_opts='
 enable_option_checking
 enable_maintainer_mode
@@ -16724,27 +16730,21 @@ if test "${host}" != "${target}"; then
 fi
 
 
-frags=
+# Importing nat definitions.
+NAT_EXTRA_FRAGS_FILE=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
 
 
 
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
+
+
+
+
+
 
 
 if test x"${gdb_osabi}" != x ; then
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 50f6f59..f9d8aac 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
 fi
 AC_SUBST(target_subdir)
 
-frags=
+# Importing nat definitions.
+NAT_EXTRA_FRAGS_FILE=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
-AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST(frags)
-
-changequote(,)dnl
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
-changequote([,])
+AC_SUBST(NAT_FILE)
+AC_SUBST(NATDEPFILES)
+AC_SUBST(NAT_CDEPS)
+AC_SUBST(LOADLIBES)
+AC_SUBST(MH_CFLAGS)
+AC_SUBST(XM_CLIBS)
+AC_SUBST(NAT_GENERATED_FILES)
+AC_SUBST(HAVE_NATIVE_GCORE_TARGET)
+AC_SUBST_FILE(NAT_EXTRA_FRAGS_FILE)
 
 if test x"${gdb_osabi}" != x ; then
     AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
diff --git a/gdb/configure.nat b/gdb/configure.nat
new file mode 100644
index 0000000..a634031
--- /dev/null
+++ b/gdb/configure.nat
@@ -0,0 +1,608 @@
+# ; -*- mode: sh ; -*-
+# Copyright (C) 2013-2017 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Variables defined here:
+#
+# NAT_FILE - The header file with definitions for this native target.
+#
+# NATDEPFILES - Source files required for native debugging on this
+#               native target.
+#
+# NAT_CDEPS - Dynamic symbols to be exported for libthread_db.
+#
+# LOADLIBES - Libraries against which GDB will be linked for this
+#             native target.
+#
+# MH_CFLAGS - Additional CFLAGS for this native target.
+#
+# XM_CLIBS - Host-dependent libraries against which GDB will be linked
+#            for this native target.
+#
+# NAT_GENERATED_FILES - Generated files for this native target.
+#
+# HAVE_NATIVE_GCORE_HOST - Whether gcore should be installed on this
+#                          native target.
+#
+# NAT_EXTRA_FRAGS_FILE - File containing extra fragments of Makefile
+#                        that will be used by this native target.
+#
+# Notes:
+#
+# - To avoid shell expansion of variables, declare them with single
+#   quotes.
+#
+# - NAT_EXTRA_FRAGS_FILE should contain the full path of the file.
+
+
+case ${gdb_host_cpu} in
+  aarch64)
+    case ${gdb_host} in
+      linux)
+	#  Host: AArch64 based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
+		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
+		aarch64-linux.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  alpha)
+    case ${gdb_host} in
+      alpha-linux)
+	# Host: Little-endian Alpha running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
+		fork-child.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+
+	# doublest.c currently assumes some properties of FP arithmetic
+	# on the host which require this.
+	MH_CFLAGS='-mieee'
+	;;
+      nbsd)
+	# Host: NetBSD/alpha
+	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  arm)
+    case ${gdb_host} in
+      linux)
+	# Host: ARM based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
+		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/arm
+	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  i386)
+    case ${gdb_host} in
+      cygwin64)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      cygwin)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      darwin)
+	# Host: IA86 running Darwin
+	NATDEPFILES='fork-child.o darwin-nat.o \
+	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
+	;;
+      fbsd64)
+	# Host: FreeBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
+		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      fbsd)
+	# Host: FreeBSD/i386
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
+		i386-fbsd-nat.o bsd-kvm.o'
+	NAT_FILE='nm-fbsd.h'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      go32)
+	# Host: Intel x86 running DJGPP
+
+	# We include several header files from config/djgpp
+	MH_CFLAGS='-I$(srcdir)/config/djgpp'
+
+	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+
+	XM_CLIBS='-ldbg'
+	;;
+      i386gnu)
+	# Host: Intel 386 running the GNU Hurd
+	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
+		     x86-nat.o x86-dregs.o fork-child.o \
+		     notify_S.o process_reply_S.o msg_reply_S.o \
+		     msg_U.o exc_request_U.o exc_request_S.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	NAT_FILE='nm-i386gnu.h'
+	MH_CFLAGS='-D_GNU_SOURCE'
+
+	XM_CLIBS='-lshouldbeinlibc'
+
+	NAT_EXTRA_FRAGS_FILE="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+
+	NAT_GENERATED_FILES='notify_S.h notify_S.c \
+		process_reply_S.h process_reply_S.c \
+		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
+		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c'
+	;;
+      i386sol2)
+	# Host: Solaris x86
+	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux64)
+	# Host: GNU/Linux x86-64
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
+		x86-linux-nat.o \
+		linux-nat.o linux-osdata.o \
+		proc-service.o linux-thread-db.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-btrace.o \
+		linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
+	NAT_FILE='config/nm-linux.h'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: Intel 386 running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      mingw64)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      mingw)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      nbsd64)
+	# Host: NetBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
+	;;
+      nbsdelf)
+	# Host: NetBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nto)
+	# Host: Intel 386 running QNX.
+	NATDEPFILES='nto-procfs.o'
+	NAT_FILE='config/nm-nto.h'
+	;;
+      obsd64)
+	# Host: OpenBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2-64)
+	# Host: Solaris x86_64
+	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  ia64)
+    case ${gdb_host} in
+      linux)
+	# Host: Intel IA-64 running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ia64-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-personality.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m32r)
+    case ${gdb_host} in
+      linux)
+	# Host: M32R based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o				\
+		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m68k)
+    case ${gdb_host} in
+      linux)
+	# Host: Motorola m68k running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		m68k-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/m68k ELF
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/m68k
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  m88k)
+    case ${gdb_host} in
+      obsd)
+	# Host: OpenBSD/m88k
+	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
+	;;
+    esac
+    ;;
+  mips)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux)
+	# Host: Linux/MIPS
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o \
+		mips-linux-watch.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
+	;;
+      obsd64)
+	# Host: OpenBSD/mips64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
+	;;
+    esac
+    ;;
+  pa)
+    case ${gdb_host} in
+      linux)
+	# Host: Hewlett-Packard PA-RISC machine, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		hppa-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
+	;;
+      obsd)
+	# Host: OpenBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
+	;;
+    esac
+    ;;
+  powerpc)
+    case ${gdb_host} in
+      aix)
+	# Host: IBM PowerPC running AIX
+	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
+	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+
+	# When compiled with cc, for debugging, this argument should be passed.
+	# We have no idea who our current compiler is though, so we skip it.
+	# MH_CFLAGS='-bnodelcsect'
+	;;
+      fbsd)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux)
+	# Host: PowerPC, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      ppc64-linux)
+	# Host: PowerPC64, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o ppc-linux.o linux-personality.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      spu-linux)
+	# Target: Cell BE (PowerPC64 + SPU)
+	# This implements a 'pseudo-native' GDB running on the
+	# PPU side of the Cell BE and debugging the SPU side.
+
+	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
+		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		      linux-personality.o linux-namespaces.o'
+	;;
+    esac
+    ;;
+  s390)
+    case ${gdb_host} in
+      linux)
+	# Host: S390, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  sh)
+    case ${gdb_host} in
+      nbsd)
+	# Host: NetBSD/sh
+	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  sparc)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
+		bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux64)
+	# Host: GNU/Linux UltraSPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: GNU/Linux SPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd64)
+	# Host: NetBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nbsdelf)
+	# Host: NetBSD/sparc ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd64)
+	# Host: OpenBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2)
+	# Host: Solaris SPARC & UltraSPARC
+	NAT_FILE='nm-sol2.h'
+	NATDEPFILES='sparc-sol2-nat.o \
+		fork-child.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  tilegx)
+    case ${gdb_host} in
+      linux)
+	# Host: Tilera TILE-Gx running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		tilegx-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  vax)
+    case ${gdb_host} in
+      nbsdelf)
+	# Host: NetBSD/vax ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/vax
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  xtensa)
+    case ${gdb_host} in
+      linux)
+	# Host: Xtensa, running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+
+	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+esac
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 5a58fa7..e0e50c1 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -178,9 +178,6 @@ MAN1S = gdb.1 gdbserver.1 gcore.1
 MAN5S = gdbinit.5
 MANS = $(MAN1S) $(MAN5S)
 
-# Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
-# End of host-dependent makefile fragment
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
 ###
-- 
2.9.3

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
@ 2017-05-03 16:45     ` John Baldwin
  2017-05-03 17:28       ` Sergio Durigan Junior
  2017-05-04 16:34     ` Pedro Alves
  1 sibling, 1 reply; 30+ messages in thread
From: John Baldwin @ 2017-05-03 16:45 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Pedro Alves, Simon Marchi

On Tuesday, May 02, 2017 11:49:31 PM Sergio Durigan Junior wrote:
> The previous commit introduced gdb/configure.nat, but it was just a
> copy-and-past (with the necessary adjustments) from the files under
> gdb/config/.  We can do better than that.
> 
> Instead of using one big 'case' statement that matches the
> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
> remove a lof of redundancy by matching the most common ${gdb_host}'s
> first, setting the common variables for each, and then proceed to
> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
> words, reverse the order of the 'case's and take advantage of the fact
> that a lot of parameters are the same for each host.
> 
> This commit was tested on x86_64 without regressions.

Thanks.  Just one minor nit that I see:
 
> +    fbsd)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: FreeBSD/i386
> +		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
> +		x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
> +		NAT_FILE='nm-fbsd.h'
> +		;;
> +	    mips)
> +		# Host: FreeBSD/mips
> +		NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
> +		HAVE_NATIVE_GCORE_HOST=1

This seems redundant as it is set in the "global" fbsd section?

> +		LOADLIBES=
> +		;;

-- 
John Baldwin

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-03 16:45     ` John Baldwin
@ 2017-05-03 17:28       ` Sergio Durigan Junior
  0 siblings, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-03 17:28 UTC (permalink / raw)
  To: John Baldwin; +Cc: GDB Patches, Pedro Alves, Simon Marchi

On Wednesday, May 03 2017, John Baldwin wrote:

> On Tuesday, May 02, 2017 11:49:31 PM Sergio Durigan Junior wrote:
>> The previous commit introduced gdb/configure.nat, but it was just a
>> copy-and-past (with the necessary adjustments) from the files under
>> gdb/config/.  We can do better than that.
>> 
>> Instead of using one big 'case' statement that matches the
>> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
>> remove a lof of redundancy by matching the most common ${gdb_host}'s
>> first, setting the common variables for each, and then proceed to
>> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
>> words, reverse the order of the 'case's and take advantage of the fact
>> that a lot of parameters are the same for each host.
>> 
>> This commit was tested on x86_64 without regressions.
>
> Thanks.  Just one minor nit that I see:
>  
>> +    fbsd)
>> +	case ${gdb_host_cpu} in
>> +	    i386)
>> +		# Host: FreeBSD/i386
>> +		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
>> +		x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
>> +		NAT_FILE='nm-fbsd.h'
>> +		;;
>> +	    mips)
>> +		# Host: FreeBSD/mips
>> +		NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
>> +		HAVE_NATIVE_GCORE_HOST=1
>
> This seems redundant as it is set in the "global" fbsd section?

You're right, John.  Fixed in my local tree.

Thanks for the review,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-03  3:49   ` [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
@ 2017-05-04 16:16     ` Pedro Alves
  2017-05-05  3:58       ` Sergio Durigan Junior
  0 siblings, 1 reply; 30+ messages in thread
From: Pedro Alves @ 2017-05-04 16:16 UTC (permalink / raw)
  To: Sergio Durigan Junior, GDB Patches; +Cc: Simon Marchi, John Baldwin

On 05/03/2017 04:49 AM, Sergio Durigan Junior wrote:

> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index b865b7c..e26079a 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -903,7 +903,16 @@ ALL_TARGET_OBS = \
>  	xtensa-tdep.o
>  
>  # Host-dependent makefile fragment comes in here.

Stale comment.  Should say something about the variables being
defined in configure.nat.

> -@host_makefile_frag@
> +NAT_FILE = @NAT_FILE@
> +NATDEPFILES = @NATDEPFILES@
> +NAT_CDEPS = @NAT_CDEPS@
> +LOADLIBES = @LOADLIBES@
> +MH_CFLAGS = @MH_CFLAGS@
> +XM_CLIBS = @XM_CLIBS@
> +NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
> +HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
> +
> +@NAT_EXTRA_FRAGS_FILE@

And this last line here is where we source the
fragment, so that comment above should move here
with s/Host/Native-target/

I think it should be "FRAG", singular.
"makefile fragment file" is the term most often used.

Also, I think "host_makefile_frag" was lowercase because
that variable is not meant to be passed to make or any
tool make invokes.

>  # End of host-dependent makefile fragment

Likewise, mind the comments.

>  

> -#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
> -#

> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
> similarity index 58%
> rename from gdb/config/i386/i386gnu.mh
> rename to gdb/config/i386/i386gnu-extra.mh

Why the "extra" rename ?  If anything, I'd expect i386gnu.mh -> i386gnu.mn?

>  # Use our own user stubs for the msg rpcs, so we can make them time out, in
>  # case the program is fucked, or we guess the wrong signal thread.
> -msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
> +msg-MIGUFLAGS=-D'MSG_IMPORTS=waittime 1000;'
>  
>  # ick
> -MIGCOM = $(MIG) -cc cat - /dev/null
> +MIGCOM=$(MIG) -cc cat - /dev/null

Simon recently went through all variables making sure
there's a space around the "=".  This goes in the other
direction.

>  
>  # Reply servers need special massaging of the code mig generates, to make
>  # them work correctly for error returns in some cases.
> @@ -33,9 +21,4 @@ MIGCOM = $(MIG) -cc cat - /dev/null
>  	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
>  
>  # MIG stubs are not yet ready for C++ compilation.
> -%_S.o %_U.o : COMPILE.post += -x c
> -
> -NAT_GENERATED_FILES = notify_S.h notify_S.c \
> -	process_reply_S.h process_reply_S.c \
> -	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
> -	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
> +%_S.o %_U.o : COMPILE.post +=-x c"

Was that quote char (") at the end added on purpose?
Looks like a typo.

Since most of the MIG related bits are left in the makefile
fragment, I wonder whether it really makes sense to move
the NAT_GENERATED_FILES setting far away from them.

> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 50f6f59..f9d8aac 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
>  fi
>  AC_SUBST(target_subdir)
>  
> -frags=
> +# Importing nat definitions.

s/Importing/Import/

> +NAT_EXTRA_FRAGS_FILE=/dev/null
>  if test "${gdb_native}" = "yes"; then
> -  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
> -  if test ! -f ${host_makefile_frag}; then
> -    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
> -  fi
> -  frags="$frags $host_makefile_frag"
> -else
> -  host_makefile_frag=/dev/null
> +  . ${srcdir}/configure.nat
> +  nativefile=$NAT_FILE
>  fi

There's (at least) a related comment that would be good
to update:

 # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
 # to an empty version.

as NAT_FILE now comes from configure.nat, not the .mh files.


> +# Variables defined here:
> +#
> +# NAT_FILE - The header file with definitions for this native target.
> +#
> +# NATDEPFILES - Source files required for native debugging on this
> +#               native target.
> +#
> +# NAT_CDEPS - Dynamic symbols to be exported for libthread_db.
> +#
> +# LOADLIBES - Libraries against which GDB will be linked for this
> +#             native target.
> +#
> +# MH_CFLAGS - Additional CFLAGS for this native target.

At least MH_CFLAGS above is host-specific, not related to the
native target.  See for example:

 # doublest.c currently assumes some properties of FP arithmetic
 # on the host which require this.
 MH_CFLAGS = -mieee

 # When compiled with cc, for debugging, this argument should be passed.
 # We have no idea who our current compiler is though, so we skip it.
 # MH_CFLAGS = -bnodelcsect

These are clearly always needed to build gdb on this host,
independently of whether native target is being built.  I.e.,
when gdb is being built as a cross debugger, with
--target=something-else-not-the-host.  Hence the MH_ prefix.

Some of those variables are ripe for a rename / normalization,
but that's something that can always be done after, and will
actually be simpler with your patchset in.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
  2017-05-03 16:45     ` John Baldwin
@ 2017-05-04 16:34     ` Pedro Alves
  2017-05-05  4:23       ` Sergio Durigan Junior
  1 sibling, 1 reply; 30+ messages in thread
From: Pedro Alves @ 2017-05-04 16:34 UTC (permalink / raw)
  To: Sergio Durigan Junior, GDB Patches; +Cc: Simon Marchi, John Baldwin

On 05/03/2017 04:49 AM, Sergio Durigan Junior wrote:
> The previous commit introduced gdb/configure.nat, but it was just a
> copy-and-past (with the necessary adjustments) from the files under
> gdb/config/.  We can do better than that.
> 
> Instead of using one big 'case' statement that matches the
> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
> remove a lof of redundancy by matching the most common ${gdb_host}'s
> first, setting the common variables for each, and then proceed to
> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
> words, reverse the order of the 'case's and take advantage of the fact
> that a lot of parameters are the same for each host.
> 
> This commit was tested on x86_64 without regressions.
> 
> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
> 
> 	* configure.nat: Rearrange 'case' statements to make the code
>           simpler and less redundant.

Should probably say instead:

	* configure.nat: Rearrange 'case' statements to match
	host before cpu.

This one's OK with that and with the nit John pointed out fixed.

Please make sure that a build that _doesn't_ include the
native target still builds before pushing.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-04 16:16     ` Pedro Alves
@ 2017-05-05  3:58       ` Sergio Durigan Junior
  2017-05-05  9:41         ` Pedro Alves
  0 siblings, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-05  3:58 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches, Simon Marchi, John Baldwin

Thanks for the review, Pedro.

I am assuming that the issues pointed here should be addressed before I
push the patch 2/2.  I'm sending a v3 of the patch just to make sure
everything is addressed properly.

On Thursday, May 04 2017, Pedro Alves wrote:

> On 05/03/2017 04:49 AM, Sergio Durigan Junior wrote:
>
>> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
>> index b865b7c..e26079a 100644
>> --- a/gdb/Makefile.in
>> +++ b/gdb/Makefile.in
>> @@ -903,7 +903,16 @@ ALL_TARGET_OBS = \
>>  	xtensa-tdep.o
>>  
>>  # Host-dependent makefile fragment comes in here.
>
> Stale comment.  Should say something about the variables being
> defined in configure.nat.

Fixed.

>> -@host_makefile_frag@
>> +NAT_FILE = @NAT_FILE@
>> +NATDEPFILES = @NATDEPFILES@
>> +NAT_CDEPS = @NAT_CDEPS@
>> +LOADLIBES = @LOADLIBES@
>> +MH_CFLAGS = @MH_CFLAGS@
>> +XM_CLIBS = @XM_CLIBS@
>> +NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
>> +HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
>> +
>> +@NAT_EXTRA_FRAGS_FILE@
>
> And this last line here is where we source the
> fragment, so that comment above should move here
> with s/Host/Native-target/

Done.

> I think it should be "FRAG", singular.
> "makefile fragment file" is the term most often used.

OK.

> Also, I think "host_makefile_frag" was lowercase because
> that variable is not meant to be passed to make or any
> tool make invokes.

I was naming everything using uppercase because I thought it would be
more consistent.  But since you asked, I renamed the variable
"nat_extra_makefile_frag".

>>  # End of host-dependent makefile fragment
>
> Likewise, mind the comments.

Fixed.

>>  
>
>> -#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
>> -#
>
>> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
>> similarity index 58%
>> rename from gdb/config/i386/i386gnu.mh
>> rename to gdb/config/i386/i386gnu-extra.mh
>
> Why the "extra" rename ?  If anything, I'd expect i386gnu.mh -> i386gnu.mn?

git showed this as a rename, but it's really a new file.  i386gnu.mh is
gone, like every other previous *.mh file.  Instead of using the old
name, I decided to add the "-extra" suffix to make it explicit that the
file contains only extra definitions, and is not the only thing taken
into account for this native target.

I initially disagree with your proposal to rename it to i386gnu.mn, so
I'm keeping it this way.  Please let me know if you really thing the
"-extra" suffix shouldn't be there, and I can remove it.

>>  # Use our own user stubs for the msg rpcs, so we can make them time out, in
>>  # case the program is fucked, or we guess the wrong signal thread.
>> -msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
>> +msg-MIGUFLAGS=-D'MSG_IMPORTS=waittime 1000;'
>>  
>>  # ick
>> -MIGCOM = $(MIG) -cc cat - /dev/null
>> +MIGCOM=$(MIG) -cc cat - /dev/null
>
> Simon recently went through all variables making sure
> there's a space around the "=".  This goes in the other
> direction.

You're right.  I think this comes from an older version of the patch in
which I was trying to define these as shell variables on configure.nat.
Sorry about that, fixed in the new version.

>>  
>>  # Reply servers need special massaging of the code mig generates, to make
>>  # them work correctly for error returns in some cases.
>> @@ -33,9 +21,4 @@ MIGCOM = $(MIG) -cc cat - /dev/null
>>  	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
>>  
>>  # MIG stubs are not yet ready for C++ compilation.
>> -%_S.o %_U.o : COMPILE.post += -x c
>> -
>> -NAT_GENERATED_FILES = notify_S.h notify_S.c \
>> -	process_reply_S.h process_reply_S.c \
>> -	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
>> -	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
>> +%_S.o %_U.o : COMPILE.post +=-x c"
>
> Was that quote char (") at the end added on purpose?
> Looks like a typo.

It is a typo.  Same explanation as above.  Sorry.  Fixed.

> Since most of the MIG related bits are left in the makefile
> fragment, I wonder whether it really makes sense to move
> the NAT_GENERATED_FILES setting far away from them.

Good point, I hadn't thought of that.  I moved NAT_GENERATED_FILES to
i386gnu-extra.mh and removed it from configure.nat.

>> diff --git a/gdb/configure.ac b/gdb/configure.ac
>> index 50f6f59..f9d8aac 100644
>> --- a/gdb/configure.ac
>> +++ b/gdb/configure.ac
>> @@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
>>  fi
>>  AC_SUBST(target_subdir)
>>  
>> -frags=
>> +# Importing nat definitions.
>
> s/Importing/Import/

Fixed.

>> +NAT_EXTRA_FRAGS_FILE=/dev/null
>>  if test "${gdb_native}" = "yes"; then
>> -  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
>> -  if test ! -f ${host_makefile_frag}; then
>> -    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
>> -  fi
>> -  frags="$frags $host_makefile_frag"
>> -else
>> -  host_makefile_frag=/dev/null
>> +  . ${srcdir}/configure.nat
>> +  nativefile=$NAT_FILE
>>  fi
>
> There's (at least) a related comment that would be good
> to update:
>
>  # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
>  # to an empty version.
>
> as NAT_FILE now comes from configure.nat, not the .mh files.

Updated.

>> +# Variables defined here:
>> +#
>> +# NAT_FILE - The header file with definitions for this native target.
>> +#
>> +# NATDEPFILES - Source files required for native debugging on this
>> +#               native target.
>> +#
>> +# NAT_CDEPS - Dynamic symbols to be exported for libthread_db.
>> +#
>> +# LOADLIBES - Libraries against which GDB will be linked for this
>> +#             native target.
>> +#
>> +# MH_CFLAGS - Additional CFLAGS for this native target.
>
> At least MH_CFLAGS above is host-specific, not related to the
> native target.  See for example:
>
>  # doublest.c currently assumes some properties of FP arithmetic
>  # on the host which require this.
>  MH_CFLAGS = -mieee
>
>  # When compiled with cc, for debugging, this argument should be passed.
>  # We have no idea who our current compiler is though, so we skip it.
>  # MH_CFLAGS = -bnodelcsect
>
> These are clearly always needed to build gdb on this host,
> independently of whether native target is being built.  I.e.,
> when gdb is being built as a cross debugger, with
> --target=something-else-not-the-host.  Hence the MH_ prefix.

Hm, OK, thanks for the explanation.  I updated the description to say
that the variable is host-specific.

> Some of those variables are ripe for a rename / normalization,
> but that's something that can always be done after, and will
> actually be simpler with your patchset in.

Absolutely.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-04 16:34     ` Pedro Alves
@ 2017-05-05  4:23       ` Sergio Durigan Junior
  0 siblings, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-05  4:23 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches, Simon Marchi, John Baldwin

On Thursday, May 04 2017, Pedro Alves wrote:

> On 05/03/2017 04:49 AM, Sergio Durigan Junior wrote:
>> The previous commit introduced gdb/configure.nat, but it was just a
>> copy-and-past (with the necessary adjustments) from the files under
>> gdb/config/.  We can do better than that.
>> 
>> Instead of using one big 'case' statement that matches the
>> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
>> remove a lof of redundancy by matching the most common ${gdb_host}'s
>> first, setting the common variables for each, and then proceed to
>> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
>> words, reverse the order of the 'case's and take advantage of the fact
>> that a lot of parameters are the same for each host.
>> 
>> This commit was tested on x86_64 without regressions.
>> 
>> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
>> 
>> 	* configure.nat: Rearrange 'case' statements to make the code
>>           simpler and less redundant.
>
> Should probably say instead:
>
> 	* configure.nat: Rearrange 'case' statements to match
> 	host before cpu.
>
> This one's OK with that and with the nit John pointed out fixed.

Thanks, I updated the ChangeLog entry accordingly.

> Please make sure that a build that _doesn't_ include the
> native target still builds before pushing.

Tested compiling with --enable-targets=aarch64-unknown-linux and it
worked as expected.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
@ 2017-05-05  4:31   ` Sergio Durigan Junior
  2017-05-06 14:13     ` Sergio Durigan Junior
  2017-05-05  4:32   ` [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
  1 sibling, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-05  4:31 UTC (permalink / raw)
  To: GDB Patches
  Cc: Pedro Alves, Simon Marchi, John Baldwin, Sergio Durigan Junior

The previous commit introduced gdb/configure.nat, but it was just a
copy-and-past (with the necessary adjustments) from the files under
gdb/config/.  We can do better than that.

Instead of using one big 'case' statement that matches the
${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
remove a lof of redundancy by matching the most common ${gdb_host}'s
first, setting the common variables for each, and then proceed to
matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
words, reverse the order of the 'case's and take advantage of the fact
that a lot of parameters are the same for each host.

This commit was tested on x86_64 without regressions.

gdb/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

 	* configure.nat: Rearrange 'case' statements to match
	host before cpu.
---
 gdb/configure.nat | 938 ++++++++++++++++++++++++------------------------------
 1 file changed, 410 insertions(+), 528 deletions(-)

diff --git a/gdb/configure.nat b/gdb/configure.nat
index c0ac811..6c135d0 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -48,555 +48,437 @@
 # - nat_extra_makefile_frag should contain the full path of the file.
 
 
-case ${gdb_host_cpu} in
-  aarch64)
-    case ${gdb_host} in
-      linux)
-	#  Host: AArch64 based machine running GNU/Linux
+# This first case is useful for filling default values for each
+# gdb_host.
+case ${gdb_host} in
+    *linux*)
 	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
-		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
-		aarch64-linux.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  alpha)
-    case ${gdb_host} in
-      alpha-linux)
-	# Host: Little-endian Alpha running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
-		fork-child.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NATDEPFILES='inf-ptrace.o fork-child.o proc-service.o \
+		linux-thread-db.o linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
 	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
 	LOADLIBES='-ldl $(RDYNAMIC)'
-
-	# doublest.c currently assumes some properties of FP arithmetic
-	# on the host which require this.
-	MH_CFLAGS='-mieee'
 	;;
-      nbsd)
-	# Host: NetBSD/alpha
-	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
-
+    fbsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
 	LOADLIBES='-lkvm'
 	;;
-    esac
-    ;;
-  arm)
-    case ${gdb_host} in
-      linux)
-	# Host: ARM based machine running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
-		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
+    nbsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o'
 	;;
-      nbsdelf)
-	# Host: NetBSD/arm
-	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
+    obsd*)
+	NATDEPFILES='fork-child.o inf-ptrace.o'
 	;;
-    esac
-    ;;
-  i386)
-    case ${gdb_host} in
-      cygwin64)
-	#  Native config information for GDB on PowerPC systems running FreeBSD.
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+    cygwin*)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
 	;;
-      cygwin)
-	MH_CFLAGS=
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
-	XM_CLIBS=
+    mingw*)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
 	;;
-      darwin)
-	# Host: IA86 running Darwin
-	NATDEPFILES='fork-child.o darwin-nat.o \
-	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
-	;;
-      fbsd64)
-	# Host: FreeBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
-		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      fbsd)
-	# Host: FreeBSD/i386
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
-		i386-fbsd-nat.o bsd-kvm.o'
-	NAT_FILE='nm-fbsd.h'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      go32)
-	# Host: Intel x86 running DJGPP
-
-	# We include several header files from config/djgpp
-	MH_CFLAGS='-I$(srcdir)/config/djgpp'
-
-	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+esac
 
-	XM_CLIBS='-ldbg'
-	;;
-      i386gnu)
-	# Host: Intel 386 running the GNU Hurd
-	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
+# This is where we actually filter by host and host CPU.
+case ${gdb_host} in
+    aix)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Host: IBM PowerPC running AIX aix-thread.o is not
+		# listed in NATDEPFILES as it is pulled in by
+		# configure.
+		NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+
+		# When compiled with cc, for debugging, this argument
+		# should be passed.  We have no idea who our current
+		# compiler is though, so we skip it.
+		# MH_CFLAGS='-bnodelcsect'
+		;;
+	esac
+	;;
+    alpha-linux)
+	case ${gdb_host_cpu} in
+	    alpha)
+		# Host: Little-endian Alpha running Linux
+		NATDEPFILES="${NATDEPFILES} alpha-linux-nat.o"
+		# doublest.c currently assumes some properties of FP arithmetic
+		# on the host which require this.
+		MH_CFLAGS='-mieee'
+		;;
+	esac
+	;;
+    cygwin)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Native config information for GDB on i386
+		# systems running Cygwin.
+		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+		;;
+	esac
+	;;
+    cygwin64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Native config information for GDB on amd64
+		# systems running Cygwin.
+		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
+		;;
+	esac
+	;;
+    darwin)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: IA86 running Darwin
+		NATDEPFILES='fork-child.o darwin-nat.o \
+		i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o \
+		darwin-nat-info.o'
+		;;
+	esac
+	;;
+    fbsd)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: FreeBSD/i386
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
+		NAT_FILE='nm-fbsd.h'
+		;;
+	    mips)
+		# Host: FreeBSD/mips
+		NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
+		LOADLIBES=
+		;;
+	    powerpc)
+		# Native config information for GDB on PowerPC
+		# systems running FreeBSD.
+		NATDEPFILES="${NATDEPFILES} ppc-fbsd-nat.o bsd-kvm.o"
+		;;
+	    sparc)
+		# Host: FreeBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
+		sparc64-fbsd-nat.o bsd-kvm.o"
+		;;
+	esac
+	;;
+    fbsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: FreeBSD/amd64
+		NATDEPFILES="${NATDEPFILES} amd64-nat.o amd64-bsd-nat.o \
+		amd64-fbsd-nat.o bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o"
+		;;
+	esac
+	;;
+    go32)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel x86 running DJGPP
+		# We include several header files from config/djgpp
+		MH_CFLAGS='-I$(srcdir)/config/djgpp'
+		NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+		XM_CLIBS='-ldbg'
+		;;
+	esac
+	;;
+    i386gnu)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel 386 running the GNU Hurd
+		NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
 		     x86-nat.o x86-dregs.o fork-child.o \
 		     notify_S.o process_reply_S.o msg_reply_S.o \
 		     msg_U.o exc_request_U.o exc_request_S.o'
-	HAVE_NATIVE_GCORE_HOST=1
+		HAVE_NATIVE_GCORE_HOST=1
 
-	NAT_FILE='nm-i386gnu.h'
-	MH_CFLAGS='-D_GNU_SOURCE'
+		NAT_FILE='nm-i386gnu.h'
+		MH_CFLAGS='-D_GNU_SOURCE'
 
-	XM_CLIBS='-lshouldbeinlibc'
+		XM_CLIBS='-lshouldbeinlibc'
 
-	nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+		nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+		;;
+	esac
 	;;
-      i386sol2)
-	# Host: Solaris x86
-	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+    i386sol2)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Solaris x86
+		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
 		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-      linux64)
-	# Host: GNU/Linux x86-64
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
-		x86-linux-nat.o \
-		linux-nat.o linux-osdata.o \
-		proc-service.o linux-thread-db.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-btrace.o \
-		linux-waitpid.o linux-personality.o x86-linux.o \
-		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
-	NAT_FILE='config/nm-linux.h'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      linux)
-	# Host: Intel 386 running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
-		x86-linux-dregs.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      mingw64)
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
-	;;
-      mingw)
-	MH_CFLAGS=
-	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
-	XM_CLIBS=
-	;;
-      nbsd64)
-	# Host: NetBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
-	;;
-      nbsdelf)
-	# Host: NetBSD/i386 ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      nto)
-	# Host: Intel 386 running QNX.
-	NATDEPFILES='nto-procfs.o'
-	NAT_FILE='config/nm-nto.h'
-	;;
-      obsd64)
-	# Host: OpenBSD/amd64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/i386 ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      sol2-64)
-	# Host: Solaris x86_64
-	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    linux)
+	case ${gdb_host_cpu} in
+	    aarch64)
+		#  Host: AArch64 based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} aarch64-linux-nat.o \
+		aarch32-linux-nat.o aarch64-linux-hw-point.o aarch64-linux.o"
+		;;
+	    arm)
+		# Host: ARM based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \
+		aarch32-linux-nat.o"
+		;;
+	    i386)
+		# Host: Intel 386 running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
+		x86-linux.o x86-linux-dregs.o"
+		;;
+	    ia64)
+		# Host: Intel IA-64 running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} ia64-linux-nat.o"
+		;;
+	    m32r)
+		# Host: M32R based machine running GNU/Linux
+		NATDEPFILES="${NATDEPFILES} m32r-linux-nat.o"
+		;;
+	    m68k)
+		# Host: Motorola m68k running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o"
+		;;
+	    mips)
+		# Host: Linux/MIPS
+		NATDEPFILES="${NATDEPFILES} mips-linux-nat.o \
+		mips-linux-watch.o"
+		;;
+	    pa)
+		# Host: Hewlett-Packard PA-RISC machine, running Linux
+		NATDEPFILES="${NATDEPFILES} hppa-linux-nat.o"
+		;;
+	    powerpc)
+		# Host: PowerPC, running Linux
+		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o"
+		;;
+	    s390)
+		# Host: S390, running Linux
+		NATDEPFILES="${NATDEPFILES} s390-linux-nat.o"
+		;;
+	    sparc)
+		# Host: GNU/Linux SPARC
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-linux-nat.o"
+		;;
+	    tilegx)
+		# Host: Tilera TILE-Gx running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} tilegx-linux-nat.o"
+		NAT_CDEPS=
+		;;
+	    xtensa)
+		# Host: Xtensa, running GNU/Linux.
+		NATDEPFILES="${NATDEPFILES} xtensa-linux-nat.o"
+		;;
+	esac
+	;;
+    linux64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: GNU/Linux x86-64
+		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+		amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
+		x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
+		;;
+	    sparc)
+		# Host: GNU/Linux UltraSPARC
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
+		sparc64-linux-nat.o"
+		;;
+	esac
+	;;
+    mingw)
+	case ${gdb_host_cpu} in
+	    i386)
+		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+		;;
+	esac
+	;;
+    mingw64)
+	case ${gdb_host_cpu} in
+	    i386)
+		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
+		;;
+	esac
+	;;
+    nbsd)
+	case ${gdb_host_cpu} in
+	    alpha)
+		# Host: NetBSD/alpha
+		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    mips)
+		# Host: NetBSD/mips
+		NATDEPFILES="${NATDEPFILES} mips-nbsd-nat.o"
+		;;
+	    pa)
+		# Host: NetBSD/hppa
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o hppa-nbsd-nat.o"
+		;;
+	    powerpc)
+		# Host: NetBSD/powerpc
+		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    sh)
+		# Host: NetBSD/sh
+		NATDEPFILES="${NATDEPFILES} sh-nbsd-nat.o"
+		;;
+
+	esac
+	;;
+    nbsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: NetBSD/amd64
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o \
+		x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o"
+		;;
+	    sparc)
+		# Host: NetBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o \
+		bsd-kvm.o"
+		;;
+
+	esac
+	;;
+    nbdself)
+	case ${gdb_host_cpu} in
+	    arm)
+		# Host: NetBSD/arm
+		NATDEPFILES="${NATDEPFILES} arm-nbsd-nat.o"
+		;;
+	    i386)
+		# Host: NetBSD/i386 ELF
+		NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-bsd-nat.o \
+		i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m68k)
+		# Host: NetBSD/m68k ELF
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    sparc)
+		# Host: NetBSD/sparc ELF
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o \
+		bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    vax)
+		# Host: NetBSD/vax ELF
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+
+	esac
+	;;
+    nto)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Intel 386 running QNX.
+		NATDEPFILES='nto-procfs.o'
+		NAT_FILE='config/nm-nto.h'
+		;;
+	esac
+	;;
+    obsd)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: OpenBSD/i386 ELF
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o x86-bsd-nat.o \
+		i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m68k)
+		# Host: OpenBSD/m68k
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    m88k)
+		# Host: OpenBSD/m88k
+		NATDEPFILES="${NATDEPFILES} m88k-bsd-nat.o"
+		;;
+	    pa)
+		# Host: OpenBSD/hppa
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o hppa-obsd-nat.o"
+		;;
+	    powerpc)
+		# Host: OpenBSD/powerpc
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o ppc-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    vax)
+		# Host: OpenBSD/vax
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	esac
+	;;
+    obsd64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: OpenBSD/amd64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o \
+		x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	    mips)
+		# Host: OpenBSD/mips64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o mips64-obsd-nat.o"
+		;;
+	    sparc)
+		# Host: OpenBSD/sparc64
+		NATDEPFILES="${NATDEPFILES} obsd-nat.o sparc64-obsd-nat.o \
+		sparc-nat.o bsd-kvm.o"
+		LOADLIBES='-lkvm'
+		;;
+	esac
+	;;
+    ppc64-linux)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Host: PowerPC64, running Linux
+		XM_CLIBS=
+		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o ppc-linux.o"
+		;;
+	esac
+	;;
+    sol2)
+	case ${gdb_host_cpu} in
+	    sparc)
+		# Host: Solaris SPARC & UltraSPARC
+		NAT_FILE='nm-sol2.h'
+		NATDEPFILES='sparc-sol2-nat.o \
+		fork-child.o \
 		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-    esac
-    ;;
-  ia64)
-    case ${gdb_host} in
-      linux)
-	# Host: Intel IA-64 running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ia64-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-personality.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  m32r)
-    case ${gdb_host} in
-      linux)
-	# Host: M32R based machine running GNU/Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o				\
-		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  m68k)
-    case ${gdb_host} in
-      linux)
-	# Host: Motorola m68k running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		m68k-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-personality.o \
-		linux-waitpid.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsdelf)
-	# Host: NetBSD/m68k ELF
-	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/m68k
-	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
-
-	LOADLIBES='-lkvm'
-	;;
-    esac
-    ;;
-  m88k)
-    case ${gdb_host} in
-      obsd)
-	# Host: OpenBSD/m88k
-	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
-	;;
-    esac
-    ;;
-  mips)
-    case ${gdb_host} in
-      fbsd)
-	# Host: FreeBSD/mips
-	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-      linux)
-	# Host: Linux/MIPS
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o \
-		mips-linux-watch.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/mips
-	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
-	;;
-      obsd64)
-	# Host: OpenBSD/mips64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
-	;;
-    esac
-    ;;
-  pa)
-    case ${gdb_host} in
-      linux)
-	# Host: Hewlett-Packard PA-RISC machine, running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		hppa-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/hppa
-	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
-	;;
-      obsd)
-	# Host: OpenBSD/hppa
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
-	;;
-    esac
-    ;;
-  powerpc)
-    case ${gdb_host} in
-      aix)
-	# Host: IBM PowerPC running AIX
-	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
-	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
-
-	# When compiled with cc, for debugging, this argument should be passed.
-	# We have no idea who our current compiler is though, so we skip it.
-	# MH_CFLAGS='-bnodelcsect'
-	;;
-      fbsd)
-	#  Native config information for GDB on PowerPC systems running FreeBSD.
-	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      linux)
-	# Host: PowerPC, running Linux
-	XM_CLIBS=
-
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ppc-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd)
-	# Host: NetBSD/powerpc
-	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/powerpc
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      ppc64-linux)
-	# Host: PowerPC64, running Linux
-	XM_CLIBS=
-
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		ppc-linux-nat.o proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o ppc-linux.o linux-personality.o \
-		linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      spu-linux)
-	# Target: Cell BE (PowerPC64 + SPU)
-	# This implements a 'pseudo-native' GDB running on the
-	# PPU side of the Cell BE and debugging the SPU side.
-
-	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    sol2-64)
+	case ${gdb_host_cpu} in
+	    i386)
+		# Host: Solaris x86_64
+		NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+		HAVE_NATIVE_GCORE_HOST=1
+		;;
+	esac
+	;;
+    spu-linux)
+	case ${gdb_host_cpu} in
+	    powerpc)
+		# Target: Cell BE (PowerPC64 + SPU)
+		# This implements a 'pseudo-native' GDB running on the
+		# PPU side of the Cell BE and debugging the SPU side.
+		NAT_FILE=
+		NAT_CDEPS=
+		LOADLIBES=
+		NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
 		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
 		      linux-personality.o linux-namespaces.o'
+		;;
+	esac
 	;;
-    esac
-    ;;
-  s390)
-    case ${gdb_host} in
-      linux)
-	# Host: S390, running Linux
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-personality.o \
-		linux-waitpid.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  sh)
-    case ${gdb_host} in
-      nbsd)
-	# Host: NetBSD/sh
-	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
-	;;
-    esac
-    ;;
-  sparc)
-    case ${gdb_host} in
-      fbsd)
-	# Host: FreeBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
-		bsd-kvm.o'
-	HAVE_NATIVE_GCORE_HOST=1
-
-	LOADLIBES='-lkvm'
-	;;
-      linux64)
-	# Host: GNU/Linux UltraSPARC
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
-		fork-child.o inf-ptrace.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      linux)
-	# Host: GNU/Linux SPARC
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
-		fork-child.o inf-ptrace.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-      nbsd64)
-	# Host: NetBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      nbsdelf)
-	# Host: NetBSD/sparc ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd64)
-	# Host: OpenBSD/sparc64
-	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
-		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      sol2)
-	# Host: Solaris SPARC & UltraSPARC
-	NAT_FILE='nm-sol2.h'
-	NATDEPFILES='sparc-sol2-nat.o \
-		fork-child.o \
-		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
-	HAVE_NATIVE_GCORE_HOST=1
-	;;
-    esac
-    ;;
-  tilegx)
-    case ${gdb_host} in
-      linux)
-	# Host: Tilera TILE-Gx running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-	NATDEPFILES='inf-ptrace.o fork-child.o \
-		tilegx-linux-nat.o \
-		proc-service.o linux-thread-db.o \
-		linux-nat.o linux-osdata.o linux-fork.o \
-		linux-procfs.o linux-ptrace.o linux-waitpid.o \
-		linux-personality.o linux-namespaces.o'
-
-	# The dynamically loaded libthread_db needs access to symbols in the
-	# gdb executable.
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
-  vax)
-    case ${gdb_host} in
-      nbsdelf)
-	# Host: NetBSD/vax ELF
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		vax-bsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-      obsd)
-	# Host: OpenBSD/vax
-	NATDEPFILES='fork-child.o inf-ptrace.o \
-		vax-bsd-nat.o bsd-kvm.o'
-
-	LOADLIBES='-lkvm'
-	;;
-    esac
-    ;;
-  xtensa)
-    case ${gdb_host} in
-      linux)
-	# Host: Xtensa, running GNU/Linux.
-	NAT_FILE='config/nm-linux.h'
-
-	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
-		linux-thread-db.o proc-service.o \
-		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-		linux-waitpid.o linux-personality.o linux-namespaces.o'
-	NAT_CDEPS='$(srcdir)/proc-service.list'
-
-	LOADLIBES='-ldl $(RDYNAMIC)'
-	;;
-    esac
-    ;;
 esac
-- 
2.9.3

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3 0/2] Introduce gdb/configure.nat
  2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
                   ` (3 preceding siblings ...)
  2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
@ 2017-05-05  4:31 ` Sergio Durigan Junior
  2017-05-05  4:31   ` [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
  2017-05-05  4:32   ` [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
  4 siblings, 2 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-05  4:31 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Simon Marchi, John Baldwin

Hi,

Hopefully last iteration addressing all the comments made by Pedro and
John.

Changes from v2:

- Fixed stale comments on Makefile.in.

- s/NAT_EXTRA_FRAGS_FILE/nat_extra_makefile_frag/.

- Fixed typos on i386gnu-extra.mh.

- Move NAT_GENERATED_FILES to i386gnu-extra.mh.

- Fixed nits on comments on configure.{ac,nat}.

- Updated ChangeLog entries.

Thanks,

Sergio.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
  2017-05-05  4:31   ` [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
@ 2017-05-05  4:32   ` Sergio Durigan Junior
  2017-05-05 16:35     ` Pedro Alves
  1 sibling, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-05  4:32 UTC (permalink / raw)
  To: GDB Patches
  Cc: Pedro Alves, Simon Marchi, John Baldwin, Sergio Durigan Junior

Due to my ongoing work to make it possible for gdbserver to start the
inferior using the shell, I had to share the fork_inferior function
under the "nat/" directory.  In order to do that, I created a new file
and put the function there; however, this meant that I now had to
update some of the *.mh files (under "gdb/config") and add the new
file as a dependency to be built natively.  Bleh...

After talking a bit to Pedro about this, the idea came up to write a
new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
concentrate all of the native settings for each host/system.  I
decided to tackle this issue.

The patch is simple.  All of the previous Makefile variables that were
being declared inside the *.mh files are now inside "gdb/Makefile.in",
and "gdb/configure" is responsible for AC_SUBST'ing them.  The
definitions of these variables were put inside "gdb/configure.nat", so
now they're shell variables.  For excerpts of Makefile code, one must
create a file under "gdb/config/${gdb_cpu_host}" and reference it on
the "nat_extra_makefile_frag" variable.

It should now be easier to update the native dependencies of hosts in
this single file.

This has been tested on x86_64 without regressions.

gdb/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile.in: Remove "@host_makefile_frag@".  Add variables
	NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
	NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_HOST.  Add
	"@nat_extra_makefile_frag@".
	(Makefile): Remove dependency on "@frags@".
	($(GNULIB_BUILDDIR)/Makefile): Likewise.
	(data-directory/Makefile): Likewise.
	* config/aarch64/linux.mh: Deleted; moved contents to
	"gdb/configure.nat".
	* config/alpha/alpha-linux.mh: Likewise.
	* config/alpha/nbsd.mh: Likewise.
	* config/arm/linux.mh: Likewise.
	* config/arm/nbsdelf.mh: Likewise.
	* config/i386/cygwin.mh: Likewise.
	* config/i386/cygwin64.mh: Likewise.
	* config/i386/darwin.mh: Likewise.
	* config/i386/fbsd.mh: Likewise.
	* config/i386/fbsd64.mh: Likewise.
	* config/i386/go32.mh: Likewise.
	* config/i386/i386gnu.mh: Likewise.
	* config/i386/i386sol2.mh: Likewise.
	* config/i386/linux.mh: Likewise.
	* config/i386/linux64.mh: Likewise.
	* config/i386/mingw.mh: Likewise.
	* config/i386/mingw64.mh: Likewise.
	* config/i386/nbsd64.mh: Likewise.
	* config/i386/nbsdelf.mh: Likewise.
	* config/i386/nto.mh: Likewise.
	* config/i386/obsd.mh: Likewise.
	* config/i386/obsd64.mh: Likewise.
	* config/i386/sol2-64.mh: Likewise.
	* config/ia64/linux.mh: Likewise.
	* config/m32r/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/m68k/nbsdelf.mh: Likewise.
	* config/m68k/obsd.mh: Likewise.
	* config/m88k/obsd.mh: Likewise.
	* config/mips/fbsd.mh: Likewise.
	* config/mips/linux.mh: Likewise.
	* config/mips/nbsd.mh: Likewise.
	* config/mips/obsd64.mh: Likewise.
	* config/pa/linux.mh: Likewise.
	* config/pa/nbsd.mh: Likewise.
	* config/pa/obsd.mh: Likewise.
	* config/powerpc/aix.mh: Likewise.
	* config/powerpc/fbsd.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/powerpc/nbsd.mh: Likewise.
	* config/powerpc/obsd.mh: Likewise.
	* config/powerpc/ppc64-linux.mh: Likewise.
	* config/powerpc/spu-linux.mh: Likewise.
	* config/s390/linux.mh: Likewise.
	* config/sh/nbsd.mh: Likewise.
	* config/sparc/fbsd.mh: Likewise.
	* config/sparc/linux.mh: Likewise.
	* config/sparc/linux64.mh: Likewise.
	* config/sparc/nbsd64.mh: Likewise.
	* config/sparc/nbsdelf.mh: Likewise.
	* config/sparc/obsd64.mh: Likewise.
	* config/sparc/sol2.mh: Likewise.
	* config/tilegx/linux.mh: Likewise.
	* config/vax/nbsdelf.mh: Likewise.
	* config/vax/obsd.mh: Likewise.
	* config/xtensa/linux.mh: Likewise.
	* config/i386/i386gnu-extra.mh: New file.
	* configure: Regenerate.
	* configure.ac: Rewrite code to use "gdb/configure.nat" instead of
	*.mh files under "gdb/config".
	* configure.nat: New file, with contents from the
	"gdb/config/*/*.mh" files.

gdb/doc/ChangeLog:
yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>

	* Makefile: Remove "@host_makefile_frag".
---
 gdb/Makefile.in                                  |  24 +-
 gdb/config/aarch64/linux.mh                      |  29 --
 gdb/config/alpha/alpha-linux.mh                  |  15 -
 gdb/config/alpha/nbsd.mh                         |   4 -
 gdb/config/arm/linux.mh                          |  10 -
 gdb/config/arm/nbsdelf.mh                        |   2 -
 gdb/config/i386/cygwin.mh                        |   3 -
 gdb/config/i386/cygwin64.mh                      |  20 -
 gdb/config/i386/darwin.mh                        |   4 -
 gdb/config/i386/fbsd.mh                          |   8 -
 gdb/config/i386/fbsd64.mh                        |   7 -
 gdb/config/i386/go32.mh                          |  11 -
 gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} |  20 +-
 gdb/config/i386/i386sol2.mh                      |   4 -
 gdb/config/i386/linux.mh                         |  14 -
 gdb/config/i386/linux64.mh                       |  15 -
 gdb/config/i386/mingw.mh                         |   3 -
 gdb/config/i386/mingw64.mh                       |   1 -
 gdb/config/i386/nbsd64.mh                        |   3 -
 gdb/config/i386/nbsdelf.mh                       |   5 -
 gdb/config/i386/nto.mh                           |   4 -
 gdb/config/i386/obsd.mh                          |   5 -
 gdb/config/i386/obsd64.mh                        |   5 -
 gdb/config/i386/sol2-64.mh                       |   4 -
 gdb/config/ia64/linux.mh                         |  13 -
 gdb/config/m32r/linux.mh                         |  10 -
 gdb/config/m68k/linux.mh                         |  14 -
 gdb/config/m68k/nbsdelf.mh                       |   4 -
 gdb/config/m68k/obsd.mh                          |   4 -
 gdb/config/m88k/obsd.mh                          |   2 -
 gdb/config/mips/fbsd.mh                          |   3 -
 gdb/config/mips/linux.mh                         |  11 -
 gdb/config/mips/nbsd.mh                          |   2 -
 gdb/config/mips/obsd64.mh                        |   2 -
 gdb/config/pa/linux.mh                           |  10 -
 gdb/config/pa/nbsd.mh                            |   2 -
 gdb/config/pa/obsd.mh                            |   2 -
 gdb/config/powerpc/aix.mh                        |   8 -
 gdb/config/powerpc/fbsd.mh                       |  24 -
 gdb/config/powerpc/linux.mh                      |  12 -
 gdb/config/powerpc/nbsd.mh                       |   4 -
 gdb/config/powerpc/obsd.mh                       |   4 -
 gdb/config/powerpc/ppc64-linux.mh                |  15 -
 gdb/config/powerpc/spu-linux.mh                  |   8 -
 gdb/config/s390/linux.mh                         |   9 -
 gdb/config/sh/nbsd.mh                            |   2 -
 gdb/config/sparc/fbsd.mh                         |   7 -
 gdb/config/sparc/linux.mh                        |  13 -
 gdb/config/sparc/linux64.mh                      |  13 -
 gdb/config/sparc/nbsd64.mh                       |   5 -
 gdb/config/sparc/nbsdelf.mh                      |   5 -
 gdb/config/sparc/obsd64.mh                       |   5 -
 gdb/config/sparc/sol2.mh                         |   6 -
 gdb/config/tilegx/linux.mh                       |  13 -
 gdb/config/vax/nbsdelf.mh                        |   5 -
 gdb/config/vax/obsd.mh                           |   5 -
 gdb/config/xtensa/linux.mh                       |  11 -
 gdb/configure                                    |  39 +-
 gdb/configure.ac                                 |  37 +-
 gdb/configure.nat                                | 602 +++++++++++++++++++++++
 gdb/doc/Makefile.in                              |   3 -
 61 files changed, 659 insertions(+), 495 deletions(-)
 delete mode 100644 gdb/config/aarch64/linux.mh
 delete mode 100644 gdb/config/alpha/alpha-linux.mh
 delete mode 100644 gdb/config/alpha/nbsd.mh
 delete mode 100644 gdb/config/arm/linux.mh
 delete mode 100644 gdb/config/arm/nbsdelf.mh
 delete mode 100644 gdb/config/i386/cygwin.mh
 delete mode 100644 gdb/config/i386/cygwin64.mh
 delete mode 100644 gdb/config/i386/darwin.mh
 delete mode 100644 gdb/config/i386/fbsd.mh
 delete mode 100644 gdb/config/i386/fbsd64.mh
 delete mode 100644 gdb/config/i386/go32.mh
 rename gdb/config/i386/{i386gnu.mh => i386gnu-extra.mh} (67%)
 delete mode 100644 gdb/config/i386/i386sol2.mh
 delete mode 100644 gdb/config/i386/linux.mh
 delete mode 100644 gdb/config/i386/linux64.mh
 delete mode 100644 gdb/config/i386/mingw.mh
 delete mode 100644 gdb/config/i386/mingw64.mh
 delete mode 100644 gdb/config/i386/nbsd64.mh
 delete mode 100644 gdb/config/i386/nbsdelf.mh
 delete mode 100644 gdb/config/i386/nto.mh
 delete mode 100644 gdb/config/i386/obsd.mh
 delete mode 100644 gdb/config/i386/obsd64.mh
 delete mode 100644 gdb/config/i386/sol2-64.mh
 delete mode 100644 gdb/config/ia64/linux.mh
 delete mode 100644 gdb/config/m32r/linux.mh
 delete mode 100644 gdb/config/m68k/linux.mh
 delete mode 100644 gdb/config/m68k/nbsdelf.mh
 delete mode 100644 gdb/config/m68k/obsd.mh
 delete mode 100644 gdb/config/m88k/obsd.mh
 delete mode 100644 gdb/config/mips/fbsd.mh
 delete mode 100644 gdb/config/mips/linux.mh
 delete mode 100644 gdb/config/mips/nbsd.mh
 delete mode 100644 gdb/config/mips/obsd64.mh
 delete mode 100644 gdb/config/pa/linux.mh
 delete mode 100644 gdb/config/pa/nbsd.mh
 delete mode 100644 gdb/config/pa/obsd.mh
 delete mode 100644 gdb/config/powerpc/aix.mh
 delete mode 100644 gdb/config/powerpc/fbsd.mh
 delete mode 100644 gdb/config/powerpc/linux.mh
 delete mode 100644 gdb/config/powerpc/nbsd.mh
 delete mode 100644 gdb/config/powerpc/obsd.mh
 delete mode 100644 gdb/config/powerpc/ppc64-linux.mh
 delete mode 100644 gdb/config/powerpc/spu-linux.mh
 delete mode 100644 gdb/config/s390/linux.mh
 delete mode 100644 gdb/config/sh/nbsd.mh
 delete mode 100644 gdb/config/sparc/fbsd.mh
 delete mode 100644 gdb/config/sparc/linux.mh
 delete mode 100644 gdb/config/sparc/linux64.mh
 delete mode 100644 gdb/config/sparc/nbsd64.mh
 delete mode 100644 gdb/config/sparc/nbsdelf.mh
 delete mode 100644 gdb/config/sparc/obsd64.mh
 delete mode 100644 gdb/config/sparc/sol2.mh
 delete mode 100644 gdb/config/tilegx/linux.mh
 delete mode 100644 gdb/config/vax/nbsdelf.mh
 delete mode 100644 gdb/config/vax/obsd.mh
 delete mode 100644 gdb/config/xtensa/linux.mh
 create mode 100644 gdb/configure.nat

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index b865b7c..90f8dc6 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -902,9 +902,21 @@ ALL_TARGET_OBS = \
 	xtensa-linux-tdep.o \
 	xtensa-tdep.o
 
-# Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
-# End of host-dependent makefile fragment
+# The following native-target dependent variables are defined on
+# configure.nat.
+NAT_FILE = @NAT_FILE@
+NATDEPFILES = @NATDEPFILES@
+NAT_CDEPS = @NAT_CDEPS@
+LOADLIBES = @LOADLIBES@
+MH_CFLAGS = @MH_CFLAGS@
+XM_CLIBS = @XM_CLIBS@
+NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
+HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
+
+# Native-target dependent makefile fragment comes in here.
+@nat_extra_makefile_frag@
+
+# End of native-target dependent variables.
 
 FLAGS_TO_PASS = \
 	"prefix=$(prefix)" \
@@ -2315,21 +2327,21 @@ subdir_do: force
 		else true ; fi ; \
 	done
 
-Makefile: Makefile.in config.status @frags@
+Makefile: Makefile.in config.status
 	# Regenerate the Makefile and the tm.h / nm.h links.
 	CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS= \
 	  CONFIG_HEADERS= \
 	  $(SHELL) config.status
 
-$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status @frags@
+$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
 	@cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
 	  CONFIG_LINKS= \
 	  $(SHELL) config.status
 
-data-directory/Makefile: data-directory/Makefile.in config.status @frags@
+data-directory/Makefile: data-directory/Makefile.in config.status
 	CONFIG_FILES="data-directory/Makefile" \
 	  CONFIG_COMMANDS="depfiles" \
 	  CONFIG_HEADERS= \
diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh
deleted file mode 100644
index d184a79..0000000
--- a/gdb/config/aarch64/linux.mh
+++ /dev/null
@@ -1,29 +0,0 @@
-#  Host: AArch64 based machine running GNU/Linux
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#  Contributed by ARM Ltd.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
-	proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
-	aarch64-linux.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
deleted file mode 100644
index 4991dd2..0000000
--- a/gdb/config/alpha/alpha-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: Little-endian Alpha running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
-	fork-child.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
-
-# doublest.c currently assumes some properties of FP arithmetic
-# on the host which require this.
-MH_CFLAGS = -mieee
diff --git a/gdb/config/alpha/nbsd.mh b/gdb/config/alpha/nbsd.mh
deleted file mode 100644
index a46739e..0000000
--- a/gdb/config/alpha/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/alpha
-NATDEPFILES= fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh
deleted file mode 100644
index 003ca1f..0000000
--- a/gdb/config/arm/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: ARM based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
-	aarch32-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/arm/nbsdelf.mh b/gdb/config/arm/nbsdelf.mh
deleted file mode 100644
index 042b583..0000000
--- a/gdb/config/arm/nbsdelf.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/arm
-NATDEPFILES= fork-child.o inf-ptrace.o arm-nbsd-nat.o
diff --git a/gdb/config/i386/cygwin.mh b/gdb/config/i386/cygwin.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/cygwin.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/cygwin64.mh b/gdb/config/i386/cygwin64.mh
deleted file mode 100644
index 4f70adc..0000000
--- a/gdb/config/i386/cygwin64.mh
+++ /dev/null
@@ -1,20 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/darwin.mh b/gdb/config/i386/darwin.mh
deleted file mode 100644
index 16c1558..0000000
--- a/gdb/config/i386/darwin.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: IA86 running Darwin
-
-NATDEPFILES = fork-child.o darwin-nat.o \
-     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
deleted file mode 100644
index 69e0a8b..0000000
--- a/gdb/config/i386/fbsd.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: FreeBSD/i386
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
-	i386-fbsd-nat.o bsd-kvm.o
-NAT_FILE= nm-fbsd.h
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
deleted file mode 100644
index 461ff9a..0000000
--- a/gdb/config/i386/fbsd64.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
-	bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh
deleted file mode 100644
index f1edfad..0000000
--- a/gdb/config/i386/go32.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Intel x86 running DJGPP
-
-# We include several header files from config/djgpp
-MH_CFLAGS= -I$(srcdir)/config/djgpp
-
-NATDEPFILES= go32-nat.o x86-nat.o x86-dregs.o
-
-HOST_IPC=
-XM_CLIBS= -ldbg
-
-
diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
similarity index 67%
rename from gdb/config/i386/i386gnu.mh
rename to gdb/config/i386/i386gnu-extra.mh
index 070497f..93016ff 100644
--- a/gdb/config/i386/i386gnu.mh
+++ b/gdb/config/i386/i386gnu-extra.mh
@@ -1,15 +1,3 @@
-# Host: Intel 386 running the GNU Hurd
-NATDEPFILES= i386-gnu-nat.o gnu-nat.o \
-	     x86-nat.o x86-dregs.o fork-child.o \
-	     notify_S.o process_reply_S.o msg_reply_S.o \
-	     msg_U.o exc_request_U.o exc_request_S.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-NAT_FILE= nm-i386gnu.h
-MH_CFLAGS = -D_GNU_SOURCE
-
-XM_CLIBS = -lshouldbeinlibc
-
 # Use our own user stubs for the msg rpcs, so we can make them time out, in
 # case the program is fucked, or we guess the wrong signal thread.
 msg-MIGUFLAGS = -D'MSG_IMPORTS=waittime 1000;'
@@ -33,9 +21,9 @@ MIGCOM = $(MIG) -cc cat - /dev/null
 	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
 
 # MIG stubs are not yet ready for C++ compilation.
-%_S.o %_U.o : COMPILE.post += -x c
+%_S.o %_U.o : COMPILE.post +=-x c
 
 NAT_GENERATED_FILES = notify_S.h notify_S.c \
-	process_reply_S.h process_reply_S.c \
-	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
-	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
+		process_reply_S.h process_reply_S.c \
+		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
+		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
deleted file mode 100644
index 787a3c1..0000000
--- a/gdb/config/i386/i386sol2.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86
-NATDEPFILES= fork-child.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
deleted file mode 100644
index 421c56f..0000000
--- a/gdb/config/i386/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Intel 386 running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
deleted file mode 100644
index 42d8df5..0000000
--- a/gdb/config/i386/linux64.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: GNU/Linux x86-64
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
-	x86-linux-nat.o \
-	linux-nat.o linux-osdata.o \
-	proc-service.o linux-thread-db.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-btrace.o \
-	linux-waitpid.o linux-personality.o x86-linux.o \
-	x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
-NAT_FILE= config/nm-linux.h
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/mingw.mh b/gdb/config/i386/mingw.mh
deleted file mode 100644
index 09bee12..0000000
--- a/gdb/config/i386/mingw.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-MH_CFLAGS=
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o
-XM_CLIBS=
diff --git a/gdb/config/i386/mingw64.mh b/gdb/config/i386/mingw64.mh
deleted file mode 100644
index 0ee2e2c..0000000
--- a/gdb/config/i386/mingw64.mh
+++ /dev/null
@@ -1 +0,0 @@
-NATDEPFILES= x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o
diff --git a/gdb/config/i386/nbsd64.mh b/gdb/config/i386/nbsd64.mh
deleted file mode 100644
index 91d21f3..0000000
--- a/gdb/config/i386/nbsd64.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: NetBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
deleted file mode 100644
index 5954b3f..0000000
--- a/gdb/config/i386/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/nto.mh b/gdb/config/i386/nto.mh
deleted file mode 100644
index b9e2f84..0000000
--- a/gdb/config/i386/nto.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Intel 386 running QNX.
-
-NATDEPFILES= nto-procfs.o
-NAT_FILE= config/nm-nto.h
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
deleted file mode 100644
index fac7282..0000000
--- a/gdb/config/i386/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/i386 ELF
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
deleted file mode 100644
index 51deea7..0000000
--- a/gdb/config/i386/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/amd64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/i386/sol2-64.mh b/gdb/config/i386/sol2-64.mh
deleted file mode 100644
index 7a3ab73..0000000
--- a/gdb/config/i386/sol2-64.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: Solaris x86_64
-NATDEPFILES= fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh
deleted file mode 100644
index b05f834..0000000
--- a/gdb/config/ia64/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Intel IA-64 running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ia64-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-personality.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
deleted file mode 100644
index 277d8bd..0000000
--- a/gdb/config/m32r/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: M32R based machine running GNU/Linux
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o				\
-	m32r-linux-nat.o proc-service.o linux-thread-db.o	\
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh
deleted file mode 100644
index 7c1f4ac..0000000
--- a/gdb/config/m68k/linux.mh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Host: Motorola m68k running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	m68k-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/nbsdelf.mh b/gdb/config/m68k/nbsdelf.mh
deleted file mode 100644
index 1d00cbc..0000000
--- a/gdb/config/m68k/nbsdelf.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/m68k ELF
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m68k/obsd.mh b/gdb/config/m68k/obsd.mh
deleted file mode 100644
index 902a24b..0000000
--- a/gdb/config/m68k/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/m68k
-NATDEPFILES= m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/m88k/obsd.mh b/gdb/config/m88k/obsd.mh
deleted file mode 100644
index 3c4d8d5..0000000
--- a/gdb/config/m88k/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/m88k
-NATDEPFILES= fork-child.o inf-ptrace.o m88k-bsd-nat.o
diff --git a/gdb/config/mips/fbsd.mh b/gdb/config/mips/fbsd.mh
deleted file mode 100644
index f433347..0000000
--- a/gdb/config/mips/fbsd.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Host: FreeBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh
deleted file mode 100644
index 11ff903..0000000
--- a/gdb/config/mips/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Linux/MIPS
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o \
-	mips-linux-watch.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/mips/nbsd.mh b/gdb/config/mips/nbsd.mh
deleted file mode 100644
index a80da95..0000000
--- a/gdb/config/mips/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/mips
-NATDEPFILES= fork-child.o inf-ptrace.o mips-nbsd-nat.o
diff --git a/gdb/config/mips/obsd64.mh b/gdb/config/mips/obsd64.mh
deleted file mode 100644
index 6aeac34..0000000
--- a/gdb/config/mips/obsd64.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/mips64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o
diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
deleted file mode 100644
index 1b73ecd..0000000
--- a/gdb/config/pa/linux.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: Hewlett-Packard PA-RISC machine, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	hppa-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/pa/nbsd.mh b/gdb/config/pa/nbsd.mh
deleted file mode 100644
index 791cd9f..0000000
--- a/gdb/config/pa/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o
diff --git a/gdb/config/pa/obsd.mh b/gdb/config/pa/obsd.mh
deleted file mode 100644
index 95dd416..0000000
--- a/gdb/config/pa/obsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: OpenBSD/hppa
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o
diff --git a/gdb/config/powerpc/aix.mh b/gdb/config/powerpc/aix.mh
deleted file mode 100644
index 141501d..0000000
--- a/gdb/config/powerpc/aix.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Host: IBM PowerPC running AIX
-
-# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
-NATDEPFILES= fork-child.o inf-ptrace.o rs6000-nat.o
-
-# When compiled with cc, for debugging, this argument should be passed.
-# We have no idea who our current compiler is though, so we skip it.
-# MH_CFLAGS = -bnodelcsect
diff --git a/gdb/config/powerpc/fbsd.mh b/gdb/config/powerpc/fbsd.mh
deleted file mode 100644
index 9c2e6b4..0000000
--- a/gdb/config/powerpc/fbsd.mh
+++ /dev/null
@@ -1,24 +0,0 @@
-#  Native config information for GDB on PowerPC systems running FreeBSD.
-#
-#  Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-#  This file is part of GDB.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-NATDEPFILES= fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
-
diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
deleted file mode 100644
index f4a52c3..0000000
--- a/gdb/config/powerpc/linux.mh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Host: PowerPC, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh
deleted file mode 100644
index f02a0f9..0000000
--- a/gdb/config/powerpc/nbsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: NetBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/obsd.mh b/gdb/config/powerpc/obsd.mh
deleted file mode 100644
index 3743254..0000000
--- a/gdb/config/powerpc/obsd.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host: OpenBSD/powerpc
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
deleted file mode 100644
index 8681d00..0000000
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Host: PowerPC64, running Linux
-
-XM_CLIBS=
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	ppc-linux-nat.o proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o ppc-linux.o linux-personality.o \
-	linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/spu-linux.mh b/gdb/config/powerpc/spu-linux.mh
deleted file mode 100644
index 9205b62..0000000
--- a/gdb/config/powerpc/spu-linux.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Target: Cell BE (PowerPC64 + SPU)
-
-# This implements a 'pseudo-native' GDB running on the
-# PPU side of the Cell BE and debugging the SPU side.
-
-NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
-	      linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	      linux-personality.o linux-namespaces.o
diff --git a/gdb/config/s390/linux.mh b/gdb/config/s390/linux.mh
deleted file mode 100644
index 4a137cd..0000000
--- a/gdb/config/s390/linux.mh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Host: S390, running Linux
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-personality.o \
-	linux-waitpid.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sh/nbsd.mh b/gdb/config/sh/nbsd.mh
deleted file mode 100644
index 14d7e8c..0000000
--- a/gdb/config/sh/nbsd.mh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Host: NetBSD/sh
-NATDEPFILES= fork-child.o inf-ptrace.o sh-nbsd-nat.o
diff --git a/gdb/config/sparc/fbsd.mh b/gdb/config/sparc/fbsd.mh
deleted file mode 100644
index bdc272c..0000000
--- a/gdb/config/sparc/fbsd.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Host: FreeBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
-	bsd-kvm.o
-HAVE_NATIVE_GCORE_HOST = 1
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
deleted file mode 100644
index 385f640..0000000
--- a/gdb/config/sparc/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux SPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh
deleted file mode 100644
index 8df0de1..0000000
--- a/gdb/config/sparc/linux64.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: GNU/Linux UltraSPARC
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
-	fork-child.o inf-ptrace.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/nbsd64.mh b/gdb/config/sparc/nbsd64.mh
deleted file mode 100644
index aa15b1d..0000000
--- a/gdb/config/sparc/nbsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
deleted file mode 100644
index 97d07b3..0000000
--- a/gdb/config/sparc/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/sparc ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/obsd64.mh b/gdb/config/sparc/obsd64.mh
deleted file mode 100644
index e9f2fb9..0000000
--- a/gdb/config/sparc/obsd64.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/sparc64
-NATDEPFILES= fork-child.o inf-ptrace.o obsd-nat.o \
-	sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
deleted file mode 100644
index 220c61f..0000000
--- a/gdb/config/sparc/sol2.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Solaris SPARC & UltraSPARC
-NAT_FILE= nm-sol2.h
-NATDEPFILES= sparc-sol2-nat.o \
-	fork-child.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-HAVE_NATIVE_GCORE_HOST = 1
diff --git a/gdb/config/tilegx/linux.mh b/gdb/config/tilegx/linux.mh
deleted file mode 100644
index ec648d3..0000000
--- a/gdb/config/tilegx/linux.mh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Host: Tilera TILE-Gx running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-NATDEPFILES= inf-ptrace.o fork-child.o \
-	tilegx-linux-nat.o \
-	proc-service.o linux-thread-db.o \
-	linux-nat.o linux-osdata.o linux-fork.o \
-	linux-procfs.o linux-ptrace.o linux-waitpid.o \
-	linux-personality.o linux-namespaces.o
-
-# The dynamically loaded libthread_db needs access to symbols in the
-# gdb executable.
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/vax/nbsdelf.mh b/gdb/config/vax/nbsdelf.mh
deleted file mode 100644
index bf0f0b9..0000000
--- a/gdb/config/vax/nbsdelf.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: NetBSD/vax ELF
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/vax/obsd.mh b/gdb/config/vax/obsd.mh
deleted file mode 100644
index cef99d3..0000000
--- a/gdb/config/vax/obsd.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: OpenBSD/vax
-NATDEPFILES= fork-child.o inf-ptrace.o \
-	vax-bsd-nat.o bsd-kvm.o
-
-LOADLIBES= -lkvm
diff --git a/gdb/config/xtensa/linux.mh b/gdb/config/xtensa/linux.mh
deleted file mode 100644
index d5b8f91..0000000
--- a/gdb/config/xtensa/linux.mh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Host: Xtensa, running GNU/Linux.
-
-NAT_FILE= config/nm-linux.h
-
-NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
-	linux-thread-db.o proc-service.o \
-	linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
-	linux-waitpid.o linux-personality.o linux-namespaces.o
-NAT_CDEPS = $(srcdir)/proc-service.list
-
-LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/configure b/gdb/configure
index 9f05b4b..bbebe3a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -598,7 +598,14 @@ GDB_NM_FILE
 LTLIBBABELTRACE
 LIBBABELTRACE
 HAVE_LIBBABELTRACE
-frags
+HAVE_NATIVE_GCORE_HOST
+NAT_GENERATED_FILES
+XM_CLIBS
+MH_CFLAGS
+LOADLIBES
+NAT_CDEPS
+NATDEPFILES
+NAT_FILE
 target_subdir
 CONFIG_UNINSTALL
 CONFIG_INSTALL
@@ -799,7 +806,7 @@ PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files='host_makefile_frag'
+ac_subst_files='nat_extra_makefile_frag'
 ac_user_opts='
 enable_option_checking
 enable_maintainer_mode
@@ -16724,27 +16731,21 @@ if test "${host}" != "${target}"; then
 fi
 
 
-frags=
+# Import nat definitions.
+nat_extra_makefile_frag=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    as_fn_error "\"*** Gdb does not support native target ${host}\"" "$LINENO" 5
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
 
 
 
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
+
+
+
+
+
 
 
 if test x"${gdb_osabi}" != x ; then
@@ -17315,8 +17316,8 @@ $as_echo "$as_me: WARNING: babeltrace is missing or unusable; GDB is unable to r
   fi
 fi
 
-# If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
-# to an empty version.
+# If nativefile (NAT_FILE) is not set in configure.nat, we link to an
+# empty version.
 
 files=
 links=
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 50f6f59..05ea0c0 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2199,29 +2199,22 @@ if test "${host}" != "${target}"; then
 fi
 AC_SUBST(target_subdir)
 
-frags=
+# Import nat definitions.
+nat_extra_makefile_frag=/dev/null
 if test "${gdb_native}" = "yes"; then
-  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
-  if test ! -f ${host_makefile_frag}; then
-    AC_MSG_ERROR("*** Gdb does not support native target ${host}")
-  fi
-  frags="$frags $host_makefile_frag"
-else
-  host_makefile_frag=/dev/null
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
 fi
 
-AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST(frags)
-
-changequote(,)dnl
-if test "${gdb_native}" = "yes"; then
-# We pick this up from the host configuration file (.mh) because we
-# do not have a native configuration Makefile fragment.
-nativefile=`sed -n '
-s/NAT_FILE[ 	]*=[ 	]*\([^ 	]*\)/\1/p
-' ${host_makefile_frag}`
-fi
-changequote([,])
+AC_SUBST(NAT_FILE)
+AC_SUBST(NATDEPFILES)
+AC_SUBST(NAT_CDEPS)
+AC_SUBST(LOADLIBES)
+AC_SUBST(MH_CFLAGS)
+AC_SUBST(XM_CLIBS)
+AC_SUBST(NAT_GENERATED_FILES)
+AC_SUBST(HAVE_NATIVE_GCORE_HOST)
+AC_SUBST_FILE(nat_extra_makefile_frag)
 
 if test x"${gdb_osabi}" != x ; then
     AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
@@ -2310,8 +2303,8 @@ else
   fi
 fi
 
-# If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
-# to an empty version.
+# If nativefile (NAT_FILE) is not set in configure.nat, we link to an
+# empty version.
 
 files=
 links=
diff --git a/gdb/configure.nat b/gdb/configure.nat
new file mode 100644
index 0000000..c0ac811
--- /dev/null
+++ b/gdb/configure.nat
@@ -0,0 +1,602 @@
+# ; -*- mode: sh ; -*-
+# Copyright (C) 2013-2017 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Variables defined here:
+#
+# NAT_FILE - The header file with definitions for this native target.
+#
+# NATDEPFILES - Source files required for native debugging on this
+#               native target.
+#
+# NAT_CDEPS - Dynamic symbols to be exported for libthread_db.
+#
+# LOADLIBES - Libraries against which GDB will be linked for this
+#             native target.
+#
+# MH_CFLAGS - Additional CFLAGS for this host.
+#
+# XM_CLIBS - Host-dependent libraries against which GDB will be linked
+#            for this native target.
+#
+# HAVE_NATIVE_GCORE_HOST - Whether gcore should be installed on this
+#                          native target.
+#
+# nat_extra_makefile_frag - File containing extra fragments of
+#                           Makefile that will be used by this native
+#                           target.
+#
+# Notes:
+#
+# - To avoid shell expansion of variables, declare them with single
+#   quotes.
+#
+# - nat_extra_makefile_frag should contain the full path of the file.
+
+
+case ${gdb_host_cpu} in
+  aarch64)
+    case ${gdb_host} in
+      linux)
+	#  Host: AArch64 based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
+		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
+		aarch64-linux.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  alpha)
+    case ${gdb_host} in
+      alpha-linux)
+	# Host: Little-endian Alpha running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
+		fork-child.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+
+	# doublest.c currently assumes some properties of FP arithmetic
+	# on the host which require this.
+	MH_CFLAGS='-mieee'
+	;;
+      nbsd)
+	# Host: NetBSD/alpha
+	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  arm)
+    case ${gdb_host} in
+      linux)
+	# Host: ARM based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
+		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/arm
+	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  i386)
+    case ${gdb_host} in
+      cygwin64)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      cygwin)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      darwin)
+	# Host: IA86 running Darwin
+	NATDEPFILES='fork-child.o darwin-nat.o \
+	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
+	;;
+      fbsd64)
+	# Host: FreeBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
+		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      fbsd)
+	# Host: FreeBSD/i386
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
+		i386-fbsd-nat.o bsd-kvm.o'
+	NAT_FILE='nm-fbsd.h'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      go32)
+	# Host: Intel x86 running DJGPP
+
+	# We include several header files from config/djgpp
+	MH_CFLAGS='-I$(srcdir)/config/djgpp'
+
+	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
+
+	XM_CLIBS='-ldbg'
+	;;
+      i386gnu)
+	# Host: Intel 386 running the GNU Hurd
+	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
+		     x86-nat.o x86-dregs.o fork-child.o \
+		     notify_S.o process_reply_S.o msg_reply_S.o \
+		     msg_U.o exc_request_U.o exc_request_S.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	NAT_FILE='nm-i386gnu.h'
+	MH_CFLAGS='-D_GNU_SOURCE'
+
+	XM_CLIBS='-lshouldbeinlibc'
+
+	nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
+	;;
+      i386sol2)
+	# Host: Solaris x86
+	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux64)
+	# Host: GNU/Linux x86-64
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
+		x86-linux-nat.o \
+		linux-nat.o linux-osdata.o \
+		proc-service.o linux-thread-db.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-btrace.o \
+		linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
+	NAT_FILE='config/nm-linux.h'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: Intel 386 running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
+		x86-linux-dregs.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      mingw64)
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
+	;;
+      mingw)
+	MH_CFLAGS=
+	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
+	XM_CLIBS=
+	;;
+      nbsd64)
+	# Host: NetBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
+	;;
+      nbsdelf)
+	# Host: NetBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nto)
+	# Host: Intel 386 running QNX.
+	NATDEPFILES='nto-procfs.o'
+	NAT_FILE='config/nm-nto.h'
+	;;
+      obsd64)
+	# Host: OpenBSD/amd64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/i386 ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2-64)
+	# Host: Solaris x86_64
+	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  ia64)
+    case ${gdb_host} in
+      linux)
+	# Host: Intel IA-64 running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ia64-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-personality.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m32r)
+    case ${gdb_host} in
+      linux)
+	# Host: M32R based machine running GNU/Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o				\
+		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  m68k)
+    case ${gdb_host} in
+      linux)
+	# Host: Motorola m68k running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		m68k-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsdelf)
+	# Host: NetBSD/m68k ELF
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/m68k
+	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  m88k)
+    case ${gdb_host} in
+      obsd)
+	# Host: OpenBSD/m88k
+	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
+	;;
+    esac
+    ;;
+  mips)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+      linux)
+	# Host: Linux/MIPS
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o \
+		mips-linux-watch.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/mips
+	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
+	;;
+      obsd64)
+	# Host: OpenBSD/mips64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
+	;;
+    esac
+    ;;
+  pa)
+    case ${gdb_host} in
+      linux)
+	# Host: Hewlett-Packard PA-RISC machine, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		hppa-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
+	;;
+      obsd)
+	# Host: OpenBSD/hppa
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
+	;;
+    esac
+    ;;
+  powerpc)
+    case ${gdb_host} in
+      aix)
+	# Host: IBM PowerPC running AIX
+	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
+	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
+
+	# When compiled with cc, for debugging, this argument should be passed.
+	# We have no idea who our current compiler is though, so we skip it.
+	# MH_CFLAGS='-bnodelcsect'
+	;;
+      fbsd)
+	#  Native config information for GDB on PowerPC systems running FreeBSD.
+	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux)
+	# Host: PowerPC, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd)
+	# Host: NetBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/powerpc
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      ppc64-linux)
+	# Host: PowerPC64, running Linux
+	XM_CLIBS=
+
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		ppc-linux-nat.o proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o ppc-linux.o linux-personality.o \
+		linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      spu-linux)
+	# Target: Cell BE (PowerPC64 + SPU)
+	# This implements a 'pseudo-native' GDB running on the
+	# PPU side of the Cell BE and debugging the SPU side.
+
+	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
+		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		      linux-personality.o linux-namespaces.o'
+	;;
+    esac
+    ;;
+  s390)
+    case ${gdb_host} in
+      linux)
+	# Host: S390, running Linux
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-personality.o \
+		linux-waitpid.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  sh)
+    case ${gdb_host} in
+      nbsd)
+	# Host: NetBSD/sh
+	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
+	;;
+    esac
+    ;;
+  sparc)
+    case ${gdb_host} in
+      fbsd)
+	# Host: FreeBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
+		bsd-kvm.o'
+	HAVE_NATIVE_GCORE_HOST=1
+
+	LOADLIBES='-lkvm'
+	;;
+      linux64)
+	# Host: GNU/Linux UltraSPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      linux)
+	# Host: GNU/Linux SPARC
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
+		fork-child.o inf-ptrace.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+      nbsd64)
+	# Host: NetBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      nbsdelf)
+	# Host: NetBSD/sparc ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd64)
+	# Host: OpenBSD/sparc64
+	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
+		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      sol2)
+	# Host: Solaris SPARC & UltraSPARC
+	NAT_FILE='nm-sol2.h'
+	NATDEPFILES='sparc-sol2-nat.o \
+		fork-child.o \
+		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
+	HAVE_NATIVE_GCORE_HOST=1
+	;;
+    esac
+    ;;
+  tilegx)
+    case ${gdb_host} in
+      linux)
+	# Host: Tilera TILE-Gx running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+	NATDEPFILES='inf-ptrace.o fork-child.o \
+		tilegx-linux-nat.o \
+		proc-service.o linux-thread-db.o \
+		linux-nat.o linux-osdata.o linux-fork.o \
+		linux-procfs.o linux-ptrace.o linux-waitpid.o \
+		linux-personality.o linux-namespaces.o'
+
+	# The dynamically loaded libthread_db needs access to symbols in the
+	# gdb executable.
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+  vax)
+    case ${gdb_host} in
+      nbsdelf)
+	# Host: NetBSD/vax ELF
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+      obsd)
+	# Host: OpenBSD/vax
+	NATDEPFILES='fork-child.o inf-ptrace.o \
+		vax-bsd-nat.o bsd-kvm.o'
+
+	LOADLIBES='-lkvm'
+	;;
+    esac
+    ;;
+  xtensa)
+    case ${gdb_host} in
+      linux)
+	# Host: Xtensa, running GNU/Linux.
+	NAT_FILE='config/nm-linux.h'
+
+	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
+		linux-thread-db.o proc-service.o \
+		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+		linux-waitpid.o linux-personality.o linux-namespaces.o'
+	NAT_CDEPS='$(srcdir)/proc-service.list'
+
+	LOADLIBES='-ldl $(RDYNAMIC)'
+	;;
+    esac
+    ;;
+esac
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 5a58fa7..e0e50c1 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -178,9 +178,6 @@ MAN1S = gdb.1 gdbserver.1 gcore.1
 MAN5S = gdbinit.5
 MANS = $(MAN1S) $(MAN5S)
 
-# Host-dependent makefile fragment comes in here.
-@host_makefile_frag@
-# End of host-dependent makefile fragment
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
 ###
-- 
2.9.3

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-05  3:58       ` Sergio Durigan Junior
@ 2017-05-05  9:41         ` Pedro Alves
  2017-05-06 14:04           ` Sergio Durigan Junior
  0 siblings, 1 reply; 30+ messages in thread
From: Pedro Alves @ 2017-05-05  9:41 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Simon Marchi, John Baldwin

On 05/05/2017 04:57 AM, Sergio Durigan Junior wrote:

>> Also, I think "host_makefile_frag" was lowercase because
>> that variable is not meant to be passed to make or any
>> tool make invokes.
> 
> I was naming everything using uppercase because I thought it would be
> more consistent.  

But it'd make it inconsistent with all the other lowercase variables
in Makefile.in that are acsubsted and not passed down to some child.

>>> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
>>> similarity index 58%
>>> rename from gdb/config/i386/i386gnu.mh
>>> rename to gdb/config/i386/i386gnu-extra.mh
>>
>> Why the "extra" rename ?  If anything, I'd expect i386gnu.mh -> i386gnu.mn?
> 
> git showed this as a rename, but it's really a new file.  

That's kind of stretching it.  :-)

> i386gnu.mh is
> gone, like every other previous *.mh file.  Instead of using the old
> name, I decided to add the "-extra" suffix to make it explicit that the
> file contains only extra definitions, and is not the only thing taken
> into account for this native target.

I find the "extra" redundant -- the way I see it, some targets have a 
makefile fragment file that needs to be glued into the Makefile,
others don't.  There's no "main fragment, and then maybe some other/extra ones".

> I initially disagree with your proposal to rename it to i386gnu.mn, so
> I'm keeping it this way.  

Why do you disagree?  ".mh" obviously meant "makefile + host",
but the fragment file is now described as being about the
native target.  Hence, "makefile + native => .mn".

I don't understand the rationale for renaming the file, saying it
is a native target fragment, but _still_ calling it ".mh".
So, I'd understand either not bothering to change the file name
at all, or if renaming it, then giving it a name that matches reality.

> Please let me know if you really thing the
> "-extra" suffix shouldn't be there, and I can remove it.

I really think the -extra suffix shouldn't be there.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-05  4:32   ` [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
@ 2017-05-05 16:35     ` Pedro Alves
  2017-05-06 14:13       ` Sergio Durigan Junior
  0 siblings, 1 reply; 30+ messages in thread
From: Pedro Alves @ 2017-05-05 16:35 UTC (permalink / raw)
  To: Sergio Durigan Junior, GDB Patches; +Cc: Simon Marchi, John Baldwin

On 05/05/2017 05:29 AM, Sergio Durigan Junior wrote:

> +# Native-target dependent makefile fragment comes in here.
> +@nat_extra_makefile_frag@
> +

> rename from gdb/config/i386/i386gnu.mh
> rename to gdb/config/i386/i386gnu-extra.mh
> index 070497f..93016ff 100644
> --- a/gdb/config/i386/i386gnu.mh
> +++ b/gdb/config/i386/i386gnu-extra.mh

...

>  # MIG stubs are not yet ready for C++ compilation.
> -%_S.o %_U.o : COMPILE.post += -x c
> +%_S.o %_U.o : COMPILE.post +=-x c
>  

Spurious whitespace change.

>  NAT_GENERATED_FILES = notify_S.h notify_S.c \
> -	process_reply_S.h process_reply_S.c \
> -	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
> -	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
> +		process_reply_S.h process_reply_S.c \
> +		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
> +		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c

Ditto.

Apart from the naming issue and the spurious whitespace changes,
this looks fine to me.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-05  9:41         ` Pedro Alves
@ 2017-05-06 14:04           ` Sergio Durigan Junior
  2017-05-17 14:03             ` Pedro Alves
  0 siblings, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-06 14:04 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches, Simon Marchi, John Baldwin

On Friday, May 05 2017, Pedro Alves wrote:

>>>> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
>>>> similarity index 58%
>>>> rename from gdb/config/i386/i386gnu.mh
>>>> rename to gdb/config/i386/i386gnu-extra.mh
>>>
>>> Why the "extra" rename ?  If anything, I'd expect i386gnu.mh -> i386gnu.mn?
>> 
>> git showed this as a rename, but it's really a new file.  
>
> That's kind of stretching it.  :-)

Well, my intention from the beginning was to introduce this as a new
file.  I'm not stretching it my intention :-).

>> i386gnu.mh is
>> gone, like every other previous *.mh file.  Instead of using the old
>> name, I decided to add the "-extra" suffix to make it explicit that the
>> file contains only extra definitions, and is not the only thing taken
>> into account for this native target.
>
> I find the "extra" redundant -- the way I see it, some targets have a 
> makefile fragment file that needs to be glued into the Makefile,
> others don't.  There's no "main fragment, and then maybe some other/extra ones".

OK, I see your rationale now.  In my previous understanding, the main
fragment was being generated from configure.nat, which is just a
copy-and-paste from the old *.mh files.  But one could also argue that
there's not actual fragment there, since we just have variables being
AC_SUBST'ed.

>> I initially disagree with your proposal to rename it to i386gnu.mn, so
>> I'm keeping it this way.  
>
> Why do you disagree?  ".mh" obviously meant "makefile + host",
> but the fragment file is now described as being about the
> native target.  Hence, "makefile + native => .mn".

Ahhh.  You're not going to believe it, but until now I was not linking
the fact that ".mh" meant "makefile + host".  I obviously agree that the
new extension should be .mn.

> I don't understand the rationale for renaming the file, saying it
> is a native target fragment, but _still_ calling it ".mh".
> So, I'd understand either not bothering to change the file name
> at all, or if renaming it, then giving it a name that matches reality.
>
>> Please let me know if you really thing the
>> "-extra" suffix shouldn't be there, and I can remove it.
>
> I really think the -extra suffix shouldn't be there.

Fair enough.  Sorry about the confusion; I'll remove the -extra and
use .mn as the extension.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-05 16:35     ` Pedro Alves
@ 2017-05-06 14:13       ` Sergio Durigan Junior
  2017-05-17 13:22         ` Pedro Alves
  0 siblings, 1 reply; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-06 14:13 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches, Simon Marchi, John Baldwin

On Friday, May 05 2017, Pedro Alves wrote:

> On 05/05/2017 05:29 AM, Sergio Durigan Junior wrote:
>
>> +# Native-target dependent makefile fragment comes in here.
>> +@nat_extra_makefile_frag@
>> +
>
>> rename from gdb/config/i386/i386gnu.mh
>> rename to gdb/config/i386/i386gnu-extra.mh
>> index 070497f..93016ff 100644
>> --- a/gdb/config/i386/i386gnu.mh
>> +++ b/gdb/config/i386/i386gnu-extra.mh
>
> ...
>
>>  # MIG stubs are not yet ready for C++ compilation.
>> -%_S.o %_U.o : COMPILE.post += -x c
>> +%_S.o %_U.o : COMPILE.post +=-x c
>>  
>
> Spurious whitespace change.
>
>>  NAT_GENERATED_FILES = notify_S.h notify_S.c \
>> -	process_reply_S.h process_reply_S.c \
>> -	msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
>> -	exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
>> +		process_reply_S.h process_reply_S.c \
>> +		msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
>> +		exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
>
> Ditto.
>
> Apart from the naming issue and the spurious whitespace changes,
> this looks fine to me.

Thanks, pushed with the nits addressed.

21ea5acdd1bcfe89984b16b5bac730050c5cf05e

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant
  2017-05-05  4:31   ` [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
@ 2017-05-06 14:13     ` Sergio Durigan Junior
  0 siblings, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-06 14:13 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Simon Marchi, John Baldwin

On Friday, May 05 2017, I wrote:

> The previous commit introduced gdb/configure.nat, but it was just a
> copy-and-past (with the necessary adjustments) from the files under
> gdb/config/.  We can do better than that.
>
> Instead of using one big 'case' statement that matches the
> ${gdb_host_cpu} and then match each ${gdb_host}, it is possible to
> remove a lof of redundancy by matching the most common ${gdb_host}'s
> first, setting the common variables for each, and then proceed to
> matching specific ${gdb_host}'s and ${gdb_host_cpu}'s.  In other
> words, reverse the order of the 'case's and take advantage of the fact
> that a lot of parameters are the same for each host.
>
> This commit was tested on x86_64 without regressions.
>
> gdb/ChangeLog:
> yyyy-mm-dd  Sergio Durigan Junior  <sergiodj@redhat.com>
>
>  	* configure.nat: Rearrange 'case' statements to match
> 	host before cpu.
> ---
>  gdb/configure.nat | 938 ++++++++++++++++++++++++------------------------------
>  1 file changed, 410 insertions(+), 528 deletions(-)
>
> diff --git a/gdb/configure.nat b/gdb/configure.nat
> index c0ac811..6c135d0 100644
> --- a/gdb/configure.nat
> +++ b/gdb/configure.nat
> @@ -48,555 +48,437 @@
>  # - nat_extra_makefile_frag should contain the full path of the file.
>  
>  
> -case ${gdb_host_cpu} in
> -  aarch64)
> -    case ${gdb_host} in
> -      linux)
> -	#  Host: AArch64 based machine running GNU/Linux
> +# This first case is useful for filling default values for each
> +# gdb_host.
> +case ${gdb_host} in
> +    *linux*)
>  	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
> -		proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
> -		linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
> -		aarch64-linux.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
> -  alpha)
> -    case ${gdb_host} in
> -      alpha-linux)
> -	# Host: Little-endian Alpha running Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o alpha-linux-nat.o \
> -		fork-child.o proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o linux-personality.o linux-namespaces.o'
> +	NATDEPFILES='inf-ptrace.o fork-child.o proc-service.o \
> +		linux-thread-db.o linux-nat.o linux-osdata.o linux-fork.o \
> +		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> +		linux-personality.o linux-namespaces.o'
>  	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
>  	LOADLIBES='-ldl $(RDYNAMIC)'
> -
> -	# doublest.c currently assumes some properties of FP arithmetic
> -	# on the host which require this.
> -	MH_CFLAGS='-mieee'
>  	;;
> -      nbsd)
> -	# Host: NetBSD/alpha
> -	NATDEPFILES='fork-child.o inf-ptrace.o alpha-bsd-nat.o bsd-kvm.o'
> -
> +    fbsd*)
> +	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o'
> +	HAVE_NATIVE_GCORE_HOST=1
>  	LOADLIBES='-lkvm'
>  	;;
> -    esac
> -    ;;
> -  arm)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: ARM based machine running GNU/Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o arm-linux-nat.o \
> -		aarch32-linux-nat.o proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> +    nbsd*)
> +	NATDEPFILES='fork-child.o inf-ptrace.o'
>  	;;
> -      nbsdelf)
> -	# Host: NetBSD/arm
> -	NATDEPFILES='fork-child.o inf-ptrace.o arm-nbsd-nat.o'
> +    obsd*)
> +	NATDEPFILES='fork-child.o inf-ptrace.o'
>  	;;
> -    esac
> -    ;;
> -  i386)
> -    case ${gdb_host} in
> -      cygwin64)
> -	#  Native config information for GDB on PowerPC systems running FreeBSD.
> -	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
> +    cygwin*)
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
>  	;;
> -      cygwin)
> -	MH_CFLAGS=
> -	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
> -	XM_CLIBS=
> +    mingw*)
> +	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o'
>  	;;
> -      darwin)
> -	# Host: IA86 running Darwin
> -	NATDEPFILES='fork-child.o darwin-nat.o \
> -	     i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o darwin-nat-info.o'
> -	;;
> -      fbsd64)
> -	# Host: FreeBSD/amd64
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		fbsd-nat.o amd64-nat.o amd64-bsd-nat.o amd64-fbsd-nat.o \
> -		bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      fbsd)
> -	# Host: FreeBSD/i386
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		fbsd-nat.o x86-nat.o x86-dregs.o x86-bsd-nat.o i386-bsd-nat.o \
> -		i386-fbsd-nat.o bsd-kvm.o'
> -	NAT_FILE='nm-fbsd.h'
> -	HAVE_NATIVE_GCORE_HOST=1
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      go32)
> -	# Host: Intel x86 running DJGPP
> -
> -	# We include several header files from config/djgpp
> -	MH_CFLAGS='-I$(srcdir)/config/djgpp'
> -
> -	NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
> +esac
>  
> -	XM_CLIBS='-ldbg'
> -	;;
> -      i386gnu)
> -	# Host: Intel 386 running the GNU Hurd
> -	NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
> +# This is where we actually filter by host and host CPU.
> +case ${gdb_host} in
> +    aix)
> +	case ${gdb_host_cpu} in
> +	    powerpc)
> +		# Host: IBM PowerPC running AIX aix-thread.o is not
> +		# listed in NATDEPFILES as it is pulled in by
> +		# configure.
> +		NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
> +
> +		# When compiled with cc, for debugging, this argument
> +		# should be passed.  We have no idea who our current
> +		# compiler is though, so we skip it.
> +		# MH_CFLAGS='-bnodelcsect'
> +		;;
> +	esac
> +	;;
> +    alpha-linux)
> +	case ${gdb_host_cpu} in
> +	    alpha)
> +		# Host: Little-endian Alpha running Linux
> +		NATDEPFILES="${NATDEPFILES} alpha-linux-nat.o"
> +		# doublest.c currently assumes some properties of FP arithmetic
> +		# on the host which require this.
> +		MH_CFLAGS='-mieee'
> +		;;
> +	esac
> +	;;
> +    cygwin)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Native config information for GDB on i386
> +		# systems running Cygwin.
> +		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
> +		;;
> +	esac
> +	;;
> +    cygwin64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Native config information for GDB on amd64
> +		# systems running Cygwin.
> +		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
> +		;;
> +	esac
> +	;;
> +    darwin)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: IA86 running Darwin
> +		NATDEPFILES='fork-child.o darwin-nat.o \
> +		i386-darwin-nat.o x86-nat.o x86-dregs.o amd64-nat.o \
> +		darwin-nat-info.o'
> +		;;
> +	esac
> +	;;
> +    fbsd)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: FreeBSD/i386
> +		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
> +		x86-bsd-nat.o i386-bsd-nat.o i386-fbsd-nat.o bsd-kvm.o"
> +		NAT_FILE='nm-fbsd.h'
> +		;;
> +	    mips)
> +		# Host: FreeBSD/mips
> +		NATDEPFILES="${NATDEPFILES} mips-fbsd-nat.o"
> +		LOADLIBES=
> +		;;
> +	    powerpc)
> +		# Native config information for GDB on PowerPC
> +		# systems running FreeBSD.
> +		NATDEPFILES="${NATDEPFILES} ppc-fbsd-nat.o bsd-kvm.o"
> +		;;
> +	    sparc)
> +		# Host: FreeBSD/sparc64
> +		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
> +		sparc64-fbsd-nat.o bsd-kvm.o"
> +		;;
> +	esac
> +	;;
> +    fbsd64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: FreeBSD/amd64
> +		NATDEPFILES="${NATDEPFILES} amd64-nat.o amd64-bsd-nat.o \
> +		amd64-fbsd-nat.o bsd-kvm.o x86-nat.o x86-dregs.o x86-bsd-nat.o"
> +		;;
> +	esac
> +	;;
> +    go32)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: Intel x86 running DJGPP
> +		# We include several header files from config/djgpp
> +		MH_CFLAGS='-I$(srcdir)/config/djgpp'
> +		NATDEPFILES='go32-nat.o x86-nat.o x86-dregs.o'
> +		XM_CLIBS='-ldbg'
> +		;;
> +	esac
> +	;;
> +    i386gnu)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: Intel 386 running the GNU Hurd
> +		NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
>  		     x86-nat.o x86-dregs.o fork-child.o \
>  		     notify_S.o process_reply_S.o msg_reply_S.o \
>  		     msg_U.o exc_request_U.o exc_request_S.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> +		HAVE_NATIVE_GCORE_HOST=1
>  
> -	NAT_FILE='nm-i386gnu.h'
> -	MH_CFLAGS='-D_GNU_SOURCE'
> +		NAT_FILE='nm-i386gnu.h'
> +		MH_CFLAGS='-D_GNU_SOURCE'
>  
> -	XM_CLIBS='-lshouldbeinlibc'
> +		XM_CLIBS='-lshouldbeinlibc'
>  
> -	nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
> +		nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu-extra.mh"
> +		;;
> +	esac
>  	;;
> -      i386sol2)
> -	# Host: Solaris x86
> -	NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
> +    i386sol2)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: Solaris x86
> +		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
>  		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -	;;
> -      linux64)
> -	# Host: GNU/Linux x86-64
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		x86-nat.o x86-dregs.o amd64-nat.o amd64-linux-nat.o \
> -		x86-linux-nat.o \
> -		linux-nat.o linux-osdata.o \
> -		proc-service.o linux-thread-db.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-btrace.o \
> -		linux-waitpid.o linux-personality.o x86-linux.o \
> -		x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o'
> -	NAT_FILE='config/nm-linux.h'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      linux)
> -	# Host: Intel 386 running GNU/Linux.
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-btrace.o linux-waitpid.o linux-personality.o x86-linux.o \
> -		x86-linux-dregs.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      mingw64)
> -	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o amd64-windows-nat.o'
> -	;;
> -      mingw)
> -	MH_CFLAGS=
> -	NATDEPFILES='x86-nat.o x86-dregs.o windows-nat.o i386-windows-nat.o'
> -	XM_CLIBS=
> -	;;
> -      nbsd64)
> -	# Host: NetBSD/amd64
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o'
> -	;;
> -      nbsdelf)
> -	# Host: NetBSD/i386 ELF
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		nbsd-nat.o x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      nto)
> -	# Host: Intel 386 running QNX.
> -	NATDEPFILES='nto-procfs.o'
> -	NAT_FILE='config/nm-nto.h'
> -	;;
> -      obsd64)
> -	# Host: OpenBSD/amd64
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> -		amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      obsd)
> -	# Host: OpenBSD/i386 ELF
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> -		x86-bsd-nat.o i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      sol2-64)
> -	# Host: Solaris x86_64
> -	NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
> +		HAVE_NATIVE_GCORE_HOST=1
> +		;;
> +	esac
> +	;;
> +    linux)
> +	case ${gdb_host_cpu} in
> +	    aarch64)
> +		#  Host: AArch64 based machine running GNU/Linux
> +		NATDEPFILES="${NATDEPFILES} aarch64-linux-nat.o \
> +		aarch32-linux-nat.o aarch64-linux-hw-point.o aarch64-linux.o"
> +		;;
> +	    arm)
> +		# Host: ARM based machine running GNU/Linux
> +		NATDEPFILES="${NATDEPFILES} arm-linux-nat.o \
> +		aarch32-linux-nat.o"
> +		;;
> +	    i386)
> +		# Host: Intel 386 running GNU/Linux.
> +		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
> +		i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
> +		x86-linux.o x86-linux-dregs.o"
> +		;;
> +	    ia64)
> +		# Host: Intel IA-64 running GNU/Linux
> +		NATDEPFILES="${NATDEPFILES} ia64-linux-nat.o"
> +		;;
> +	    m32r)
> +		# Host: M32R based machine running GNU/Linux
> +		NATDEPFILES="${NATDEPFILES} m32r-linux-nat.o"
> +		;;
> +	    m68k)
> +		# Host: Motorola m68k running GNU/Linux.
> +		NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o"
> +		;;
> +	    mips)
> +		# Host: Linux/MIPS
> +		NATDEPFILES="${NATDEPFILES} mips-linux-nat.o \
> +		mips-linux-watch.o"
> +		;;
> +	    pa)
> +		# Host: Hewlett-Packard PA-RISC machine, running Linux
> +		NATDEPFILES="${NATDEPFILES} hppa-linux-nat.o"
> +		;;
> +	    powerpc)
> +		# Host: PowerPC, running Linux
> +		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o"
> +		;;
> +	    s390)
> +		# Host: S390, running Linux
> +		NATDEPFILES="${NATDEPFILES} s390-linux-nat.o"
> +		;;
> +	    sparc)
> +		# Host: GNU/Linux SPARC
> +		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-linux-nat.o"
> +		;;
> +	    tilegx)
> +		# Host: Tilera TILE-Gx running GNU/Linux.
> +		NATDEPFILES="${NATDEPFILES} tilegx-linux-nat.o"
> +		NAT_CDEPS=
> +		;;
> +	    xtensa)
> +		# Host: Xtensa, running GNU/Linux.
> +		NATDEPFILES="${NATDEPFILES} xtensa-linux-nat.o"
> +		;;
> +	esac
> +	;;
> +    linux64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: GNU/Linux x86-64
> +		NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
> +		amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
> +		x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
> +		;;
> +	    sparc)
> +		# Host: GNU/Linux UltraSPARC
> +		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc64-nat.o \
> +		sparc64-linux-nat.o"
> +		;;
> +	esac
> +	;;
> +    mingw)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
> +		;;
> +	esac
> +	;;
> +    mingw64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
> +		;;
> +	esac
> +	;;
> +    nbsd)
> +	case ${gdb_host_cpu} in
> +	    alpha)
> +		# Host: NetBSD/alpha
> +		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    mips)
> +		# Host: NetBSD/mips
> +		NATDEPFILES="${NATDEPFILES} mips-nbsd-nat.o"
> +		;;
> +	    pa)
> +		# Host: NetBSD/hppa
> +		NATDEPFILES="${NATDEPFILES} nbsd-nat.o hppa-nbsd-nat.o"
> +		;;
> +	    powerpc)
> +		# Host: NetBSD/powerpc
> +		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    sh)
> +		# Host: NetBSD/sh
> +		NATDEPFILES="${NATDEPFILES} sh-nbsd-nat.o"
> +		;;
> +
> +	esac
> +	;;
> +    nbsd64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: NetBSD/amd64
> +		NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o \
> +		x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o"
> +		;;
> +	    sparc)
> +		# Host: NetBSD/sparc64
> +		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o \
> +		bsd-kvm.o"
> +		;;
> +
> +	esac
> +	;;
> +    nbdself)
> +	case ${gdb_host_cpu} in
> +	    arm)
> +		# Host: NetBSD/arm
> +		NATDEPFILES="${NATDEPFILES} arm-nbsd-nat.o"
> +		;;
> +	    i386)
> +		# Host: NetBSD/i386 ELF
> +		NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-bsd-nat.o \
> +		i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    m68k)
> +		# Host: NetBSD/m68k ELF
> +		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    sparc)
> +		# Host: NetBSD/sparc ELF
> +		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o \
> +		bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    vax)
> +		# Host: NetBSD/vax ELF
> +		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +
> +	esac
> +	;;
> +    nto)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: Intel 386 running QNX.
> +		NATDEPFILES='nto-procfs.o'
> +		NAT_FILE='config/nm-nto.h'
> +		;;
> +	esac
> +	;;
> +    obsd)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: OpenBSD/i386 ELF
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o x86-bsd-nat.o \
> +		i386-bsd-nat.o i386-obsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    m68k)
> +		# Host: OpenBSD/m68k
> +		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    m88k)
> +		# Host: OpenBSD/m88k
> +		NATDEPFILES="${NATDEPFILES} m88k-bsd-nat.o"
> +		;;
> +	    pa)
> +		# Host: OpenBSD/hppa
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o hppa-obsd-nat.o"
> +		;;
> +	    powerpc)
> +		# Host: OpenBSD/powerpc
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o ppc-obsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    vax)
> +		# Host: OpenBSD/vax
> +		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	esac
> +	;;
> +    obsd64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: OpenBSD/amd64
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o \
> +		x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	    mips)
> +		# Host: OpenBSD/mips64
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o mips64-obsd-nat.o"
> +		;;
> +	    sparc)
> +		# Host: OpenBSD/sparc64
> +		NATDEPFILES="${NATDEPFILES} obsd-nat.o sparc64-obsd-nat.o \
> +		sparc-nat.o bsd-kvm.o"
> +		LOADLIBES='-lkvm'
> +		;;
> +	esac
> +	;;
> +    ppc64-linux)
> +	case ${gdb_host_cpu} in
> +	    powerpc)
> +		# Host: PowerPC64, running Linux
> +		XM_CLIBS=
> +		NATDEPFILES="${NATDEPFILES} ppc-linux-nat.o ppc-linux.o"
> +		;;
> +	esac
> +	;;
> +    sol2)
> +	case ${gdb_host_cpu} in
> +	    sparc)
> +		# Host: Solaris SPARC & UltraSPARC
> +		NAT_FILE='nm-sol2.h'
> +		NATDEPFILES='sparc-sol2-nat.o \
> +		fork-child.o \
>  		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -	;;
> -    esac
> -    ;;
> -  ia64)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: Intel IA-64 running GNU/Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		ia64-linux-nat.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-personality.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
> -  m32r)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: M32R based machine running GNU/Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o				\
> -		m32r-linux-nat.o proc-service.o linux-thread-db.o	\
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
> -  m68k)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: Motorola m68k running GNU/Linux.
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		m68k-linux-nat.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-personality.o \
> -		linux-waitpid.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      nbsdelf)
> -	# Host: NetBSD/m68k ELF
> -	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      obsd)
> -	# Host: OpenBSD/m68k
> -	NATDEPFILES='m68k-bsd-nat.o bsd-kvm.o fork-child.o inf-ptrace.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -    esac
> -    ;;
> -  m88k)
> -    case ${gdb_host} in
> -      obsd)
> -	# Host: OpenBSD/m88k
> -	NATDEPFILES='fork-child.o inf-ptrace.o m88k-bsd-nat.o'
> -	;;
> -    esac
> -    ;;
> -  mips)
> -    case ${gdb_host} in
> -      fbsd)
> -	# Host: FreeBSD/mips
> -	NATDEPFILES='fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -	;;
> -      linux)
> -	# Host: Linux/MIPS
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o mips-linux-nat.o \
> -		linux-thread-db.o proc-service.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-personality.o \
> -		mips-linux-watch.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      nbsd)
> -	# Host: NetBSD/mips
> -	NATDEPFILES='fork-child.o inf-ptrace.o mips-nbsd-nat.o'
> -	;;
> -      obsd64)
> -	# Host: OpenBSD/mips64
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o mips64-obsd-nat.o'
> -	;;
> -    esac
> -    ;;
> -  pa)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: Hewlett-Packard PA-RISC machine, running Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		hppa-linux-nat.o proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      nbsd)
> -	# Host: NetBSD/hppa
> -	NATDEPFILES='fork-child.o inf-ptrace.o nbsd-nat.o hppa-nbsd-nat.o'
> -	;;
> -      obsd)
> -	# Host: OpenBSD/hppa
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o hppa-obsd-nat.o'
> -	;;
> -    esac
> -    ;;
> -  powerpc)
> -    case ${gdb_host} in
> -      aix)
> -	# Host: IBM PowerPC running AIX
> -	# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure.
> -	NATDEPFILES='fork-child.o inf-ptrace.o rs6000-nat.o'
> -
> -	# When compiled with cc, for debugging, this argument should be passed.
> -	# We have no idea who our current compiler is though, so we skip it.
> -	# MH_CFLAGS='-bnodelcsect'
> -	;;
> -      fbsd)
> -	#  Native config information for GDB on PowerPC systems running FreeBSD.
> -	NATDEPFILES='fbsd-nat.o fork-child.o inf-ptrace.o ppc-fbsd-nat.o bsd-kvm.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      linux)
> -	# Host: PowerPC, running Linux
> -	XM_CLIBS=
> -
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		ppc-linux-nat.o proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      nbsd)
> -	# Host: NetBSD/powerpc
> -	NATDEPFILES='fork-child.o inf-ptrace.o ppc-nbsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      obsd)
> -	# Host: OpenBSD/powerpc
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o ppc-obsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      ppc64-linux)
> -	# Host: PowerPC64, running Linux
> -	XM_CLIBS=
> -
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		ppc-linux-nat.o proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o ppc-linux.o linux-personality.o \
> -		linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      spu-linux)
> -	# Target: Cell BE (PowerPC64 + SPU)
> -	# This implements a 'pseudo-native' GDB running on the
> -	# PPU side of the Cell BE and debugging the SPU side.
> -
> -	NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
> +		HAVE_NATIVE_GCORE_HOST=1
> +		;;
> +	esac
> +	;;
> +    sol2-64)
> +	case ${gdb_host_cpu} in
> +	    i386)
> +		# Host: Solaris x86_64
> +		NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
> +		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> +		HAVE_NATIVE_GCORE_HOST=1
> +		;;
> +	esac
> +	;;
> +    spu-linux)
> +	case ${gdb_host_cpu} in
> +	    powerpc)
> +		# Target: Cell BE (PowerPC64 + SPU)
> +		# This implements a 'pseudo-native' GDB running on the
> +		# PPU side of the Cell BE and debugging the SPU side.
> +		NAT_FILE=
> +		NAT_CDEPS=
> +		LOADLIBES=
> +		NATDEPFILES='spu-linux-nat.o fork-child.o inf-ptrace.o \
>  		      linux-procfs.o linux-ptrace.o linux-waitpid.o \
>  		      linux-personality.o linux-namespaces.o'
> +		;;
> +	esac
>  	;;
> -    esac
> -    ;;
> -  s390)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: S390, running Linux
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o s390-linux-nat.o \
> -		linux-thread-db.o proc-service.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-personality.o \
> -		linux-waitpid.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
> -  sh)
> -    case ${gdb_host} in
> -      nbsd)
> -	# Host: NetBSD/sh
> -	NATDEPFILES='fork-child.o inf-ptrace.o sh-nbsd-nat.o'
> -	;;
> -    esac
> -    ;;
> -  sparc)
> -    case ${gdb_host} in
> -      fbsd)
> -	# Host: FreeBSD/sparc64
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		fbsd-nat.o sparc-nat.o sparc64-nat.o sparc64-fbsd-nat.o \
> -		bsd-kvm.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      linux64)
> -	# Host: GNU/Linux UltraSPARC
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
> -		fork-child.o inf-ptrace.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      linux)
> -	# Host: GNU/Linux SPARC
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='sparc-nat.o sparc-linux-nat.o \
> -		fork-child.o inf-ptrace.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -      nbsd64)
> -	# Host: NetBSD/sparc64
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		sparc64-nbsd-nat.o sparc-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      nbsdelf)
> -	# Host: NetBSD/sparc ELF
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		sparc-nat.o sparc-nbsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      obsd64)
> -	# Host: OpenBSD/sparc64
> -	NATDEPFILES='fork-child.o inf-ptrace.o obsd-nat.o \
> -		sparc64-obsd-nat.o sparc-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      sol2)
> -	# Host: Solaris SPARC & UltraSPARC
> -	NAT_FILE='nm-sol2.h'
> -	NATDEPFILES='sparc-sol2-nat.o \
> -		fork-child.o \
> -		procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o'
> -	HAVE_NATIVE_GCORE_HOST=1
> -	;;
> -    esac
> -    ;;
> -  tilegx)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: Tilera TILE-Gx running GNU/Linux.
> -	NAT_FILE='config/nm-linux.h'
> -	NATDEPFILES='inf-ptrace.o fork-child.o \
> -		tilegx-linux-nat.o \
> -		proc-service.o linux-thread-db.o \
> -		linux-nat.o linux-osdata.o linux-fork.o \
> -		linux-procfs.o linux-ptrace.o linux-waitpid.o \
> -		linux-personality.o linux-namespaces.o'
> -
> -	# The dynamically loaded libthread_db needs access to symbols in the
> -	# gdb executable.
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
> -  vax)
> -    case ${gdb_host} in
> -      nbsdelf)
> -	# Host: NetBSD/vax ELF
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		vax-bsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -      obsd)
> -	# Host: OpenBSD/vax
> -	NATDEPFILES='fork-child.o inf-ptrace.o \
> -		vax-bsd-nat.o bsd-kvm.o'
> -
> -	LOADLIBES='-lkvm'
> -	;;
> -    esac
> -    ;;
> -  xtensa)
> -    case ${gdb_host} in
> -      linux)
> -	# Host: Xtensa, running GNU/Linux.
> -	NAT_FILE='config/nm-linux.h'
> -
> -	NATDEPFILES='inf-ptrace.o fork-child.o xtensa-linux-nat.o \
> -		linux-thread-db.o proc-service.o \
> -		linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
> -		linux-waitpid.o linux-personality.o linux-namespaces.o'
> -	NAT_CDEPS='$(srcdir)/proc-service.list'
> -
> -	LOADLIBES='-ldl $(RDYNAMIC)'
> -	;;
> -    esac
> -    ;;
>  esac
> -- 
> 2.9.3

Pushed.

e50f25ecdb24505bccb695e6c63add45f0032b9a

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-06 14:13       ` Sergio Durigan Junior
@ 2017-05-17 13:22         ` Pedro Alves
  2017-05-23 14:40           ` Sergio Durigan Junior
  0 siblings, 1 reply; 30+ messages in thread
From: Pedro Alves @ 2017-05-17 13:22 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Simon Marchi, John Baldwin

On 05/06/2017 03:13 PM, Sergio Durigan Junior wrote:
> On Friday, May 05 2017, Pedro Alves wrote:
> 
>> On 05/05/2017 05:29 AM, Sergio Durigan Junior wrote:
>>
>>> +# Native-target dependent makefile fragment comes in here.
>>> +@nat_extra_makefile_frag@
>>> +
>>

>> Apart from the naming issue and the spurious whitespace changes,
>> this looks fine to me.
> 
> Thanks, pushed with the nits addressed.
> 
> 21ea5acdd1bcfe89984b16b5bac730050c5cf05e

Catching up on older some emails, I noticed that the "extra" stayed
behind in the variable name.  I pushed this in as an obvious fix.

From 2b351b19efc8dd36ac8a8bda005c7411536b93ec Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Wed, 17 May 2017 13:56:19 +0100
Subject: [PATCH] nat_extra_makefile_frag -> nat_makefile_frag

gdb/ChangeLog:
2017-05-17  Pedro Alves  <palves@redhat.com>

	* Makefile.in (nat_extra_makefile_frag): Rename to ...
	(nat_makefile_frag): ... this.  All references updated.
	* configure.ac: Likewise.
	* configure.nat: Likewise.  Enhance comments.
	* configure: Regenerate.
---
 gdb/ChangeLog     |  8 ++++++++
 gdb/Makefile.in   |  2 +-
 gdb/configure     |  4 ++--
 gdb/configure.ac  |  4 ++--
 gdb/configure.nat | 11 ++++++-----
 5 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 980bd3f..f2068d2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2017-05-17  Pedro Alves  <palves@redhat.com>
+
+	* Makefile.in (nat_extra_makefile_frag): Rename to ...
+	(nat_makefile_frag): ... this.  All references updated.
+	* configure.ac: Likewise.
+	* configure.nat: Likewise.  Enhance comments.
+	* configure: Regenerate.
+
 2017-05-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* procfs.c (procfs_create_inferior): Change prototype to match
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 70d7d50..452f146 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -916,7 +916,7 @@ NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
 HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
 
 # Native-target dependent makefile fragment comes in here.
-@nat_extra_makefile_frag@
+@nat_makefile_frag@
 
 # End of native-target dependent variables.
 
diff --git a/gdb/configure b/gdb/configure
index 9aeef35..8df81ac 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -806,7 +806,7 @@ PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files='nat_extra_makefile_frag'
+ac_subst_files='nat_makefile_frag'
 ac_user_opts='
 enable_option_checking
 enable_maintainer_mode
@@ -16732,7 +16732,7 @@ fi
 
 
 # Import nat definitions.
-nat_extra_makefile_frag=/dev/null
+nat_makefile_frag=/dev/null
 if test "${gdb_native}" = "yes"; then
   . ${srcdir}/configure.nat
   nativefile=$NAT_FILE
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 05ea0c0..fd11cf0 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2200,7 +2200,7 @@ fi
 AC_SUBST(target_subdir)
 
 # Import nat definitions.
-nat_extra_makefile_frag=/dev/null
+nat_makefile_frag=/dev/null
 if test "${gdb_native}" = "yes"; then
   . ${srcdir}/configure.nat
   nativefile=$NAT_FILE
@@ -2214,7 +2214,7 @@ AC_SUBST(MH_CFLAGS)
 AC_SUBST(XM_CLIBS)
 AC_SUBST(NAT_GENERATED_FILES)
 AC_SUBST(HAVE_NATIVE_GCORE_HOST)
-AC_SUBST_FILE(nat_extra_makefile_frag)
+AC_SUBST_FILE(nat_makefile_frag)
 
 if test x"${gdb_osabi}" != x ; then
     AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
diff --git a/gdb/configure.nat b/gdb/configure.nat
index 4bf06c5..e6c96da 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -36,16 +36,17 @@
 # HAVE_NATIVE_GCORE_HOST - Whether gcore should be installed on this
 #                          native target.
 #
-# nat_extra_makefile_frag - File containing extra fragments of
-#                           Makefile that will be used by this native
-#                           target.
+# nat_makefile_frag - Name of the (optional) Makefile fragment file
+#                     required to build the native target.  The
+#                     fragment is incorporated into the Makefile that
+#                     configure constructs from Makefile.in.
 #
 # Notes:
 #
 # - To avoid shell expansion of variables, declare them with single
 #   quotes.
 #
-# - nat_extra_makefile_frag should contain the full path of the file.
+# - nat_makefile_frag must contain the full path of the file.
 
 
 # This first case is useful for filling default values for each
@@ -195,7 +196,7 @@ case ${gdb_host} in
 
 		XM_CLIBS='-lshouldbeinlibc'
 
-		nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
+		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
 		;;
 	esac
 	;;
-- 
2.5.5


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-06 14:04           ` Sergio Durigan Junior
@ 2017-05-17 14:03             ` Pedro Alves
  0 siblings, 0 replies; 30+ messages in thread
From: Pedro Alves @ 2017-05-17 14:03 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches, Simon Marchi, John Baldwin

On 05/06/2017 03:04 PM, Sergio Durigan Junior wrote:
> On Friday, May 05 2017, Pedro Alves wrote:
> 
>>>>> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
>>>>> similarity index 58%
>>>>> rename from gdb/config/i386/i386gnu.mh
>>>>> rename to gdb/config/i386/i386gnu-extra.mh
>>>>
>>>> Why the "extra" rename ?  If anything, I'd expect i386gnu.mh -> i386gnu.mn?
>>>
>>> git showed this as a rename, but it's really a new file.  
>>
>> That's kind of stretching it.  :-)
> 
> Well, my intention from the beginning was to introduce this as a new
> file.  I'm not stretching it my intention :-).
> 
>>> i386gnu.mh is
>>> gone, like every other previous *.mh file.  Instead of using the old
>>> name, I decided to add the "-extra" suffix to make it explicit that the
>>> file contains only extra definitions, and is not the only thing taken
>>> into account for this native target.
>>
>> I find the "extra" redundant -- the way I see it, some targets have a 
>> makefile fragment file that needs to be glued into the Makefile,
>> others don't.  There's no "main fragment, and then maybe some other/extra ones".
> 
> OK, I see your rationale now.  In my previous understanding, the main
> fragment was being generated from configure.nat, which is just a
> copy-and-paste from the old *.mh files. 

And I see yours now.

> But one could also argue that
> there's not actual fragment there, since we just have variables being
> AC_SUBST'ed.

Right, that's not what is usually called a fragment.  Note that Makefile
"fragments" are a well known term in the GNU toolchain's build
machinery .  See e.g., old GCC docs describing their fragment files:

  https://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc_19.html

> 
>>> I initially disagree with your proposal to rename it to i386gnu.mn, so
>>> I'm keeping it this way.  
>>
>> Why do you disagree?  ".mh" obviously meant "makefile + host",
>> but the fragment file is now described as being about the
>> native target.  Hence, "makefile + native => .mn".
> 
> Ahhh.  You're not going to believe it, but until now I was not linking
> the fact that ".mh" meant "makefile + host".  I obviously agree that the
> new extension should be .mn.

:-)

Note this is described in the internal's manual urls I pointed at
before:

  https://sourceware.org/gdb/wiki/Internals%20Adding-a-New-Host
  https://sourceware.org/gdb/wiki/Internals%20Native-Debugging

"MaintainerÂ’s note: The .mh suffix is because this file originally contained Makefile fragments for hosting GDB on machine xyz. While the file is no longer used for this purpose, the .mh suffix remains. Perhaps someone will eventually rename these fragments so that they have a .mn suffix."

These pages are now in need of an update.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)
  2017-05-17 13:22         ` Pedro Alves
@ 2017-05-23 14:40           ` Sergio Durigan Junior
  0 siblings, 0 replies; 30+ messages in thread
From: Sergio Durigan Junior @ 2017-05-23 14:40 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches, Simon Marchi, John Baldwin

On Wednesday, May 17 2017, Pedro Alves wrote:

> On 05/06/2017 03:13 PM, Sergio Durigan Junior wrote:
>> On Friday, May 05 2017, Pedro Alves wrote:
>> 
>>> On 05/05/2017 05:29 AM, Sergio Durigan Junior wrote:
>>>
>>>> +# Native-target dependent makefile fragment comes in here.
>>>> +@nat_extra_makefile_frag@
>>>> +
>>>
>
>>> Apart from the naming issue and the spurious whitespace changes,
>>> this looks fine to me.
>> 
>> Thanks, pushed with the nits addressed.
>> 
>> 21ea5acdd1bcfe89984b16b5bac730050c5cf05e
>
> Catching up on older some emails, I noticed that the "extra" stayed
> behind in the variable name.  I pushed this in as an obvious fix.

Thanks for that.

> From 2b351b19efc8dd36ac8a8bda005c7411536b93ec Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Wed, 17 May 2017 13:56:19 +0100
> Subject: [PATCH] nat_extra_makefile_frag -> nat_makefile_frag
>
> gdb/ChangeLog:
> 2017-05-17  Pedro Alves  <palves@redhat.com>
>
> 	* Makefile.in (nat_extra_makefile_frag): Rename to ...
> 	(nat_makefile_frag): ... this.  All references updated.
> 	* configure.ac: Likewise.
> 	* configure.nat: Likewise.  Enhance comments.
> 	* configure: Regenerate.
> ---
>  gdb/ChangeLog     |  8 ++++++++
>  gdb/Makefile.in   |  2 +-
>  gdb/configure     |  4 ++--
>  gdb/configure.ac  |  4 ++--
>  gdb/configure.nat | 11 ++++++-----
>  5 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 980bd3f..f2068d2 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,11 @@
> +2017-05-17  Pedro Alves  <palves@redhat.com>
> +
> +	* Makefile.in (nat_extra_makefile_frag): Rename to ...
> +	(nat_makefile_frag): ... this.  All references updated.
> +	* configure.ac: Likewise.
> +	* configure.nat: Likewise.  Enhance comments.
> +	* configure: Regenerate.
> +
>  2017-05-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>  
>  	* procfs.c (procfs_create_inferior): Change prototype to match
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 70d7d50..452f146 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -916,7 +916,7 @@ NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
>  HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
>  
>  # Native-target dependent makefile fragment comes in here.
> -@nat_extra_makefile_frag@
> +@nat_makefile_frag@
>  
>  # End of native-target dependent variables.
>  
> diff --git a/gdb/configure b/gdb/configure
> index 9aeef35..8df81ac 100755
> --- a/gdb/configure
> +++ b/gdb/configure
> @@ -806,7 +806,7 @@ PACKAGE_TARNAME
>  PACKAGE_NAME
>  PATH_SEPARATOR
>  SHELL'
> -ac_subst_files='nat_extra_makefile_frag'
> +ac_subst_files='nat_makefile_frag'
>  ac_user_opts='
>  enable_option_checking
>  enable_maintainer_mode
> @@ -16732,7 +16732,7 @@ fi
>  
>  
>  # Import nat definitions.
> -nat_extra_makefile_frag=/dev/null
> +nat_makefile_frag=/dev/null
>  if test "${gdb_native}" = "yes"; then
>    . ${srcdir}/configure.nat
>    nativefile=$NAT_FILE
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 05ea0c0..fd11cf0 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2200,7 +2200,7 @@ fi
>  AC_SUBST(target_subdir)
>  
>  # Import nat definitions.
> -nat_extra_makefile_frag=/dev/null
> +nat_makefile_frag=/dev/null
>  if test "${gdb_native}" = "yes"; then
>    . ${srcdir}/configure.nat
>    nativefile=$NAT_FILE
> @@ -2214,7 +2214,7 @@ AC_SUBST(MH_CFLAGS)
>  AC_SUBST(XM_CLIBS)
>  AC_SUBST(NAT_GENERATED_FILES)
>  AC_SUBST(HAVE_NATIVE_GCORE_HOST)
> -AC_SUBST_FILE(nat_extra_makefile_frag)
> +AC_SUBST_FILE(nat_makefile_frag)
>  
>  if test x"${gdb_osabi}" != x ; then
>      AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
> diff --git a/gdb/configure.nat b/gdb/configure.nat
> index 4bf06c5..e6c96da 100644
> --- a/gdb/configure.nat
> +++ b/gdb/configure.nat
> @@ -36,16 +36,17 @@
>  # HAVE_NATIVE_GCORE_HOST - Whether gcore should be installed on this
>  #                          native target.
>  #
> -# nat_extra_makefile_frag - File containing extra fragments of
> -#                           Makefile that will be used by this native
> -#                           target.
> +# nat_makefile_frag - Name of the (optional) Makefile fragment file
> +#                     required to build the native target.  The
> +#                     fragment is incorporated into the Makefile that
> +#                     configure constructs from Makefile.in.
>  #
>  # Notes:
>  #
>  # - To avoid shell expansion of variables, declare them with single
>  #   quotes.
>  #
> -# - nat_extra_makefile_frag should contain the full path of the file.
> +# - nat_makefile_frag must contain the full path of the file.
>  
>  
>  # This first case is useful for filling default values for each
> @@ -195,7 +196,7 @@ case ${gdb_host} in
>  
>  		XM_CLIBS='-lshouldbeinlibc'
>  
> -		nat_extra_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
> +		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
>  		;;
>  	esac
>  	;;
> -- 
> 2.5.5

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2017-05-23 14:40 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 20:23 [PATCH] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
2017-04-25 21:08 ` John Baldwin
2017-05-01 18:45 ` Sergio Durigan Junior
2017-05-02  2:44 ` Simon Marchi
2017-05-02 14:57   ` John Baldwin
2017-05-02 17:01     ` Simon Marchi
2017-05-02 19:28   ` Sergio Durigan Junior
2017-05-02 20:16     ` Simon Marchi
2017-05-02 21:30       ` Pedro Alves
2017-05-02 22:17       ` Sergio Durigan Junior
2017-05-03  3:49 ` [PATCH v2 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
2017-05-03  3:49   ` [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
2017-05-04 16:16     ` Pedro Alves
2017-05-05  3:58       ` Sergio Durigan Junior
2017-05-05  9:41         ` Pedro Alves
2017-05-06 14:04           ` Sergio Durigan Junior
2017-05-17 14:03             ` Pedro Alves
2017-05-03  3:49   ` [PATCH v2 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
2017-05-03 16:45     ` John Baldwin
2017-05-03 17:28       ` Sergio Durigan Junior
2017-05-04 16:34     ` Pedro Alves
2017-05-05  4:23       ` Sergio Durigan Junior
2017-05-05  4:31 ` [PATCH v3 0/2] Introduce gdb/configure.nat Sergio Durigan Junior
2017-05-05  4:31   ` [PATCH v3 2/2] Rearrange gdb/configure.nat to make it simpler and less redundant Sergio Durigan Junior
2017-05-06 14:13     ` Sergio Durigan Junior
2017-05-05  4:32   ` [PATCH v3 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Sergio Durigan Junior
2017-05-05 16:35     ` Pedro Alves
2017-05-06 14:13       ` Sergio Durigan Junior
2017-05-17 13:22         ` Pedro Alves
2017-05-23 14:40           ` Sergio Durigan Junior

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).