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