UPDATING revision 1.44 1 $NetBSD: UPDATING,v 1.44 2001/10/29 19:57:38 tv Exp $
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 ^^^^^^^^^^^^^^^
10
11 20011029:
12 The new document BUILDING.mdoc (view with nroff | more, or
13 see pre-generated .txt and .html versions) describes the build
14 procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN
15 build process, are intended in the long run to replace this
16 manual update log.
17
18 Users building a USE_NEW_TOOLCHAIN system should read the
19 BUILDING document for caveats. Generally, BUILDING supersedes
20 UPDATING for these systems, as tool updating is taken care of
21 by the new build system.
22
23 20011028:
24 src/etc/Makefile now needs install to be able to handle
25 symlinks that point to nowhere. A bug in install that
26 prevented this was corrected.
27
28 Solution: update and reinstall usr.bin/xinstall
29 Better Solution: Use the new toolchain and it will just work
30 for you.
31
32 20011006:
33 /etc/mtree/NetBSD.dist has been updated to take advantage of
34 absolute path support added to mtree(8). Older mtree(8)s don't
35 understand the format.
36
37 Solution: update and reinstall usr.sbin/mtree
38
39 20011004:
40 Crunchgen has been updated to work via reach-over makefiles. Updating
41 is suggested before running a snapshot build
42
43 20010915:
44 The new "ubcperf" code committed by Chuck Silvers removed
45 a header file, uvm/uvm_vnode.h. There may be stale .depend
46 files that still reference this file.
47
48 Solution: "make cleandir && make dependall" in affected
49 directories.
50
51 20010803:
52 grep.info is now built from grep.texi using makeinfo. Since it
53 requires makeinfo v4.0, you need to install new texinfo before
54 building gnu/usr.bin/grep. To install new texinfo, please follow
55 the instruction described in 20010726 entry.
56
57 20010803:
58 (i386 only): i386 kernel now uses new instructions like
59 `fxsave' which old gas doesn't understand. To build the
60 kernel successfuly, you need to build and install new gas
61 (gnu/usr.bin/gas.new), or (temporarily) comment out
62 "options I686_CPU" from your kernel configuration until you
63 rebuilt your userland (and got a new gas).
64
65 20010731:
66 Bootloader update on ELF platforms. DDB in kernels from before
67 this will be unable to read symbol tables provided by newer
68 bootloaders.
69
70 20010726:
71 Texinfo was updated to 4.0. To avoid failures when trying to
72 build the included texinfo files, do:
73
74 cd src/gnu/usr.bin/texinfo
75 make MKINFO=no dependall install
76
77 20010718:
78 Enabled correct .init/.fini processing in crt0. The way this
79 was done was to change a -I directive to cc(1), which means
80 make(1) will have a stale dependency (it will be checking the
81 timestamp on the wrong "dot_init.h").
82
83 The symptom you will see is that new programs die with SIGSEGV
84 if you have a stale dependency.
85
86 Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
87 before starting your build.
88
89 20010628:
90 A construct was added to uvm_page.h that uncovered a bug
91 in lint(1). If you get a warning/error about a non-portable
92 bitfield, update your lint(1) before proceeding.
93
94 20010226:
95 Added named user/group to system. Need to hand add this in or builds
96 will break as mtree aborts early.
97
98 To work around add by hand:
99
100 named:*:14:
101
102 to /etc/group and add:
103
104 named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
105
106 to master.passwd (use vipw for instance if doing by hand).
107
108 Now a make build should progress.
109
110 20010219:
111 get/setprogname() added. Any hostprog's that may use this will need
112 to be bootstrapped manually until the host system is current.
113
114 Known problems: sys/arch/macppc/stand/fixcoff
115 usr.sbin/config (adding -DMAKE_BOOTSTRAP to
116 CFLAGS and rebuilding should work)
117 usr.sbin/mdsetimage - Build a static copy if
118 building a snapshot before fully bootstrapped.
119
120 20010204:
121 prepare the code to compile with stricter gcc flags. in
122 particular start eliminating redundant declarations. Yacc
123 needs to be installed before make build.
124
125 20010114:
126 introduce .if commands(target) in make(1). You need to
127 bring everything up-to-date first, then without installing
128 anything make and install in usr.bin/make, then proceed
129 with make build.
130
131 20010101:
132 bsd.subdir.mk committed 20001230 had a bug which caused
133 afterinstall targets to run too soon; update again.
134
135 20001230:
136 New share/mk files needed to support .WAIT in SUBDIR variables.
137 If you get make errors,
138 (cd share/mk; make install)
139 Also, PRINTOBJDIR has changed and is now used more heavily.
140
141 20001019:
142 The `ca' device driver has been replaced by `ld'; although the
143 major and minor numbers haven't changed, you should update your /dev
144 directory.
145
146 20000929:
147 The following make directives are obsoleted.
148 MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
149 By default, RSA is built into libcrypto. IDEA and RC5 will not be
150 built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build
151 additional library libcrypto_{idea,rc5}.
152
153
154 Hints for a more successful build:
155 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156 Build a new kernel first:
157 This makes sure that any new system calls or features
158 expected by the new userland will be present. This
159 helps to avoid critical errors when upgrading.
160 Use object directories:
161 This helps to keep stale object
162 files from polluting the build if a Makefile "forgets"
163 about one. It also makes it easier to clean up after
164 a build. It's also necessary if you want to use the
165 same source tree for multiple machines.
166 To use object directories:
167 a) cd /usr/src ; make cleandir
168 b) Add "OBJMACHINE=yes" to /etc/mk.conf
169 c) Add "MKOBJDIRS=yes" to /etc/mk.conf
170 d) cd /usr/src ; make build
171 Note that running "make obj" in a directory will create
172 in obj.$MACHINE directory.
173 Build to a DESTDIR:
174 This helps to keep old
175 installed files (especially libraries) from interfering
176 with the new build.
177 To build to a DESTDIR, set the DESTDIR environment
178 variable before running make build. It should be set to
179 the pathname of an initially empty directory.
180 Problems: you might need to update critical utilities
181 without using DESTDIR since nothing is executed
182 from what is installed in DESTDIR.
183 (See critical utils, below)
184 Build often:
185 This keeps critical utilities current enough to not choke
186 on any other part of the source tree that depends on up to
187 date functionality.
188
189 What to do if things don't work:
190 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191 When things don't work there is usually a few things that commonly
192 should be done.
193 1) make includes
194 This should be done automatically by make build.
195 2) cd share/mk && make install
196 Again, automatically done by make build.
197
198 Failsafe rebuild of a small part of the tree:
199 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200 To make sure you rebuild something correctly you want to do
201 something like the following:
202 1) Make sure the includes and .mk files are up to date.
203 2) Make sure any program used to build the particular
204 utility is up to date. (yacc, lex, etc...)
205 3) cd ...path/to/util...
206 make cleandir
207 rm ...all obj directories...
208 make cleandir # yes, again
209 make obj
210 make depend && make
211
212 Failsafe rebuild of the entire tree:
213 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214 If you really want to make sure the source tree is clean and
215 ready for a build try the following. Note that sourcing /etc/mk.conf
216 (a make(1) Makefile) in this manner is not right, and will not work
217 for anyone who uses any make(1) features in /etc/mk.conf.
218
219 ---cut here---
220 #!/bin/sh
221 . /etc/mk.conf
222
223 if [ -z $BSDSRCDIR ] ; then
224 BSDSRCDIR=/usr/src
225 fi
226 if [ \! -d $BSDSRCDIR ] ; then
227 echo Unable to find sources
228 exit 1
229 fi
230 find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
231
232 if [ -z $BSDOBJDIR ] ; then
233 BSDOBJDIR=/usr/obj
234 fi
235 if [ -d $BSDOBJDIR ] ; then
236 rm -rf $BSDOBJDIR
237 fi
238
239 cd $BSDSRCDIR && make cleandir
240
241 ---cut here---
242
243 Critical utilities:
244 ^^^^^^^^^^^^^^^^^^^
245 gnu/usr.bin/egcs
246 usr.bin/compile_et
247 usr.bin/make
248 usr.bin/yacc
249 usr.bin/lex
250 usr.bin/xlint
251 usr.sbin/config
252
253 Other problems and possible solutions:
254 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
255 Symptom:Unreasonable compiler errors.
256 Fix: Rebuild gnu/usr.bin/egcs
257
258 Symptom:Complaints involving a Makefile.
259 Fix: Rebuild usr.bin/make:
260 cd usr.bin/make && make && make install
261 Or, a failsafe method if that doesn't work:
262 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
263
264 Fix: Make sure .mk files are up to date.
265 cd share/mk && make install
266
267 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
268 Fix: Rebuild usr.sbin/config
269
270 Symptom:
271 Fix: Rebuild usr.bin/yacc
272
273 Symptom:
274 Fix: Rebuild usr.bin/lex
275
276 Symptom:
277 Fix: rm /usr/lib/libbfd.a
278
279 Symptom:Obsolete intermediate files are used during compilation
280 Fix: Try the following sequence of commands in the directory in question.
281 make cleandir; rm `make print-objdir`; make cleandir; make obj
282 (If you built the tree without "make obj" in the past, obsolete files
283 may remain. The command tries to clean everything up)
284
285 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
286 Fix: Rebuild and install usr.bin/menuc
287
288 Symptom:mklocale not found during build in share/locale/ctype
289 Fix: Build and install usr.bin/mklocale
290
291 Symptom:undefined reference to `__assert13'
292 Fix: Rebuild and install lib/libc
293
294 Symptom:usr.sbin/config fails to build.
295 Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
296
297 Symptom:undefined reference to `getprogname' or `setprogname'
298 Fix: Rebuild and install lib/libc
299
300 Symptom:lint does not understand the '-X' option
301 Fix: May need to build & install libs with NOLINT=1 before rebuilding lint
302