README.mknative revision 1.1 1 $NetBSD: README.mknative,v 1.1 2006/06/02 15:33:34 nathanw Exp $
2
3 This file describes how to use the cross-compiler to generate the
4 native files for GDB on a target platform.
5
6 NOTE: DO NOT RUN "mknative" BY HAND! It requires the Makefile in this
7 directory to set up certain environments first.
8
9 Since libc's features change over time, the config.h files can change as a
10 result; thus the instructions below are the same no matter whether
11 bootstrapping on a cross or native host. This is important: even on a
12 "native" host, you should bootstrap the toolchain by building from an
13 up-to-date source tree to a $DESTDIR using the exact same instructions.
14
15 In these notes, MACHINE is the $MACHINE of the target. These files can be
16 cross-generated. Though a $MACHINE_ARCH all uses the same config files, you
17 must pick a specific $MACHINE so that building the requisite bits below will
18 work.
19
20 1. 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
23 2. Build and install a cross toolchain (via "build.sh -m MACHINE tools").
24
25 3. At top level, do "nbmake-MACHINE do-distrib-dirs obj includes".
26
27 4. In src/gnu/lib/crtstuff3 do "nbmake-MACHINE depend all install"
28
29 5. In src/lib/csu, src/gnu/lib/libgcc3, and src/lib, do "nbmake-MACHINE all install".
30
31 6. In src/tools/gdb, do "nbmake-MACHINE obj native-gdb".
32
33 This will do a full configury in ${.OBJDIR}/.native that is a "Canadian"
34 cross toolchain (--build reflects the host platform, but --host and
35 --target are the target). The result is a tree that would build a
36 native-to-NetBSD GDB on a cross host, and mknative pulls glue data
37 from this.
38
39 7. Try out a full build using "nbmake-MACHINE" in
40 src/gnu/usr.bin/gdb6; the result should include a native GDB.
41
42 8. If all is well, commit the glue files and directories added to
43 src/gnu/usr.bin/gdb6.
44