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

Annotation of src/UPDATING, Revision 1.55

1.55    ! itojun      1: $NetBSD: UPDATING,v 1.54 2002/03/11 04:57:55 itojun 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.55    ! itojun     10: 20020319:
        !            11:        raw IPv6 socket now makes strict checking for sa_family and sa_len
        !            12:        on send(2) operation.  be sure to have sbin/rtsol and usr.sbin/rtsold
        !            13:        newer than November 2001 when you upgrade the kernel.
        !            14:
1.54      itojun     15: 20020311:
                     16:        ssh configuration files were moved from /etc to /etc/ssh.  Beware
                     17:        if you restart your machine from remote.  Note that sshd.conf needs
                     18:        to be changed (due to the use of "/etc" inside).
                     19:
                     20: 20020223:
1.53      matt       21:        Users of the VAX port will need to rebuild and install gas
                     22:        so it deal with the now present register prefix used in all
                     23:        the VAX assembly files.
                     24:
1.50      itojun     25: 20020118:
                     26:
                     27:        ntpd user/group has been added.  Need to hand add this in or builds
                     28:        will break as mtree aborts early.
                     29:
                     30:        Add the following into /etc/group:
                     31:
                     32:        ntpd:*:15:
                     33:
                     34:        and the following to /etc/master.passwd (via vipw):
                     35:
                     36:        ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
                     37:
1.49      jmc        38: 20011207:
                     39:
                     40:        If you're attempting to build a snapshot on sparc64 and are getting
                     41:        reloc errors from the toolchain groff binary this means your native
                     42:        toolchain has some broken C++ bits.
                     43:
                     44:        To fix:
                     45:
                     46:        Build a new toolchain (i.e. build.sh -t)
                     47:        Use the new toolchain to build and install natively (i.e. /usr/lib)
                     48:
                     49:        gnu/lib/libgcc
1.51      pooka      50:        gnu/lib/libstdc++
1.49      jmc        51:
                     52:        After this a snapshot will be able to be built.
                     53:
1.47      jmc        54: 20011201:
                     55:        In order for a sparc64 build to work you must have a working awk. If
                     56:        you've built and installed a system with the new toolchain up to this
1.52      wiz        57:        point you do not have a working awk as its ability to do floating
1.47      jmc        58:        point is broken.
                     59:
                     60:        To build:
                     61:
                     62:        remake and install gnu/lib/libgcc
                     63:        remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
1.48      jmc        64:        against the new libgcc.a)
1.47      jmc        65:
1.46      thorpej    66: 20011128:
                     67:        Kernel config information was changed to use defflag in
                     68:        the various "files" files.  Bug fixes to config(8) are
                     69:        required in order for this to work properly.  Make sure
                     70:        to build and install in usr.sbin/config before attempting
                     71:        to build a new kernel.
                     72:
1.45      yamt       73: 20011030:
                     74:        libc/locale/wcstod.c now needs new lint(1). Update lint(1)
                     75:        before building libc.
1.43      mason      76:
1.44      tv         77: 20011029:
                     78:        The new document BUILDING.mdoc (view with nroff | more, or
                     79:        see pre-generated .txt and .html versions) describes the build
                     80:        procedure in great detail.  BUILDING, and the USE_NEW_TOOLCHAIN
                     81:        build process, are intended in the long run to replace this
                     82:        manual update log.
                     83:
                     84:        Users building a USE_NEW_TOOLCHAIN system should read the
                     85:        BUILDING document for caveats.  Generally, BUILDING supersedes
                     86:        UPDATING for these systems, as tool updating is taken care of
                     87:        by the new build system.
1.42      perry      88:
                     89: 20011028:
                     90:        src/etc/Makefile now needs install to be able to handle
                     91:        symlinks that point to nowhere. A bug in install that
                     92:        prevented this was corrected.
                     93:
                     94:        Solution: update and reinstall usr.bin/xinstall
                     95:        Better Solution: Use the new toolchain and it will just work
                     96:        for you.
