NetBSD/tools/gdb
martin 29d99cdb20 Pull up following revision(s) (requested by christos in ticket #796):
tools/mdsetimage/Makefile: revision 1.15
	tools/compat/Makefile: revision 1.82
	tools/gdb/Makefile: revision 1.35
	tools/lorder/Makefile: revision 1.13
	tools/gcc/Makefile: revision 1.85
	tools/dtc/Makefile: revision 1.3
	tools/cvslatest/Makefile: revision 1.2
	tools/ctfmerge/Makefile: revision 1.8
	tools/libelf/Makefile: revision 1.9
	tools/libdwarf/Makefile: revision 1.8
	tools/ctfconvert/Makefile: revision 1.7
	tools/makekeys/Makefile: revision 1.2
	tools/gettext/Makefile: revision 1.7
	tools/binstall/Makefile: revision 1.12
	tools/libfdt/Makefile: revision 1.3
	tools/libctf/Makefile: revision 1.7
	tools/binutils/Makefile: revision 1.27
	tools/mandoc/Makefile: revision 1.11
	tools/Makefile.host: revision 1.32
	tools/dbsym/Makefile: revision 1.13
	tools/genassym/Makefile: revision 1.7
	tools/Makefile.inc: revision 1.14

PR/53238: Robert Elz: Disable MKREPRO in tools; the host compiler might
not support the necessary options. This is done thusly:

1. Set MKREPRO=no in Makefile.host. This handles all the Makefiles that
   use it and don't include bsd.own.mk.
2. Create Makefile.inc and set MKREPRO=no in it. Change the Makefiles that
   include bsd.own.mk, to include bsd.init.mk which includes Makefile.inc
   first. This will also allow us to control other tools options from a
   single location if we need to.

XXX: pullup-8
2018-05-05 19:25:55 +00:00
..
Makefile Pull up following revision(s) (requested by christos in ticket #796): 2018-05-05 19:25:55 +00:00
README.mknative
mknative-gdb pass GDB_MACHINE_ARCH to mknative-gdb and use that as the subdir. 2016-10-16 04:37:42 +00:00

README.mknative

$NetBSD: README.mknative,v 1.5 2011/09/26 02:36:19 christos Exp $

This file describes how to use the cross-compiler to generate the
native files for GDB on a target platform.

NOTE:  DO NOT RUN "mknative" BY HAND!  It requires the Makefile in this
directory to set up certain environments first.

Since libc's features change over time, the config.h files can change as a
result; thus the instructions below are the same no matter whether
bootstrapping on a cross or native host.  This is important: even on a
"native" host, you should bootstrap the toolchain by building from an
up-to-date source tree to a $DESTDIR using the exact same instructions.

In these notes, MACHINE is the $MACHINE of the target.  These files can be
cross-generated.  Though a $MACHINE_ARCH all uses the same config files, you
must pick a specific $MACHINE so that building the requisite bits below will
work.

1. Set MKMAINTAINERTOOLS=yes in mk.conf.  (Needed so that src/tools/gettext
   gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.)

2. Build and install a cross toolchain (via "build.sh -m MACHINE tools").

3. At top level, do "nbmake-MACHINE do-distrib-dirs obj includes".

4. In src/gnu/lib/crtstuff4 do "nbmake-MACHINE depend all install"

5. In src/lib/csu, src/gnu/lib/libgcc4, and src/lib, do
   "nbmake-MACHINE all install".

6. In src/tools/gdb, do "nbmake-MACHINE obj native-gdb".

   This will do a full configury in ${.OBJDIR}/.native that is a "Canadian"
   cross toolchain (--build reflects the host platform, but --host and
   --target are the target).  The result is a tree that would build a
   native-to-NetBSD GDB on a cross host, and mknative pulls glue data
   from this.

   NOTE: this step writes files under src/external/gpl3/gdb/bin/gdb, so you
   need to do it in a writable src tree!

7. Try out a full build using "nbmake-MACHINE" in
   src/external/gpl3/bin/gdb; the result should include a native GDB.

8. If all is well, commit the glue files and directories added to
   src/external/gpl3/gdb/bin/gdb.