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