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

Annotation of src/UPDATING, Revision 1.41

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

CVSweb <webmaster@jp.NetBSD.org>