1.40      lukem      97:
                     98: 20011006:
                     99:        /etc/mtree/NetBSD.dist has been updated to take advantage of
                    100:        absolute path support added to mtree(8). Older mtree(8)s don't
                    101:        understand the format.
                    102:
                    103:        Solution: update and reinstall usr.sbin/mtree
1.39      jmc       104:
                    105: 20011004:
                    106:        Crunchgen has been updated to work via reach-over makefiles. Updating
                    107:        is suggested before running a snapshot build
1.36      tv        108:
1.35      thorpej   109: 20010915:
                    110:        The new "ubcperf" code committed by Chuck Silvers removed
                    111:        a header file, uvm/uvm_vnode.h.  There may be stale .depend
                    112:        files that still reference this file.
                    113:
                    114:        Solution: "make cleandir && make dependall" in affected
                    115:        directories.
1.31      enami     116:
                    117: 20010803:
                    118:        grep.info is now built from grep.texi using makeinfo.  Since it
                    119:        requires makeinfo v4.0, you need to install new texinfo before
                    120:        building gnu/usr.bin/grep.  To install new texinfo, please follow
                    121:        the instruction described in 20010726 entry.
1.30      enami     122:
                    123: 20010803:
1.41      wiz       124:        (i386 only): i386 kernel now uses new instructions like
                    125:         `fxsave' which old gas doesn't understand.  To build the
1.52      wiz       126:        kernel successfully, you need to build and install new gas
1.41      wiz       127:        (gnu/usr.bin/gas.new), or (temporarily) comment out
                    128:        "options I686_CPU" from your kernel configuration until you
                    129:        rebuilt your userland (and got a new gas).
1.29      bjh21     130:
                    131: 20010731:
                    132:        Bootloader update on ELF platforms.  DDB in kernels from before
                    133:        this will be unable to read symbol tables provided by newer
                    134:        bootloaders.
1.27      assar     135:
                    136: 20010726:
                    137:        Texinfo was updated to 4.0.  To avoid failures when trying to
1.28      assar     138:        build the included texinfo files, do:
                    139:
                    140:        cd src/gnu/usr.bin/texinfo
                    141:        make MKINFO=no dependall install
1.25      thorpej   142:
                    143: 20010718:
                    144:        Enabled correct .init/.fini processing in crt0.  The way this
                    145:        was done was to change a -I directive to cc(1), which means
                    146:        make(1) will have a stale dependency (it will be checking the
                    147:        timestamp on the wrong "dot_init.h").
                    148:
                    149:        The symptom you will see is that new programs die with SIGSEGV
                    150:        if you have a stale dependency.
                    151:
                    152:        Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
                    153:        before starting your build.
1.26      thorpej   154:
                    155: 20010628:
                    156:        A construct was added to uvm_page.h that uncovered a bug
                    157:        in lint(1).  If you get a warning/error about a non-portable
                    158:        bitfield, update your lint(1) before proceeding.
1.21      jmc       159:
                    160: 20010226:
1.22      jmc       161:        Added named user/group to system. Need to hand add this in or builds
1.21      jmc       162:        will break as mtree aborts early.
                    163:
                    164:        To work around add by hand:
                    165:
                    166:        named:*:14:
                    167:
1.22      jmc       168:        to /etc/group and add:
                    169:
                    170:        named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
                    171:
                    172:        to master.passwd (use vipw for instance if doing by hand).
                    173:
                    174:        Now a make build should progress.
1.18      jmc       175:
                    176: 20010219:
1.52      wiz       177:        get/setprogname() added. Any hostprogs that may use this will need
1.20      jmc       178:         to be bootstrapped manually until the host system is current.
1.18      jmc       179:
                    180:         Known problems: sys/arch/macppc/stand/fixcoff
1.19      cgd       181:                        usr.sbin/config (adding -DMAKE_BOOTSTRAP to
                    182:                          CFLAGS and rebuilding should work)
1.20      jmc       183:                        usr.sbin/mdsetimage - Build a static copy if
                    184:                          building a snapshot before fully bootstrapped.
1.15      christos  185:
                    186: 20010204:
                    187:        prepare the code to compile with stricter gcc flags. in
                    188:        particular start eliminating redundant declarations. Yacc
                    189:        needs to be installed before make build.
1.10      christos  190:
                    191: 20010114:
                    192:        introduce .if commands(target) in make(1). You need to
                    193:        bring everything up-to-date first, then without installing
1.23      tron      194:        anything make and install in usr.bin/make, then proceed
1.10      christos  195:        with make build.
1.9       sommerfe  196:
                    197: 20010101:
                    198:        bsd.subdir.mk committed 20001230 had a bug which caused
                    199:        afterinstall targets to run too soon; update again.
1.8       sommerfe  200:
                    201: 20001230:
                    202:        New share/mk files needed to support .WAIT in SUBDIR variables.
                    203:        If you get make errors,
                    204:                (cd share/mk; make install)
                    205:        Also, PRINTOBJDIR has changed and is now used more heavily.
1.6       ad        206:
                    207: 20001019:
1.7       ad        208:        The `ca' device driver has been replaced by `ld'; although the
1.6       ad        209:        major and minor numbers haven't changed, you should update your /dev
                    210:        directory.
