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