UPDATING revision 1.166
1$NetBSD: UPDATING,v 1.166 2007/11/15 12:53:43 xtraeme Exp $ 2 3This file (UPDATING) is intended to be a brief reference to recent 4changes that might cause problems in the build process, and a guide for 5what to do if something doesn't work. 6 7For a more detailed description of the recommended way to build NetBSD 8using build.sh, see the BUILDING file. 9 10Note that much of the advice in this UPDATING file was written before 11build.sh existed. Nevertheless, the advice here may be useful for 12working around specific problems with build.sh. 13 14See also: BUILDING, build.sh, Makefile. 15 16Recent changes: 17^^^^^^^^^^^^^^^ 18 1920071115: 20 The it(4) driver has been renamed to itesio(4) and the old port 21 argument specified in the kernel configuration file is not valid 22 anymore. The itesio(4) driver now uses the Super I/O address port 23 rather than the EC address port. Please update your kernel 24 configuration file appropiately or see GENERIC for more details. 25 2620071028: 27 The pccons(4) driver has been removed from the NetBSD/shark port. 28 You need to update any custom kernel configuration file you have 29 to remove any references to pccons (which includes removing the 30 now useless XSERVER option) and replace them with the correct 31 entries for the wscons driver. See the GENERIC configuration file 32 for more details. 33 3420070913: 35 A latent bug in dhclient/dhcpd that caused it to be unable to 36 enumerate interfaces was fixed. The bug began to cause 37 problems after 20070911 when the kernel's SIOCGIFCONF 38 implementation was repaired. From 20070529 to 20070911 racoon 39 could not enumerate interfaces. (These are noted because 40 normal kernel/userspace version matching hygiene is not 41 sufficient to avoid this problem.) Ensure that both kernel 42 and userland are from after 20070913. 43 4420070703: 45 nbinstall has been renamed as it calls the target specific and 46 the logic to pass down STRIP from mk been removed. This forces 47 a re-installation of tools. 48 4920070422: 50 The way OS emulations lookup filenames inside the emulation root 51 has been changed. Rather than modify the pathname (and copy back 52 to userspace) namei() and lookup() directly check the emulation 53 root. One side effect is that absolute symlinks inside the emulated 54 root filesytem will be relative to that filesystem - unless they 55 start /../ this is useful when the emulated root is a real install 56 that has such links. 57 This might affect symlinks that have been added to reference outside 58 the emulated root. 59 6020070412: 61 The pckbc driver on sgimips IP32 has been removed. Use macekbc 62 instead. See the GENERIC32_IP3x kernel configuration for an 63 example. 64 6520070319: 66 src/lib/libc/Makefile revision 1.129 broke libc and ld.elf_so 67 on many platforms due to incorrect flags settings. If you 68 updated and built after about 20070315, do "nbmake-$arch 69 cleandir" in src/lib/libc and src/libexec/ld.elf_so to force a 70 rebuild of object files that might have been built 71 incorrectly, and ensure that you have at least 72 src/lib/libc/Makefile 1.130. 73 7420070210: 75 src/sys/sys/{sa.h,savar.h} were removed. 76 find ${OBJDIR} \( -name .depend -o -name '*.d' \) -print \ 77 | xargs egrep -l '/sa.h|/savar.h' | xargs rm 78 will allow dependencies on those files to get get rebuilt 79 8020070209: 81 The threading model was changed when the newlock2 branch 82 was merged to NetBSD-current. If you boot with a new 83 kernel (version 4.99.10), then you also need a new pthread 84 library (/usr/lib/libpthread.so.0.7). If you boot with 85 an old kernel, then you need the old pthread library 86 (/usr/lib/libpthread.so.0.6). Provided you keep the kernel and 87 the pthread library in sync, old threaded applications should 88 continue to work with an old or new kernel. Note that named(8) 89 is the only threaded application in the base system. 90 9120061214: 92 Following the move of string_to_flags() and flags_to_string() 93 from the bin/ls/ sources to libutil, users doing UPDATE builds 94 will need to do a "make cleandir" in 95 tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/, 96 bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/, 97 usr.bin/xinstall/, libexec/ftpd/, rescue/, as well 98 as the installation images in distrib/ 99 in order to excise stale references to the old stat_flags.h header 100 file in the ls sources -- stat_flags.h has been removed. 101 10220061108: 103 The configure script used in the src/tools/gcc compiler has been 104 changed to indicate that our libc has ssp support built-in and 105 does not depend on -lssp and -lssp-nonshared. You'll need to 106 make clean in src/tools/gcc first to rebuild the compiler. 107 10820061009: 109 The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer 110 available. Use net.inet{,6}.tcp{,6}.congctl.selected instead. 111 11220060814: 113 The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been 114 withdrawn. Use vidcvideo and pckbd instead. See the GENERIC 115 kernel configuration for an example. X servers from the last 116 few years should cope. 117 11820060703: 119 MPACPI is no more. We always configure PCI interrupts using ACPI 120 if we have an ACPI kernel. The option MPACPI_SCANPCI has been renamed 121 to ACPI_SCANPCI. Thanks to work from fvdl. 122 12320060627: 124 socket(2) has changed, and its system call has been versioned. 125 For userlands with the old version of socket(2), make sure that 126 your kernel has 'options COMPAT_30' set, or else 'bad system call' 127 errors will result. 128 129Hints for a more successful build: 130^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 131 Use build.sh, but do not use its "expert mode": 132 This will automatically build the tools in the 133 correct order, and it will keep the tools and the 134 new build products from interfering with the running 135 system. This will allow you to ignore most of the 136 other advice in this file. 137 Build a new kernel first: 138 This makes sure that any new system calls or features 139 expected by the new userland will be present. This 140 helps to avoid critical errors when upgrading. 141 Use object directories: 142 This helps to keep stale object 143 files from polluting the build if a Makefile "forgets" 144 about one. It also makes it easier to clean up after 145 a build. It's also necessary if you want to use the 146 same source tree for multiple machines. 147 To use object directories with build.sh: 148 a) invoke build.sh with the "-M" or "-O" options. 149 To use object directories without using build.sh: 150 a) cd /usr/src ; make cleandir 151 b) Add "OBJMACHINE=yes" to /etc/mk.conf 152 c) Add "MKOBJDIRS=yes" to /etc/mk.conf 153 d) cd /usr/src ; make build 154 Note that running "make obj" in a directory will create 155 in obj.$MACHINE directory. 156 Build to a DESTDIR: 157 This helps to keep old installed files (especially libraries) 158 from interfering with the new build. 159 To build to a DESTDIR with build.sh, use the "-D" option. 160 To build to a DESTDIR without using build.sh, set the DESTDIR 161 environment variable before running make build. It should be 162 set to the pathname of an initially empty directory. 163 Problems: if you do not use build.sh, you might need to 164 update critical utilities without using DESTDIR since 165 nothing is executed from what is installed in DESTDIR. 166 (See critical utils, below.) 167 Build often: 168 This keeps critical utilities current enough to not choke 169 on any other part of the source tree that depends on up to 170 date functionality. If you use build.sh, you should not have 171 this problem. 172 173What to do if things don't work: 174^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 175When things don't work there is usually a few things that commonly 176should be done. 177 1) make includes 178 This should be done automatically by make build. 179 2) cd share/mk && make install 180 Again, automatically done by make build. 181 182Failsafe rebuild of a small part of the tree: 183^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 184To make sure you rebuild something correctly you want to do 185something like the following: 186 1) Make sure the includes and .mk files are up to date. 187 2) Make sure any program used to build the particular 188 utility is up to date. (yacc, lex, etc...) 189 3) cd ...path/to/util... 190 make cleandir 191 rm ...all obj directories... 192 make cleandir # yes, again 193 make obj 194 make depend && make 195 196Failsafe rebuild of the entire tree: 197^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 198If you really want to make sure the source tree is clean and 199ready for a build try the following. Note that sourcing /etc/mk.conf 200(a make(1) Makefile) in this manner is not right, and will not work 201for anyone who uses any make(1) features in /etc/mk.conf. 202 203---cut here--- 204#!/bin/sh 205. /etc/mk.conf 206 207if [ -z $NETBSDSRCDIR ] ; then 208 NETBSDSRCDIR=/usr/src 209fi 210if [ \! -d $NETBSDSRCDIR ] ; then 211 echo Unable to find sources 212 exit 1 213fi 214find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \; 215 216if [ -z $BSDOBJDIR ] ; then 217 BSDOBJDIR=/usr/obj 218fi 219if [ -d $BSDOBJDIR ] ; then 220 rm -rf $BSDOBJDIR 221fi 222 223cd $NETBSDSRCDIR && make cleandir 224 225---cut here--- 226 227Critical utilities: 228^^^^^^^^^^^^^^^^^^^ 229 usr.bin/compile_et 230 usr.bin/make 231 usr.bin/yacc 232 usr.bin/lex 233 usr.bin/xlint 234 usr.bin/config 235 236Other problems and possible solutions: 237^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 238Symptom:Complaints involving a Makefile. 239Fix: Rebuild usr.bin/make: 240 cd usr.bin/make && make && make install 241 Or, a failsafe method if that doesn't work: 242 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin 243 244Fix: Make sure .mk files are up to date. 245 cd share/mk && make install 246 247Symptom:Kernel `config' fails to configure any kernel, including GENERIC. 248Fix: Rebuild usr.bin/config 249 250Symptom: 251Fix: Rebuild usr.bin/yacc 252 253Symptom: 254Fix: Rebuild usr.bin/lex 255 256Symptom: 257Fix: rm /usr/lib/libbfd.a 258 259Symptom:Obsolete intermediate files are used during compilation 260Fix: Try the following sequence of commands in the directory in question. 261 make cleandir; rm `make print-objdir`; make cleandir; make obj 262 (If you built the tree without "make obj" in the past, obsolete files 263 may remain. The command tries to clean everything up) 264 265Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type 266Fix: Rebuild and install usr.bin/menuc 267 268Symptom:mklocale not found during build in share/locale/ctype 269Fix: Build and install usr.bin/mklocale 270 271Symptom:undefined reference to `__assert13' or `__unsetenv13' 272Fix: Rebuild and install lib/libc 273 274Symptom:usr.bin/config fails to build. 275Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile. 276 277Symptom:undefined reference to `getprogname' or `setprogname' 278Fix: Rebuild and install lib/libc 279 280Symptom:lint does not understand the '-X' option 281Fix: May need to build & install libs with NOLINT=1 before rebuilding lint 282