1.1       abs       211:
1.4       itojun    212: 20000929:
                    213:        The following make directives are obsoleted.
                    214:        MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
                    215:        By default, RSA is built into libcrypto.  IDEA and RC5 will not be
1.16      wiz       216:        built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
1.4       itojun    217:        additional library libcrypto_{idea,rc5}.
1.1       abs       218:
                    219:
                    220: Hints for a more successful build:
                    221: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2       mrg       222:     Build a new kernel first:
                    223:        This makes sure that any new system calls or features
                    224:           expected by the new userland will be present.  This
                    225:           helps to avoid critical errors when upgrading.
1.1       abs       226:     Use object directories:
                    227:        This helps to keep stale object
                    228:           files from polluting the build if a Makefile "forgets"
                    229:           about one.  It also makes it easier to clean up after
                    230:           a build.  It's also necessary if you want to use the
                    231:           same source tree for multiple machines.
                    232:           To use object directories:
                    233:            a) cd /usr/src ; make cleandir
1.2       mrg       234:            b) Add "OBJMACHINE=yes" to /etc/mk.conf
                    235:            c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1       abs       236:            d) cd /usr/src ; make build
1.2       mrg       237:           Note that running "make obj" in a directory will create
                    238:           in obj.$MACHINE directory.
1.1       abs       239:     Build to a DESTDIR:
                    240:        This helps to keep old
                    241:           installed files (especially libraries) from interfering
                    242:           with the new build.
                    243:           To build to a DESTDIR, set the DESTDIR environment
1.2       mrg       244:           variable before running make build.  It should be set to
                    245:           the pathname of an initially empty directory.
1.1       abs       246:           Problems: you might need to update critical utilities
                    247:                without using DESTDIR since nothing is executed
                    248:                from what is installed in DESTDIR.
                    249:                (See critical utils, below)
                    250:     Build often:
                    251:        This keeps critical utilities current enough to not choke
                    252:        on any other part of the source tree that depends on up to
                    253:        date functionality.
                    254:
                    255: What to do if things don't work:
                    256: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    257: When things don't work there is usually a few things that commonly
                    258: should be done.
                    259:     1) make includes
                    260:        This should be done automatically by make build.
                    261:     2)  cd share/mk && make install
                    262:        Again, automatically done by make build.
                    263:
                    264: Failsafe rebuild of a small part of the tree:
                    265: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    266: To make sure you rebuild something correctly you want to do
                    267: something like the following:
                    268:     1)  Make sure the includes and .mk files are up to date.
                    269:     2)  Make sure any program used to build the particular
                    270:        utility is up to date.  (yacc, lex, etc...)
                    271:     3)  cd ...path/to/util...
                    272:        make cleandir
                    273:        rm ...all obj directories...
                    274:        make cleandir                   # yes, again
                    275:        make obj
                    276:        make depend && make
                    277:
                    278: Failsafe rebuild of the entire tree:
                    279: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    280: If you really want to make sure the source tree is clean and
