[BACK]Return to UPDATING CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src

Annotation of src/UPDATING, Revision 1.40

1.40    ! lukem       1: $NetBSD: UPDATING,v 1.39 2001/10/04 04:27:48 jmc Exp $
1.1       abs         2:
                      3: This file is intended to be a brief introduction to the build
                      4: process and a reference on what to do if something doesn't work.
                      5:
                      6: For a more detailed description see Makefile.
                      7:
                      8: Recent changes:
                      9: ^^^^^^^^^^^^^^^
1.40    ! lukem      10:
        !            11: 20011006:
        !            12:        /etc/mtree/NetBSD.dist has been updated to take advantage of
        !            13:        absolute path support added to mtree(8). Older mtree(8)s don't
        !            14:        understand the format.
        !            15:
        !            16:        Solution: update and reinstall usr.sbin/mtree
1.39      jmc        17:
                     18: 20011004:
                     19:
                     20:        Crunchgen has been updated to work via reach-over makefiles. Updating
                     21:        is suggested before running a snapshot build
1.36      tv         22:
                     23: 20010922:
                     24:        The new toolchain is enabled on i386.  This new build method
1.38      tron       25:        is intended to make all the upgrade issues elsewhere in UPDATING
1.36      tv         26:        obsolete (stay tuned...).
                     27:
1.37      kristerw   28:        i386 platform builds must now set TOOLDIR in mk.conf or the
1.36      tv         29:        environment in order to build the system.  This is a pathname
                     30:        where host build tools will be installed, and must NOT be
                     31:        the same as src/tools.
                     32:
                     33:        (Optionally, USETOOLS=no can be set in the environment if you
                     34:        wish to avoid using the separate host toolchain for building a
                     35:        subtree.  Otherwise, this will default to "yes" automatically.)
1.35      thorpej    36:
                     37: 20010915:
                     38:        The new "ubcperf" code committed by Chuck Silvers removed
                     39:        a header file, uvm/uvm_vnode.h.  There may be stale .depend
                     40:        files that still reference this file.
                     41:
                     42:        Solution: "make cleandir && make dependall" in affected
                     43:        directories.
1.31      enami      44:
                     45: 20010803:
                     46:        grep.info is now built from grep.texi using makeinfo.  Since it
                     47:        requires makeinfo v4.0, you need to install new texinfo before
                     48:        building gnu/usr.bin/grep.  To install new texinfo, please follow
                     49:        the instruction described in 20010726 entry.
1.30      enami      50:
                     51: 20010803:
                     52:        (i386 only): i386 kernel now uses new instructions like fxsave which
                     53:        old gas doesn't understand.  To build the kernel successfuly, you
                     54:        need to build and install new gas (gnu/usr.bin/gas.new).
1.29      bjh21      55:
                     56: 20010731:
                     57:        Bootloader update on ELF platforms.  DDB in kernels from before
                     58:        this will be unable to read symbol tables provided by newer
                     59:        bootloaders.
1.27      assar      60:
                     61: 20010726:
                     62:        Texinfo was updated to 4.0.  To avoid failures when trying to
1.28      assar      63:        build the included texinfo files, do:
                     64:
                     65:        cd src/gnu/usr.bin/texinfo
                     66:        make MKINFO=no dependall install
1.25      thorpej    67:
                     68: 20010718:
                     69:
                     70:        Enabled correct .init/.fini processing in crt0.  The way this
                     71:        was done was to change a -I directive to cc(1), which means
                     72:        make(1) will have a stale dependency (it will be checking the
                     73:        timestamp on the wrong "dot_init.h").
                     74:
                     75:        The symptom you will see is that new programs die with SIGSEGV
                     76:        if you have a stale dependency.
                     77:
                     78:        Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
                     79:        before starting your build.
1.26      thorpej    80:
                     81: 20010628:
                     82:
                     83:        A construct was added to uvm_page.h that uncovered a bug
                     84:        in lint(1).  If you get a warning/error about a non-portable
                     85:        bitfield, update your lint(1) before proceeding.
1.21      jmc        86:
                     87: 20010226:
                     88:
1.22      jmc        89:        Added named user/group to system. Need to hand add this in or builds
1.21      jmc        90:        will break as mtree aborts early.
                     91:
                     92:        To work around add by hand:
                     93:
                     94:        named:*:14:
                     95:
