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