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

Annotation of src/UPDATING, Revision 1.74

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

CVSweb <webmaster@jp.NetBSD.org>