UPDATING revision 1.68
11.68Slukem$NetBSD: UPDATING,v 1.68 2002/09/24 14:43:39 lukem Exp $ 21.1Sabs 31.1SabsThis file is intended to be a brief introduction to the build 41.1Sabsprocess and a reference on what to do if something doesn't work. 51.1Sabs 61.1SabsFor a more detailed description see Makefile. 71.1Sabs 81.1SabsRecent changes: 91.1Sabs^^^^^^^^^^^^^^^ 101.68Slukem 111.68Slukem20020922: 121.68Slukem MKDYNAMICROOT=yes enabled by default, which means that 131.68Slukem certain shared libraries are installed into /lib, the shared 141.68Slukem linker is installed into /libexec, and all programs in /bin 151.68Slukem and /sbin are dynamically linked. 161.68Slukem If you do not use "make build", you should ensure that 171.68Slukem you have the libraries and shared linker in the new locations, 181.68Slukem with: 191.68Slukem make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so 201.67Slukem 211.67Slukem20020917: 221.67Slukem USE_NEW_TOOLCHAIN has been replaced with: 231.67Slukem - TOOLCHAIN_MISSING -- set to "yes" on platforms for which 241.67Slukem there is no working in-tree toolchain (hppa, ns32k, sh5, 251.67Slukem x86_64). 261.67Slukem - EXTERNAL_TOOLCHAIN -- if defined by the user, points to the 271.67Slukem root ofan external toolchain (e.g. /usr/local/gnu). This 281.67Slukem enables the cross-build framework even for TOOLCHAIN_MISSING 291.67Slukem platforms. 301.66Sgehenna 311.66Sgehenna20020906: 321.66Sgehenna gehenna-devsw has been merged into the trunk. Need to update and 331.66Sgehenna reinstall usr.sbin/config before build the kernel. 341.65Slukem 351.65Slukem20020822: 361.65Slukem Crunched rescue tools (contents of /bin and /sbin, plus others) 371.65Slukem are now provided in /rescue. 381.65Slukem 391.65Slukem To ensure that these are built statically linked (no matter 401.65Slukem what the setting of LDSTATIC is), use a crunchgen(1) built 411.65Slukem from sources newer than 20020820 (see the next entry). 421.65Slukem 431.65Slukem20020820: 441.65Slukem crunchgen(1) changed to ensure that the generated program 451.65Slukem is statically linked. 461.65Slukem 471.65Slukem Solution: update and reinstall usr.bin/crunch 481.61Sitojun 491.61Sitojun20020515: 501.61Sitojun sshd user/group has been added. Need to hand add this in, or sshd 511.61Sitojun will not let you log in (with default, or UsePrivlegeSeparation=yes) 521.61Sitojun 531.61Sitojun Add the following into /etc/group: 541.61Sitojun 551.61Sitojun sshd:*:16: 561.61Sitojun 571.61Sitojun and the following to /etc/master.passwd (via vipw): 581.61Sitojun 591.63Senami sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin 601.61Sitojun 611.62Sjdolecek also /var/chroot/sshd directory needs to be present (digged as a part of 621.61Sitojun build process). 631.60Ssommerfe 641.60Ssommerfe20020426: 651.60Ssommerfe NBUILDJOBS obsoleted in favor of just using -j. 661.59Slukem 671.59Slukem20020426: 681.59Slukem etc/postinstall added, which performs various checks for 691.59Slukem configuration file updates and changes, and can fix most of 701.59Slukem the problems identified. 711.59Slukem This should make it much easier to upgrade a system's 721.59Slukem configuration from earlier systems (as far back as NetBSD 1.5). 731.56Slukem 741.56Slukem20020320: 751.56Slukem <bsd.lib.mk> needs a new install(1) for it's "-a cmd" support. 761.57Sitojun build and install at usr.bin/xinstall before the build. 771.56Slukem 781.55Sitojun20020319: 791.55Sitojun raw IPv6 socket now makes strict checking for sa_family and sa_len 801.55Sitojun on send(2) operation. be sure to have sbin/rtsol and usr.sbin/rtsold 811.55Sitojun newer than November 2001 when you upgrade the kernel. 821.55Sitojun 831.54Sitojun20020311: 841.54Sitojun ssh configuration files were moved from /etc to /etc/ssh. Beware 851.54Sitojun if you restart your machine from remote. Note that sshd.conf needs 861.54Sitojun to be changed (due to the use of "/etc" inside). 871.54Sitojun 881.54Sitojun20020223: 891.53Smatt Users of the VAX port will need to rebuild and install gas 901.53Smatt so it deal with the now present register prefix used in all 911.53Smatt the VAX assembly files. 921.53Smatt 931.50Sitojun20020118: 941.50Sitojun 951.50Sitojun ntpd user/group has been added. Need to hand add this in or builds 961.50Sitojun will break as mtree aborts early. 971.50Sitojun 981.50Sitojun Add the following into /etc/group: 991.50Sitojun 1001.50Sitojun ntpd:*:15: 1011.50Sitojun 1021.50Sitojun and the following to /etc/master.passwd (via vipw): 1031.50Sitojun 1041.50Sitojun ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin 1051.50Sitojun 1061.49Sjmc20011207: 1071.49Sjmc 1081.49Sjmc If you're attempting to build a snapshot on sparc64 and are getting 1091.49Sjmc reloc errors from the toolchain groff binary this means your native 1101.49Sjmc toolchain has some broken C++ bits. 1111.49Sjmc 1121.49Sjmc To fix: 1131.49Sjmc 1141.49Sjmc Build a new toolchain (i.e. build.sh -t) 1151.49Sjmc Use the new toolchain to build and install natively (i.e. /usr/lib) 1161.49Sjmc 1171.49Sjmc gnu/lib/libgcc 1181.51Spooka gnu/lib/libstdc++ 1191.49Sjmc 1201.49Sjmc After this a snapshot will be able to be built. 1211.49Sjmc 1221.47Sjmc20011201: 1231.47Sjmc In order for a sparc64 build to work you must have a working awk. If 1241.47Sjmc you've built and installed a system with the new toolchain up to this 1251.52Swiz point you do not have a working awk as its ability to do floating 1261.47Sjmc point is broken. 1271.47Sjmc 1281.47Sjmc To build: 1291.47Sjmc 1301.47Sjmc remake and install gnu/lib/libgcc 1311.47Sjmc remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links 1321.48Sjmc against the new libgcc.a) 1331.47Sjmc 1341.46Sthorpej20011128: 1351.46Sthorpej Kernel config information was changed to use defflag in 1361.46Sthorpej the various "files" files. Bug fixes to config(8) are 1371.46Sthorpej required in order for this to work properly. Make sure 1381.46Sthorpej to build and install in usr.sbin/config before attempting 1391.46Sthorpej to build a new kernel. 1401.46Sthorpej 1411.45Syamt20011030: 1421.45Syamt libc/locale/wcstod.c now needs new lint(1). Update lint(1) 1431.45Syamt before building libc. 1441.43Smason 1451.44Stv20011029: 1461.44Stv The new document BUILDING.mdoc (view with nroff | more, or 1471.44Stv see pre-generated .txt and .html versions) describes the build 1481.44Stv procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN 1491.44Stv build process, are intended in the long run to replace this 1501.44Stv manual update log. 1511.44Stv 1521.44Stv Users building a USE_NEW_TOOLCHAIN system should read the 1531.44Stv BUILDING document for caveats. Generally, BUILDING supersedes 1541.44Stv UPDATING for these systems, as tool updating is taken care of 1551.44Stv by the new build system. 1561.42Sperry 1571.42Sperry20011028: 1581.42Sperry src/etc/Makefile now needs install to be able to handle 1591.42Sperry symlinks that point to nowhere. A bug in install that 1601.42Sperry prevented this was corrected. 1611.42Sperry 1621.42Sperry Solution: update and reinstall usr.bin/xinstall 1631.42Sperry Better Solution: Use the new toolchain and it will just work 1641.42Sperry for you. 1651.40Slukem 1661.40Slukem20011006: 1671.40Slukem /etc/mtree/NetBSD.dist has been updated to take advantage of 1681.40Slukem absolute path support added to mtree(8). Older mtree(8)s don't 1691.40Slukem understand the format. 1701.40Slukem 1711.40Slukem Solution: update and reinstall usr.sbin/mtree 1721.39Sjmc 1731.39Sjmc20011004: 1741.39Sjmc Crunchgen has been updated to work via reach-over makefiles. Updating 1751.39Sjmc is suggested before running a snapshot build 1761.36Stv 1771.35Sthorpej20010915: 1781.35Sthorpej The new "ubcperf" code committed by Chuck Silvers removed 1791.35Sthorpej a header file, uvm/uvm_vnode.h. There may be stale .depend 1801.35Sthorpej files that still reference this file. 1811.35Sthorpej 1821.35Sthorpej Solution: "make cleandir && make dependall" in affected 1831.35Sthorpej directories. 1841.31Senami 1851.31Senami20010803: 1861.31Senami grep.info is now built from grep.texi using makeinfo. Since it 1871.31Senami requires makeinfo v4.0, you need to install new texinfo before 1881.31Senami building gnu/usr.bin/grep. To install new texinfo, please follow 1891.31Senami the instruction described in 20010726 entry. 1901.30Senami 1911.64Ssommerfe20010803: 1921.41Swiz (i386 only): i386 kernel now uses new instructions like 1931.41Swiz `fxsave' which old gas doesn't understand. To build the 1941.64Ssommerfe kernel successfully, you need to build and install a new toolchain, 1951.64Ssommerfe (i.e., build.sh -t) or (temporarily) comment out "options I686_CPU" 1961.64Ssommerfe from your kernel configuration until you rebuild your userland. 1971.64Ssommerfe See 20011029 above and BUILDING file in this directory for more information. 1981.64Ssommerfe [updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled] 1991.29Sbjh21 2001.29Sbjh2120010731: 2011.29Sbjh21 Bootloader update on ELF platforms. DDB in kernels from before 2021.29Sbjh21 this will be unable to read symbol tables provided by newer 2031.29Sbjh21 bootloaders. 2041.27Sassar 2051.27Sassar20010726: 2061.27Sassar Texinfo was updated to 4.0. To avoid failures when trying to 2071.28Sassar build the included texinfo files, do: 2081.28Sassar 2091.28Sassar cd src/gnu/usr.bin/texinfo 2101.28Sassar make MKINFO=no dependall install 2111.25Sthorpej 2121.25Sthorpej20010718: 2131.25Sthorpej Enabled correct .init/.fini processing in crt0. The way this 2141.25Sthorpej was done was to change a -I directive to cc(1), which means 2151.25Sthorpej make(1) will have a stale dependency (it will be checking the 2161.25Sthorpej timestamp on the wrong "dot_init.h"). 2171.25Sthorpej 2181.25Sthorpej The symptom you will see is that new programs die with SIGSEGV 2191.25Sthorpej if you have a stale dependency. 2201.25Sthorpej 2211.25Sthorpej Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so 2221.25Sthorpej before starting your build. 2231.26Sthorpej 2241.26Sthorpej20010628: 2251.26Sthorpej A construct was added to uvm_page.h that uncovered a bug 2261.26Sthorpej in lint(1). If you get a warning/error about a non-portable 2271.26Sthorpej bitfield, update your lint(1) before proceeding. 2281.21Sjmc 2291.21Sjmc20010226: 2301.22Sjmc Added named user/group to system. Need to hand add this in or builds 2311.21Sjmc will break as mtree aborts early. 2321.21Sjmc 2331.21Sjmc To work around add by hand: 2341.21Sjmc 2351.21Sjmc named:*:14: 2361.21Sjmc 2371.22Sjmc to /etc/group and add: 2381.22Sjmc 2391.22Sjmc named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin 2401.22Sjmc 2411.22Sjmc to master.passwd (use vipw for instance if doing by hand). 2421.22Sjmc 2431.22Sjmc Now a make build should progress. 2441.18Sjmc 2451.18Sjmc20010219: 2461.52Swiz get/setprogname() added. Any hostprogs that may use this will need 2471.20Sjmc to be bootstrapped manually until the host system is current. 2481.18Sjmc 2491.18Sjmc Known problems: sys/arch/macppc/stand/fixcoff 2501.19Scgd usr.sbin/config (adding -DMAKE_BOOTSTRAP to 2511.19Scgd CFLAGS and rebuilding should work) 2521.20Sjmc usr.sbin/mdsetimage - Build a static copy if 2531.20Sjmc building a snapshot before fully bootstrapped. 2541.15Schristos 2551.15Schristos20010204: 2561.15Schristos prepare the code to compile with stricter gcc flags. in 2571.15Schristos particular start eliminating redundant declarations. Yacc 2581.15Schristos needs to be installed before make build. 2591.10Schristos 2601.10Schristos20010114: 2611.10Schristos introduce .if commands(target) in make(1). You need to 2621.10Schristos bring everything up-to-date first, then without installing 2631.23Stron anything make and install in usr.bin/make, then proceed 2641.10Schristos with make build. 2651.9Ssommerfe 2661.9Ssommerfe20010101: 2671.9Ssommerfe bsd.subdir.mk committed 20001230 had a bug which caused 2681.9Ssommerfe afterinstall targets to run too soon; update again. 2691.8Ssommerfe 2701.8Ssommerfe20001230: 2711.8Ssommerfe New share/mk files needed to support .WAIT in SUBDIR variables. 2721.8Ssommerfe If you get make errors, 2731.8Ssommerfe (cd share/mk; make install) 2741.8Ssommerfe Also, PRINTOBJDIR has changed and is now used more heavily. 2751.6Sad 2761.6Sad20001019: 2771.7Sad The `ca' device driver has been replaced by `ld'; although the 2781.6Sad major and minor numbers haven't changed, you should update your /dev 2791.6Sad directory. 2801.1Sabs 2811.4Sitojun20000929: 2821.4Sitojun The following make directives are obsoleted. 2831.4Sitojun MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 2841.4Sitojun By default, RSA is built into libcrypto. IDEA and RC5 will not be 2851.16Swiz built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build 2861.4Sitojun additional library libcrypto_{idea,rc5}. 2871.1Sabs 2881.1Sabs 2891.1SabsHints for a more successful build: 2901.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2911.2Smrg Build a new kernel first: 2921.2Smrg This makes sure that any new system calls or features 2931.2Smrg expected by the new userland will be present. This 2941.2Smrg helps to avoid critical errors when upgrading. 2951.1Sabs Use object directories: 2961.1Sabs This helps to keep stale object 2971.1Sabs files from polluting the build if a Makefile "forgets" 2981.1Sabs about one. It also makes it easier to clean up after 2991.1Sabs a build. It's also necessary if you want to use the 3001.1Sabs same source tree for multiple machines. 3011.1Sabs To use object directories: 3021.1Sabs a) cd /usr/src ; make cleandir 3031.2Smrg b) Add "OBJMACHINE=yes" to /etc/mk.conf 3041.2Smrg c) Add "MKOBJDIRS=yes" to /etc/mk.conf 3051.1Sabs d) cd /usr/src ; make build 3061.2Smrg Note that running "make obj" in a directory will create 3071.2Smrg in obj.$MACHINE directory. 3081.1Sabs Build to a DESTDIR: 3091.1Sabs This helps to keep old 3101.1Sabs installed files (especially libraries) from interfering 3111.1Sabs with the new build. 3121.1Sabs To build to a DESTDIR, set the DESTDIR environment 3131.2Smrg variable before running make build. It should be set to 3141.2Smrg the pathname of an initially empty directory. 3151.1Sabs Problems: you might need to update critical utilities 3161.1Sabs without using DESTDIR since nothing is executed 3171.1Sabs from what is installed in DESTDIR. 3181.1Sabs (See critical utils, below) 3191.1Sabs Build often: 3201.1Sabs This keeps critical utilities current enough to not choke 3211.1Sabs on any other part of the source tree that depends on up to 3221.1Sabs date functionality. 3231.1Sabs 3241.1SabsWhat to do if things don't work: 3251.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3261.1SabsWhen things don't work there is usually a few things that commonly 3271.1Sabsshould be done. 3281.1Sabs 1) make includes 3291.1Sabs This should be done automatically by make build. 3301.1Sabs 2) cd share/mk && make install 3311.1Sabs Again, automatically done by make build. 3321.1Sabs 3331.1SabsFailsafe rebuild of a small part of the tree: 3341.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3351.1SabsTo make sure you rebuild something correctly you want to do 3361.1Sabssomething like the following: 3371.1Sabs 1) Make sure the includes and .mk files are up to date. 3381.1Sabs 2) Make sure any program used to build the particular 3391.1Sabs utility is up to date. (yacc, lex, etc...) 3401.1Sabs 3) cd ...path/to/util... 3411.1Sabs make cleandir 3421.1Sabs rm ...all obj directories... 3431.1Sabs make cleandir # yes, again 3441.1Sabs make obj 3451.1Sabs make depend && make 3461.1Sabs 3471.1SabsFailsafe rebuild of the entire tree: 3481.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3491.1SabsIf you really want to make sure the source tree is clean and 3501.2Smrgready for a build try the following. Note that sourcing /etc/mk.conf 3511.2Smrg(a make(1) Makefile) in this manner is not right, and will not work 3521.2Smrgfor anyone who uses any make(1) features in /etc/mk.conf. 3531.1Sabs 3541.1Sabs---cut here--- 3551.1Sabs#!/bin/sh 3561.1Sabs. /etc/mk.conf 3571.1Sabs 3581.58Slukemif [ -z $NETBSDSRCDIR ] ; then 3591.58Slukem NETBSDSRCDIR=/usr/src 3601.1Sabsfi 3611.58Slukemif [ \! -d $NETBSDSRCDIR ] ; then 3621.1Sabs echo Unable to find sources 3631.1Sabs exit 1 3641.1Sabsfi 3651.58Slukemfind $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \; 3661.1Sabs 3671.1Sabsif [ -z $BSDOBJDIR ] ; then 3681.1Sabs BSDOBJDIR=/usr/obj 3691.1Sabsfi 3701.1Sabsif [ -d $BSDOBJDIR ] ; then 3711.1Sabs rm -rf $BSDOBJDIR 3721.1Sabsfi 3731.1Sabs 3741.58Slukemcd $NETBSDSRCDIR && make cleandir 3751.1Sabs 3761.1Sabs---cut here--- 3771.1Sabs 3781.1SabsCritical utilities: 3791.1Sabs^^^^^^^^^^^^^^^^^^^ 3801.1Sabs gnu/usr.bin/egcs 3811.3Sitojun usr.bin/compile_et 3821.1Sabs usr.bin/make 3831.1Sabs usr.bin/yacc 3841.1Sabs usr.bin/lex 3851.11Slukem usr.bin/xlint 3861.2Smrg usr.sbin/config 3871.1Sabs 3881.34SsimonbOther problems and possible solutions: 3891.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3901.1SabsSymptom:Unreasonable compiler errors. 3911.1SabsFix: Rebuild gnu/usr.bin/egcs 3921.1Sabs 3931.1SabsSymptom:Complaints involving a Makefile. 3941.17SerhFix: Rebuild usr.bin/make: 3951.17Serh cd usr.bin/make && make && make install 3961.17Serh Or, a failsafe method if that doesn't work: 3971.17Serh cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin 3981.17Serh 3991.1SabsFix: Make sure .mk files are up to date. 4001.1Sabs cd share/mk && make install 4011.2Smrg 4021.2SmrgSymptom:Kernel `config' fails to configure any kernel, including GENERIC. 4031.2SmrgFix: Rebuild usr.sbin/config 4041.1Sabs 4051.1SabsSymptom: 4061.1SabsFix: Rebuild usr.bin/yacc 4071.1Sabs 4081.1SabsSymptom: 4091.1SabsFix: Rebuild usr.bin/lex 4101.1Sabs 4111.1SabsSymptom: 4121.1SabsFix: rm /usr/lib/libbfd.a 4131.4Sitojun 4141.4SitojunSymptom:Obsolete intermediate files are used during compilation 4151.4SitojunFix: Try the following sequence of commands in the directory in question. 4161.4Sitojun make cleandir; rm `make print-objdir`; make cleandir; make obj 4171.4Sitojun (If you built the tree without "make obj" in the past, obsolete files 4181.4Sitojun may remain. The command tries to clean everything up) 4191.5Swiz 4201.5SwizSymptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type 4211.5SwizFix: Rebuild and install usr.bin/menuc 4221.12Sitojun 4231.12SitojunSymptom:mklocale not found during build in share/locale/ctype 4241.12SitojunFix: Build and install usr.bin/mklocale 4251.13Sdogcow 4261.13SdogcowSymptom:undefined reference to `__assert13' 4271.13SdogcowFix: Rebuild and install lib/libc 4281.13Sdogcow 4291.19ScgdSymptom:usr.sbin/config fails to build. 4301.19ScgdFix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile. 4311.13Sdogcow 4321.19ScgdSymptom:undefined reference to `getprogname' or `setprogname' 4331.19ScgdFix: Rebuild and install lib/libc 4341.24Sabs 4351.24SabsSymptom:lint does not understand the '-X' option 4361.24SabsFix: May need to build & install libs with NOLINT=1 before rebuilding lint 437