Annotation of src/UPDATING, Revision 1.59
1.59 ! lukem 1: $NetBSD: UPDATING,v 1.58 2002/04/26 15:54:41 lukem Exp $
1.1 abs 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: ^^^^^^^^^^^^^^^
1.59 ! lukem 10:
! 11: 20020426:
! 12: etc/postinstall added, which performs various checks for
! 13: configuration file updates and changes, and can fix most of
! 14: the problems identified.
! 15: This should make it much easier to upgrade a system's
! 16: configuration from earlier systems (as far back as NetBSD 1.5).
1.56 lukem 17:
18: 20020320:
19: <bsd.lib.mk> needs a new install(1) for it's "-a cmd" support.
1.57 itojun 20: build and install at usr.bin/xinstall before the build.
1.56 lukem 21:
1.55 itojun 22: 20020319:
23: raw IPv6 socket now makes strict checking for sa_family and sa_len
24: on send(2) operation. be sure to have sbin/rtsol and usr.sbin/rtsold
25: newer than November 2001 when you upgrade the kernel.
26:
1.54 itojun 27: 20020311:
28: ssh configuration files were moved from /etc to /etc/ssh. Beware
29: if you restart your machine from remote. Note that sshd.conf needs
30: to be changed (due to the use of "/etc" inside).
31:
32: 20020223:
1.53 matt 33: Users of the VAX port will need to rebuild and install gas
34: so it deal with the now present register prefix used in all
35: the VAX assembly files.
36:
1.50 itojun 37: 20020118:
38:
39: ntpd user/group has been added. Need to hand add this in or builds
40: will break as mtree aborts early.
41:
42: Add the following into /etc/group:
43:
44: ntpd:*:15:
45:
46: and the following to /etc/master.passwd (via vipw):
47:
48: ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
49:
1.49 jmc 50: 20011207:
51:
52: If you're attempting to build a snapshot on sparc64 and are getting
53: reloc errors from the toolchain groff binary this means your native
54: toolchain has some broken C++ bits.
55:
56: To fix:
57:
58: Build a new toolchain (i.e. build.sh -t)
59: Use the new toolchain to build and install natively (i.e. /usr/lib)
60:
61: gnu/lib/libgcc
1.51 pooka 62: gnu/lib/libstdc++
1.49 jmc 63:
64: After this a snapshot will be able to be built.
65:
1.47 jmc 66: 20011201:
67: In order for a sparc64 build to work you must have a working awk. If
68: you've built and installed a system with the new toolchain up to this
1.52 wiz 69: point you do not have a working awk as its ability to do floating
1.47 jmc 70: point is broken.
71:
72: To build:
73:
74: remake and install gnu/lib/libgcc
75: remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
1.48 jmc 76: against the new libgcc.a)
1.47 jmc 77:
1.46 thorpej 78: 20011128:
79: Kernel config information was changed to use defflag in
80: the various "files" files. Bug fixes to config(8) are
81: required in order for this to work properly. Make sure
82: to build and install in usr.sbin/config before attempting
83: to build a new kernel.
84:
1.45 yamt 85: 20011030:
86: libc/locale/wcstod.c now needs new lint(1). Update lint(1)
87: before building libc.
1.43 mason 88:
1.44 tv 89: 20011029:
90: The new document BUILDING.mdoc (view with nroff | more, or
91: see pre-generated .txt and .html versions) describes the build
92: procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN
93: build process, are intended in the long run to replace this
94: manual update log.
95:
96: Users building a USE_NEW_TOOLCHAIN system should read the
97: BUILDING document for caveats. Generally, BUILDING supersedes
98: UPDATING for these systems, as tool updating is taken care of
99: by the new build system.
1.42 perry 100:
101: 20011028:
102: src/etc/Makefile now needs install to be able to handle
103: symlinks that point to nowhere. A bug in install that
104: prevented this was corrected.
105:
106: Solution: update and reinstall usr.bin/xinstall
107: Better Solution: Use the new toolchain and it will just work
108: for you.
1.40 lukem 109:
110: 20011006:
111: /etc/mtree/NetBSD.dist has been updated to take advantage of
112: absolute path support added to mtree(8). Older mtree(8)s don't
113: understand the format.
114:
115: Solution: update and reinstall usr.sbin/mtree
1.39 jmc 116:
117: 20011004:
118: Crunchgen has been updated to work via reach-over makefiles. Updating
119: is suggested before running a snapshot build
1.36 tv 120:
1.35 thorpej 121: 20010915:
122: The new "ubcperf" code committed by Chuck Silvers removed
123: a header file, uvm/uvm_vnode.h. There may be stale .depend
124: files that still reference this file.
125:
126: Solution: "make cleandir && make dependall" in affected
127: directories.
1.31 enami 128:
129: 20010803:
130: grep.info is now built from grep.texi using makeinfo. Since it
131: requires makeinfo v4.0, you need to install new texinfo before
132: building gnu/usr.bin/grep. To install new texinfo, please follow
133: the instruction described in 20010726 entry.
1.30 enami 134:
135: 20010803:
1.41 wiz 136: (i386 only): i386 kernel now uses new instructions like
137: `fxsave' which old gas doesn't understand. To build the
1.52 wiz 138: kernel successfully, you need to build and install new gas
1.41 wiz 139: (gnu/usr.bin/gas.new), or (temporarily) comment out
140: "options I686_CPU" from your kernel configuration until you
141: rebuilt your userland (and got a new gas).
1.29 bjh21 142:
143: 20010731:
144: Bootloader update on ELF platforms. DDB in kernels from before
145: this will be unable to read symbol tables provided by newer
146: bootloaders.
1.27 assar 147:
148: 20010726:
149: Texinfo was updated to 4.0. To avoid failures when trying to
1.28 assar 150: build the included texinfo files, do:
151:
152: cd src/gnu/usr.bin/texinfo
153: make MKINFO=no dependall install
1.25 thorpej 154:
155: 20010718:
156: Enabled correct .init/.fini processing in crt0. The way this
157: was done was to change a -I directive to cc(1), which means
158: make(1) will have a stale dependency (it will be checking the
159: timestamp on the wrong "dot_init.h").
160:
161: The symptom you will see is that new programs die with SIGSEGV
162: if you have a stale dependency.
163:
164: Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
165: before starting your build.
1.26 thorpej 166:
167: 20010628:
168: A construct was added to uvm_page.h that uncovered a bug
169: in lint(1). If you get a warning/error about a non-portable
170: bitfield, update your lint(1) before proceeding.
1.21 jmc 171:
172: 20010226:
1.22 jmc 173: Added named user/group to system. Need to hand add this in or builds
1.21 jmc 174: will break as mtree aborts early.
175:
176: To work around add by hand:
177:
178: named:*:14:
179:
1.22 jmc 180: to /etc/group and add:
181:
182: named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
183:
184: to master.passwd (use vipw for instance if doing by hand).
185:
186: Now a make build should progress.
1.18 jmc 187:
188: 20010219:
1.52 wiz 189: get/setprogname() added. Any hostprogs that may use this will need
1.20 jmc 190: to be bootstrapped manually until the host system is current.
1.18 jmc 191:
192: Known problems: sys/arch/macppc/stand/fixcoff
1.19 cgd 193: usr.sbin/config (adding -DMAKE_BOOTSTRAP to
194: CFLAGS and rebuilding should work)
1.20 jmc 195: usr.sbin/mdsetimage - Build a static copy if
196: building a snapshot before fully bootstrapped.
1.15 christos 197:
198: 20010204:
199: prepare the code to compile with stricter gcc flags. in
200: particular start eliminating redundant declarations. Yacc
201: needs to be installed before make build.
1.10 christos 202:
203: 20010114:
204: introduce .if commands(target) in make(1). You need to
205: bring everything up-to-date first, then without installing
1.23 tron 206: anything make and install in usr.bin/make, then proceed
1.10 christos 207: with make build.
1.9 sommerfe 208:
209: 20010101:
210: bsd.subdir.mk committed 20001230 had a bug which caused
211: afterinstall targets to run too soon; update again.
1.8 sommerfe 212:
213: 20001230:
214: New share/mk files needed to support .WAIT in SUBDIR variables.
215: If you get make errors,
216: (cd share/mk; make install)
217: Also, PRINTOBJDIR has changed and is now used more heavily.
1.6 ad 218:
219: 20001019:
1.7 ad 220: The `ca' device driver has been replaced by `ld'; although the
1.6 ad 221: major and minor numbers haven't changed, you should update your /dev
222: directory.
1.1 abs 223:
1.4 itojun 224: 20000929:
225: The following make directives are obsoleted.
226: MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
227: By default, RSA is built into libcrypto. IDEA and RC5 will not be
1.16 wiz 228: built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build
1.4 itojun 229: additional library libcrypto_{idea,rc5}.
1.1 abs 230:
231:
232: Hints for a more successful build:
233: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2 mrg 234: Build a new kernel first:
235: This makes sure that any new system calls or features
236: expected by the new userland will be present. This
237: helps to avoid critical errors when upgrading.
1.1 abs 238: Use object directories:
239: This helps to keep stale object
240: files from polluting the build if a Makefile "forgets"
241: about one. It also makes it easier to clean up after
242: a build. It's also necessary if you want to use the
243: same source tree for multiple machines.
244: To use object directories:
245: a) cd /usr/src ; make cleandir
1.2 mrg 246: b) Add "OBJMACHINE=yes" to /etc/mk.conf
247: c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1 abs 248: d) cd /usr/src ; make build
1.2 mrg 249: Note that running "make obj" in a directory will create
250: in obj.$MACHINE directory.
1.1 abs 251: Build to a DESTDIR:
252: This helps to keep old
253: installed files (especially libraries) from interfering
254: with the new build.
255: To build to a DESTDIR, set the DESTDIR environment
1.2 mrg 256: variable before running make build. It should be set to
257: the pathname of an initially empty directory.
1.1 abs 258: Problems: you might need to update critical utilities
259: without using DESTDIR since nothing is executed
260: from what is installed in DESTDIR.
261: (See critical utils, below)
262: Build often:
263: This keeps critical utilities current enough to not choke
264: on any other part of the source tree that depends on up to
265: date functionality.
266:
267: What to do if things don't work:
268: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
269: When things don't work there is usually a few things that commonly
270: should be done.
271: 1) make includes
272: This should be done automatically by make build.
273: 2) cd share/mk && make install
274: Again, automatically done by make build.
275:
276: Failsafe rebuild of a small part of the tree:
277: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278: To make sure you rebuild something correctly you want to do
279: something like the following:
280: 1) Make sure the includes and .mk files are up to date.
281: 2) Make sure any program used to build the particular
282: utility is up to date. (yacc, lex, etc...)
283: 3) cd ...path/to/util...
284: make cleandir
285: rm ...all obj directories...
286: make cleandir # yes, again
287: make obj
288: make depend && make
289:
290: Failsafe rebuild of the entire tree:
291: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292: If you really want to make sure the source tree is clean and
1.2 mrg 293: ready for a build try the following. Note that sourcing /etc/mk.conf
294: (a make(1) Makefile) in this manner is not right, and will not work
295: for anyone who uses any make(1) features in /etc/mk.conf.
1.1 abs 296:
297: ---cut here---
298: #!/bin/sh
299: . /etc/mk.conf
300:
1.58 lukem 301: if [ -z $NETBSDSRCDIR ] ; then
302: NETBSDSRCDIR=/usr/src
1.1 abs 303: fi
1.58 lukem 304: if [ \! -d $NETBSDSRCDIR ] ; then
1.1 abs 305: echo Unable to find sources
306: exit 1
307: fi
1.58 lukem 308: find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
1.1 abs 309:
310: if [ -z $BSDOBJDIR ] ; then
311: BSDOBJDIR=/usr/obj
312: fi
313: if [ -d $BSDOBJDIR ] ; then
314: rm -rf $BSDOBJDIR
315: fi
316:
1.58 lukem 317: cd $NETBSDSRCDIR && make cleandir
1.1 abs 318:
319: ---cut here---
320:
321: Critical utilities:
322: ^^^^^^^^^^^^^^^^^^^
323: gnu/usr.bin/egcs
1.3 itojun 324: usr.bin/compile_et
1.1 abs 325: usr.bin/make
326: usr.bin/yacc
327: usr.bin/lex
1.11 lukem 328: usr.bin/xlint
1.2 mrg 329: usr.sbin/config
1.1 abs 330:
1.34 simonb 331: Other problems and possible solutions:
1.1 abs 332: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
333: Symptom:Unreasonable compiler errors.
334: Fix: Rebuild gnu/usr.bin/egcs
335:
336: Symptom:Complaints involving a Makefile.
1.17 erh 337: Fix: Rebuild usr.bin/make:
338: cd usr.bin/make && make && make install
339: Or, a failsafe method if that doesn't work:
340: cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
341:
1.1 abs 342: Fix: Make sure .mk files are up to date.
343: cd share/mk && make install
1.2 mrg 344:
345: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
346: Fix: Rebuild usr.sbin/config
1.1 abs 347:
348: Symptom:
349: Fix: Rebuild usr.bin/yacc
350:
351: Symptom:
352: Fix: Rebuild usr.bin/lex
353:
354: Symptom:
355: Fix: rm /usr/lib/libbfd.a
1.4 itojun 356:
357: Symptom:Obsolete intermediate files are used during compilation
358: Fix: Try the following sequence of commands in the directory in question.
359: make cleandir; rm `make print-objdir`; make cleandir; make obj
360: (If you built the tree without "make obj" in the past, obsolete files
361: may remain. The command tries to clean everything up)
1.5 wiz 362:
363: Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
364: Fix: Rebuild and install usr.bin/menuc
1.12 itojun 365:
366: Symptom:mklocale not found during build in share/locale/ctype
367: Fix: Build and install usr.bin/mklocale
1.13 dogcow 368:
369: Symptom:undefined reference to `__assert13'
370: Fix: Rebuild and install lib/libc
371:
1.19 cgd 372: Symptom:usr.sbin/config fails to build.
373: Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
1.13 dogcow 374:
1.19 cgd 375: Symptom:undefined reference to `getprogname' or `setprogname'
376: Fix: Rebuild and install lib/libc
1.24 abs 377:
378: Symptom:lint does not understand the '-X' option
379: Fix: May need to build & install libs with NOLINT=1 before rebuilding lint
CVSweb <webmaster@jp.NetBSD.org>