1.22      jmc        96:        to /etc/group and add:
                     97:
                     98:        named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
                     99:
                    100:        to master.passwd (use vipw for instance if doing by hand).
                    101:
                    102:        Now a make build should progress.
1.18      jmc       103:
                    104: 20010219:
                    105:        get/setprogname() added. Any hostprog's that may use this will need
1.20      jmc       106:         to be bootstrapped manually until the host system is current.
1.18      jmc       107:
                    108:         Known problems: sys/arch/macppc/stand/fixcoff
1.19      cgd       109:                        usr.sbin/config (adding -DMAKE_BOOTSTRAP to
                    110:                          CFLAGS and rebuilding should work)
1.20      jmc       111:                        usr.sbin/mdsetimage - Build a static copy if
                    112:                          building a snapshot before fully bootstrapped.
1.15      christos  113:
                    114: 20010204:
                    115:        prepare the code to compile with stricter gcc flags. in
                    116:        particular start eliminating redundant declarations. Yacc
                    117:        needs to be installed before make build.
1.10      christos  118:
                    119: 20010114:
                    120:        introduce .if commands(target) in make(1). You need to
                    121:        bring everything up-to-date first, then without installing
1.23      tron      122:        anything make and install in usr.bin/make, then proceed
1.10      christos  123:        with make build.
1.9       sommerfe  124:
                    125: 20010101:
                    126:        bsd.subdir.mk committed 20001230 had a bug which caused
                    127:        afterinstall targets to run too soon; update again.
1.8       sommerfe  128:
                    129: 20001230:
                    130:        New share/mk files needed to support .WAIT in SUBDIR variables.
                    131:        If you get make errors,
                    132:                (cd share/mk; make install)
                    133:        Also, PRINTOBJDIR has changed and is now used more heavily.
1.6       ad        134:
                    135: 20001019:
1.7       ad        136:        The `ca' device driver has been replaced by `ld'; although the
1.6       ad        137:        major and minor numbers haven't changed, you should update your /dev
                    138:        directory.
1.1       abs       139:
1.4       itojun    140: 20000929:
                    141:        The following make directives are obsoleted.
                    142:        MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
                    143:        By default, RSA is built into libcrypto.  IDEA and RC5 will not be
1.16      wiz       144:        built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
1.4       itojun    145:        additional library libcrypto_{idea,rc5}.
                    146:
1.1       abs       147: 20000623:
                    148:        MKCRYPTO and friends added to share/mk/bsd.own.mk.
                    149:        'cd share/mk ; make install' needed before make build.
                    150:
                    151:
                    152: Hints for a more successful build:
                    153: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2       mrg       154:     Build a new kernel first:
                    155:        This makes sure that any new system calls or features
                    156:           expected by the new userland will be present.  This
                    157:           helps to avoid critical errors when upgrading.
1.1       abs       158:     Use object directories:
                    159:        This helps to keep stale object
                    160:           files from polluting the build if a Makefile "forgets"
                    161:           about one.  It also makes it easier to clean up after
                    162:           a build.  It's also necessary if you want to use the
                    163:           same source tree for multiple machines.
                    164:           To use object directories:
                    165:            a) cd /usr/src ; make cleandir
1.2       mrg       166:            b) Add "OBJMACHINE=yes" to /etc/mk.conf
                    167:            c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1       abs       168:            d) cd /usr/src ; make build
1.2       mrg       169:           Note that running "make obj" in a directory will create
                    170:           in obj.$MACHINE directory.
1.1       abs       171:     Build to a DESTDIR:
                    172:        This helps to keep old
                    173:           installed files (especially libraries) from interfering
                    174:           with the new build.
                    175:           To build to a DESTDIR, set the DESTDIR environment
1.2       mrg       176:           variable before running make build.  It should be set to
                    177:           the pathname of an initially empty directory.
