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

Annotation of src/UPDATING, Revision 1.58

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

CVSweb <webmaster@jp.NetBSD.org>