1.2       mrg       281: ready for a build try the following.  Note that sourcing /etc/mk.conf
                    282: (a make(1) Makefile) in this manner is not right, and will not work
                    283: for anyone who uses any make(1) features in /etc/mk.conf.
1.1       abs       284:
                    285: ---cut here---
                    286: #!/bin/sh
                    287: . /etc/mk.conf
                    288:
                    289: if [ -z $BSDSRCDIR ] ; then
                    290:     BSDSRCDIR=/usr/src
                    291: fi
                    292: if [ \! -d $BSDSRCDIR ] ; then
                    293:     echo Unable to find sources
                    294:     exit 1
                    295: fi
                    296: find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
                    297:
                    298: if [ -z $BSDOBJDIR ] ; then
                    299:     BSDOBJDIR=/usr/obj
                    300: fi
                    301: if [ -d $BSDOBJDIR ] ; then
                    302:     rm -rf $BSDOBJDIR
                    303: fi
                    304:
                    305: cd $BSDSRCDIR && make cleandir
                    306:
                    307: ---cut here---
                    308:
                    309: Critical utilities:
                    310: ^^^^^^^^^^^^^^^^^^^
                    311:        gnu/usr.bin/egcs
1.3       itojun    312:        usr.bin/compile_et
1.1       abs       313:        usr.bin/make
                    314:        usr.bin/yacc
                    315:        usr.bin/lex
1.11      lukem     316:        usr.bin/xlint
1.2       mrg       317:        usr.sbin/config
1.1       abs       318:
1.34      simonb    319: Other problems and possible solutions:
1.1       abs       320: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    321: Symptom:Unreasonable compiler errors.
                    322: Fix:   Rebuild gnu/usr.bin/egcs
                    323:
                    324: Symptom:Complaints involving a Makefile.
1.17      erh       325: Fix:   Rebuild usr.bin/make:
                    326:        cd usr.bin/make && make && make install
                    327:         Or, a failsafe method if that doesn't work:
                    328:        cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
                    329:
1.1       abs       330: Fix:   Make sure .mk files are up to date.
                    331:        cd share/mk && make install
1.2       mrg       332:
                    333: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
                    334: Fix:   Rebuild usr.sbin/config
1.1       abs       335:
                    336: Symptom:
                    337: Fix:   Rebuild usr.bin/yacc
                    338:
                    339: Symptom:
                    340: Fix:   Rebuild usr.bin/lex
                    341:
                    342: Symptom:
                    343: Fix:   rm /usr/lib/libbfd.a
1.4       itojun    344:
                    345: Symptom:Obsolete intermediate files are used during compilation
                    346: Fix:   Try the following sequence of commands in the directory in question.
                    347:        make cleandir; rm `make print-objdir`; make cleandir; make obj
                    348:        (If you built the tree without "make obj" in the past, obsolete files
                    349:        may remain.  The command tries to clean everything up)
1.5       wiz       350:
                    351: Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
                    352: Fix:   Rebuild and install usr.bin/menuc
1.12      itojun    353:
                    354: Symptom:mklocale not found during build in share/locale/ctype
                    355: Fix:   Build and install usr.bin/mklocale
1.13      dogcow    356:
                    357: Symptom:undefined reference to `__assert13'
                    358: Fix:    Rebuild and install lib/libc
                    359:
1.19      cgd       360: Symptom:usr.sbin/config fails to build.
                    361: Fix:   Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
1.13      dogcow    362:
1.19      cgd       363: Symptom:undefined reference to `getprogname' or `setprogname'
                    364: Fix:    Rebuild and install lib/libc
1.24      abs       365:
                    366: Symptom:lint does not understand the '-X' option
                    367: Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint

CVSweb <webmaster@jp.NetBSD.org>