1.1       abs       178:           Problems: you might need to update critical utilities
                    179:                without using DESTDIR since nothing is executed
                    180:                from what is installed in DESTDIR.
                    181:                (See critical utils, below)
                    182:     Build often:
                    183:        This keeps critical utilities current enough to not choke
                    184:        on any other part of the source tree that depends on up to
                    185:        date functionality.
                    186:
                    187: What to do if things don't work:
                    188: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    189: When things don't work there is usually a few things that commonly
                    190: should be done.
                    191:     1) make includes
                    192:        This should be done automatically by make build.
                    193:     2)  cd share/mk && make install
                    194:        Again, automatically done by make build.
                    195:
                    196: Failsafe rebuild of a small part of the tree:
                    197: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    198: To make sure you rebuild something correctly you want to do
                    199: something like the following:
                    200:     1)  Make sure the includes and .mk files are up to date.
                    201:     2)  Make sure any program used to build the particular
                    202:        utility is up to date.  (yacc, lex, etc...)
                    203:     3)  cd ...path/to/util...
                    204:        make cleandir
                    205:        rm ...all obj directories...
                    206:        make cleandir                   # yes, again
                    207:        make obj
                    208:        make depend && make
                    209:
                    210: Failsafe rebuild of the entire tree:
                    211: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    212: If you really want to make sure the source tree is clean and
1.2       mrg       213: ready for a build try the following.  Note that sourcing /etc/mk.conf
                    214: (a make(1) Makefile) in this manner is not right, and will not work
                    215: for anyone who uses any make(1) features in /etc/mk.conf.
1.1       abs       216:
                    217: ---cut here---
                    218: #!/bin/sh
                    219: . /etc/mk.conf
                    220:
                    221: if [ -z $BSDSRCDIR ] ; then
                    222:     BSDSRCDIR=/usr/src
                    223: fi
                    224: if [ \! -d $BSDSRCDIR ] ; then
                    225:     echo Unable to find sources
                    226:     exit 1
                    227: fi
                    228: find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
                    229:
                    230: if [ -z $BSDOBJDIR ] ; then
                    231:     BSDOBJDIR=/usr/obj
                    232: fi
                    233: if [ -d $BSDOBJDIR ] ; then
                    234:     rm -rf $BSDOBJDIR
                    235: fi
                    236:
                    237: cd $BSDSRCDIR && make cleandir
                    238:
                    239: ---cut here---
                    240:
                    241: Critical utilities:
                    242: ^^^^^^^^^^^^^^^^^^^
                    243:        gnu/usr.bin/egcs
1.3       itojun    244:        usr.bin/compile_et
1.1       abs       245:        usr.bin/make
                    246:        usr.bin/yacc
                    247:        usr.bin/lex
1.11      lukem     248:        usr.bin/xlint
1.2       mrg       249:        usr.sbin/config
1.1       abs       250:
1.34      simonb    251: Other problems and possible solutions:
1.1       abs       252: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    253: Symptom:Unreasonable compiler errors.
                    254: Fix:   Rebuild gnu/usr.bin/egcs
                    255:
                    256: Symptom:Complaints involving a Makefile.
1.17      erh       257: Fix:   Rebuild usr.bin/make:
                    258:        cd usr.bin/make && make && make install
                    259:         Or, a failsafe method if that doesn't work:
                    260:        cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
                    261:
1.1       abs       262: Fix:   Make sure .mk files are up to date.
                    263:        cd share/mk && make install
1.2       mrg       264:
                    265: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
                    266: Fix:   Rebuild usr.sbin/config
1.1       abs       267:
                    268: Symptom:
                    269: Fix:   Rebuild usr.bin/yacc
                    270:
                    271: Symptom:
                    272: Fix:   Rebuild usr.bin/lex
                    273:
                    274: Symptom:
                    275: Fix:   rm /usr/lib/libbfd.a
1.4       itojun    276:
                    277: Symptom:Obsolete intermediate files are used during compilation
                    278: Fix:   Try the following sequence of commands in the directory in question.
                    279:        make cleandir; rm `make print-objdir`; make cleandir; make obj
                    280:        (If you built the tree without "make obj" in the past, obsolete files
                    281:        may remain.  The command tries to clean everything up)
1.5       wiz       282:
                    283: Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
                    284: Fix:   Rebuild and install usr.bin/menuc
1.12      itojun    285:
                    286: Symptom:mklocale not found during build in share/locale/ctype
                    287: Fix:   Build and install usr.bin/mklocale
1.13      dogcow    288:
                    289: Symptom:undefined reference to `__assert13'
                    290: Fix:    Rebuild and install lib/libc
                    291:
1.19      cgd       292: Symptom:usr.sbin/config fails to build.
                    293: Fix:   Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
1.13      dogcow    294:
1.19      cgd       295: Symptom:undefined reference to `getprogname' or `setprogname'
                    296: Fix:    Rebuild and install lib/libc
1.24      abs       297:
                    298: Symptom:lint does not understand the '-X' option
                    299: Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint

CVSweb <webmaster@jp.NetBSD.org>