Name Date Size #Lines LOC

..05-Jun-2023-

MakefileH A D09-May-20234 KiB13097

README.mknativeH A D08-May-20221.9 KiB4531

mknative-gdbH A D08-May-20226.2 KiB252177

mknative-gdb.oldH A D08-May-20224.3 KiB175119

README.mknative

1$NetBSD: README.mknative,v 1.7 2020/10/09 23:44:46 rin Exp $
2
3This file describes how to use the cross-compiler to generate the
4native files for GDB on a target platform.
5
6NOTE:  DO NOT RUN "mknative" BY HAND!  It requires the Makefile in this
7directory to set up certain environments first.
8
9Since libc's features change over time, the config.h files can change as a
10result; thus the instructions below are the same no matter whether
11bootstrapping on a cross or native host.  This is important: even on a
12"native" host, you should bootstrap the toolchain by building from an
13up-to-date source tree to a $DESTDIR using the exact same instructions.
14
15In these notes, MACHINE is the $MACHINE of the target.  These files can be
16cross-generated.  Though a $MACHINE_ARCH all uses the same config files, you
17must pick a specific $MACHINE so that building the requisite bits below will
18work.
19
201. Set MKMAINTAINERTOOLS=yes in mk.conf.  (Needed so that src/tools/gettext
21   gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.)
22
232. Build and install a cross toolchain (via "build.sh -U -m MACHINE tools").
24
253. At top level, do "nbmake-MACHINE obj do-distrib-dirs includes".
26
274. At top level, do "nbmake-MACHINE -C lib build_install".
28
295. In src/tools/gdb, do "nbmake-MACHINE obj native-gdb".
30
31   This will do a full configury in ${.OBJDIR}/.native that is a "Canadian"
32   cross toolchain (--build reflects the host platform, but --host and
33   --target are the target).  The result is a tree that would build a
34   native-to-NetBSD GDB on a cross host, and mknative pulls glue data
35   from this.
36
37   NOTE: this step writes files under src/external/gpl3/gdb/lib, so you
38   need to do it in a writable src tree!
39
406. Try out a full build using "nbmake-MACHINE" in
41   src/external/gpl3/gdb; the result should include a native GDB.
42
437. If all is well, commit the glue files and directories added to
44   src/external/gpl3/gdb/lib.
45