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