UPDATING revision 1.150
1$NetBSD: UPDATING,v 1.150 2006/08/15 20:48:01 bjh21 Exp $
2
3This file (UPDATING) is intended to be a brief reference to recent
4changes that might cause problems in the build process, and a guide for
5what to do if something doesn't work.
6
7For a more detailed description of the recommended way to build NetBSD
8using build.sh, see the BUILDING file.
9
10Note that much of the advice in this UPDATING file was written before
11build.sh existed.  Nevertheless, the advice here may be useful for
12working around specific problems with build.sh.
13
14See also: BUILDING, build.sh, Makefile.
15
16Recent changes:
17^^^^^^^^^^^^^^^
18
1920060814:
20	The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been
21	withdrawn.  Use vidcvideo and pckbd instead.  See the GENERIC
22	kernel configuration for an example.  X servers from the last
23	few years should cope.
24
2520060703:
26	MPACPI is no more. We always configure PCI interrupts using ACPI
27	if we have an ACPI kernel. The option MPACPI_SCANPCI has been renamed
28	to ACPI_SCANPCI. Thanks to work from fvdl.
29
3020060627:
31	socket(2) has changed, and its system call has been versioned.
32	For userlands with the old version of socket(2), make sure that
33	your kernel has 'options COMPAT_30' set, or else 'bad system call'
34	errors will result.
35
3620060526:
37	The kernel linker scripts for i386 and xen 
38	(sys/arch/i386/conf/kern.ldscript*) were changed to set the
39	load address correctly, for the benefit of MULTIBOOT boot loaders
40	(like Grub). If you use a linker (ld) older than from 2006/04/17, it
41	will be unable to link the kernel because of a bug and ld will fail
42	with an error like:
43	    ../../../../arch/i386/conf/kern.ldscript:45 \
44		non constant expression for load base
45	You need to update at least src/gnu/dist/binutils/ld and recompile
46	and install the linker. If using the build.sh script, the easiest
47	way is with a "build.sh tools" command, with any other options
48	that you use normally. When using build.sh, the linker binary is
49	installed as ${TOOLDIR}/bin/i386--netbsdelf-ld.
50
5120060131:
52	the protocol between the sparc64 bootloader (ofwboot) and
53	the kernel was changed. Before installing a new kernel,
54	you need to update ofwboot. After a full build, just copy
55	/usr/mdec/ofwboot to /, or do a rebuild of
56	src/sys/arch/sparc/stand/ofwboot and install the result to /.
57
5820050917:
59	arch/*/conf/std.* was changed to include conf/std, which
60	contains MI options previously enabled by default.
61	If you have kernel config files which doesn't include
62	arch/*/conf/std.*, you need to edit them to include conf/std
63	to get the previous configuration.
64
6520050830:
66	named.conf was moved from /etc/namedb to /etc.
67	postinstall(8) migrates this during interactive use.
68	Users of MKUPDATE=yes will need to manually rectify
69	this in their DESTDIR.
70
7120050825:
72	Some data structures in sys/device.h, related to interface
73	attributes and locator names, were changed. config(1) was
74	modified to emit the new data structures.
75	Thus usr.bin/config must be updated (and run on the kernel
76	configuration file) before a new kernel can be built.
77
7820050531:
79	genassym.sh(8) was moved to genassym(1). You need to either build
80	tools first or install the version of genassym from /usr/bin before
81	you can build a kernel again.
82
8320050520:
84	Because a kernfs bug which xentools relies on was fixed,
85	xentools up to xentools20-2.0.3nb4 won't work with new kernel.
86
8720050417:
88	postinstall(8) was moved from /etc to /usr/sbin and made part
89	of the "base" set, to make it easier to invoke after an
90	upgrade.
91
9220050325:
93	pcppi(4) was separated in two devices, adding attimer(4).  Be sure
94	to add a config line for an attimer(4) device in your kernel
95	configuration, or you won't be able to set the pitch of the beep
96	with wsconsctl.  Depending on the default value for the pitch, you
97	might even not hear any more beep.  Also, it is advised to attach both
98	devices the same way (i.e., both on isa or both on acpi) or the
99	pcppi(4) device may fail to find the attimer(4) one.
100
10120050211:
102	Fixes to tools/Makefile.gnuhost may cause UPDATE=1 builds in
103	some of the cross tools to fail if they use configure. Some configure's
104	cache the environment passed in and notice the new environment is
105	different and abort. Doing a clean in tools/ should be enough to
106	make a build continue.
107
10820050109:
109	Since su is using pam by default now, make sure that you have
110	/etc/pam.d populated (postinstall will do that automatically
111	for you). Otherwise su will fail open (i.e. will not require
112	a password).
113
11420041229:
115	Make had a path resolution bug that manifested itself as not
116	being able to install openpam.3. This bug has been fixed, but
117	you might need to rebuild make manually first to get through
118	the build.
119
12020041201:
121	Userland programs have been changed to use /dev/bpf instead of
122	/dev/bpfX. You need to create that device by installing a new
123	MAKEDEV and running it, or mv /dev/bpf0 /dev/bpf && rm /dev/bpf[0-9]*
124
12520041006:
126
127	A bug was introduced into /bin/sh (var.c rev 1.35) which causes
128	variables to not export correctly to subshells in all cases. This
129	will cause builds to break if that version of /bin/sh is installed
130	on the system. The proper version of /bin/sh can be verified with:
131
132        ident /bin/sh | grep var
133
134	Any /bin/sh w. version 1.35 will not work and needs to be updated
135	before attempting a build.
136	
13720041001:
138	The ipfilter kernel sources moved from sys/netinet to
139	dist/sys/ipf/netinet. Due to the move some Makefile
140	dependencies are now dangling requiring a make cleandir
141	before they work again (kdump, ktruss, rescue, ipf, and
142	ftp-proxy are the victims).
143
14420040715:
145	The rc.d/sendmail script now uses a heuristic to determine
146	if sendmail should be started at boot time.  It checks the
147	contents of /etc/mailer.conf, /etc/mail/submit.cf, and the
148	owner and mode of the sendmail binary to see if any changes
149	to the mail infrastructure have been made.  If no changes
150	are detected, it will start an SMTP listener.
151
152	Setting sendmail=NO in /etc/rc.conf will override this.
153
154	If you are only using sendmail by default and only for
155	local delivery, it is important that you also update your
156	sendmail.cf so that the SMTP listener only listens on the
157	loopback interface.
158
15920040715:
160	The method by which athhal-elf.o gets pulled into i386
161	kernel builds has been changed again.  The latest version
162	of bsd.files.mk is no longer required.
163
16420040621:
165	Due to the recent rototill of tools/compat it's crucial one starts
166	from a clean objdir under tools/*.
167
168	This is mostly due to generated files (yacc and lex sources) needing
169	to be generated with new rules from bsd.hostprog.mk.
170
171	The safest course is to rm -rf all objects under tools before building.
172
17320040516:
174	The end-user modifiable X11 configuration has been moved
175	from /usr/X11R6/lib/X11/<dir> to /etc/X11/<dir>.
176	Ensure that src and xsrc is up to date, and run
177	"make cleandir" in src/x11 before your next build.
178
179	postinstall currently doesn't migrate the files from
180	/usr/X11R6/lib/X11/* to /etc/X11/* although it does
181	detect that this needs to occur, so you'll have to
182	manually move these files yourself.
183
18420040426:
185	Support for the original dynamic sysctl node structure has
186	been removed in favor of the newer layout.  This affects
187	consumers of the create and delete interface, as well as
188	the dynamic discovery mechanism.  This is believed only to
189	be the sysctl(8) binary itself, at this point in time, so
190	the only effect of this should be that a sysctl binary
191	built from sources dated between 2003/12/04 and 2004/03/24
192	will not work on a kernel built from sources dated after
193	2004/04/25.  If you need a new sysctl binary but build.sh
194	does not work, make sure that your revision of
195	src/sys/sys/sysctl.h is 1.112 (or later), and then the
196	do the following:
197
198	cd /usr/src (or wherever your source tree is)
199	make USETOOLS=no includes
200	cd lib/libc
201	make USETOOLS=no dependall install
202	cd ../../sbin/sysctl
203	make USETOOLS=no dependall install
204
205	If you are using older sysctl binary, GNU autoconf would fail to
206	identify your machine architecture, and tries to build binary for
207	"unknown-unknown-netbsd20F" or something like that.  if that happens,
208	make sure to follow the above steps.
209
21020040425:
211	The ffs superblock issues listed below under 20040109 and 20030402
212	are now automatically addressed by the /etc/rc.d/fixsb script or by
213	sysinst when it checks a a filesystem. The manual fsck_ffs -b16 -c4
214	invocation mentioned below will continue to work and is now
215	automated by those scripts.  Note that under certain circumstances,
216	affected filesystems upgraded to a -current kernel first before
217	upgrading their userland with the fixsb and fsck_ffs fixes may
218	encounter a 'freeing free inode' panic when writing to the affected
219	filesystem, so it is a good idea to repair the filesystem as soon as
220	possible.  For more details on the fixsb script, see pr install/25138.
221
22220040418:
223	statfs(2) and friends have been replaced with statvfs(2). Before
224	installing a newly build userland make sure that you are running
225	a newly built kernel with COMPAT_20 set. In addition your libc
226	build might not work (undefined SYS_statfs symbol) because make
227	clean does not know how to remove files it does not know about
228	anymore. Manually remove all generated .S sources and objects
229	from the libc build directory.
230
23120040326:
232	The method by which athhal-elf.o gets pulled into i386 kernel builds
233	has been changed. The file is now stored as a uuencoded file in CVS
234	and the generated Makefile will use the new .uue rules from bsd.file.mk
235	to build it.
236
237	This means you must have the latest bsd.files.mk installed when
238	building a kernel without USETOOLS=yes.
239
24020040318:
241	A bug in the cgd(4) blowfish code was corrected, without
242	provision of backwards compatibility, after several public
243	notices over several months. Users of cgd with blowfish cipher
244	ONLY must dump their data before updating their kernels, and
245	recreate cgd's and restore data using the new kernel. See
246	(recent message to current-users, URL when mail-index has updated)
247
24820040313:
249	On acorn32, the opms and qms drivers have been withdrawn, and
250	the old wsqms driver is now called qms.  Kernel config files
251	will need updating.  See the ones in sys/arch/acorn32/conf
252	for examples.
253
25420040125:
255	On acorn32, the beep and sysbeep devices are no longer
256	needed, and will need to be deleted from kernel configuration
257	files.
258
25920040109:
260	Compatibility for old ffs superblock layouts has been
261	added, and the restrictive fsck checks have been reenabled
262	when using those layouts.  If you have been using -current
263	since 20030402, you may find that fsck again signals fatal
264	superblock mismatches.  To repair, make sure you have
265	an updated fsck_ffs and then you can use fsck_ffs -b 16 -c 4
266	to complete the filesystem upgrade.  A message has
267	been added to the kernel which should detect this problem.
268	See the following discussion for more information:
269	http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html
270
27120031203:
272	New binutils builds may fail due to old dependencies.
273	It's necessary to "make cleandir" to ensure that
274	the dependencies will be rebuilt correctly.
275
27620031111:
277	A newer mkdep is needed.  Error noting that is
278		cc: Ambiguous abbreviation --
279
28020031008:
281	/usr/include/sys/disklabel_mbr.h was removed.
282	It's necessary to "make cleandir" to ensure that
283	the dependencies will be rebuilt correctly.
284
28520031007:
286	A sign exension bug was fixed which set all the high bits
287	of our newly expanded ffs fs_flags.  This should only
288	affect users who installed or upgraded in September of 2003.
289	A small utility program was posted to tech-kern which
290	should fix this problem, and a warning message was added
291	to the kernel which should discover and warn about it.  See
292	http://mail-index.NetBSD.org/tech-kern/2003/10/07/0005.html
293
29420030906:
295	With the addition of siginfo support the old signal trampoline
296	code has been deprecated to COMPAT_16. Make sure that your running
297	kernel has COMPAT_16 enabled before building userland.
298
29920030801:
300	With the new openssl, there is some header and library shuffling.
301	rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \
302	/usr/lib/libdes* before building.
303
30420030703:
305	Texinfo was updated to 4.6.  To avoid failures when trying to
306	build the included texinfo files, do:
307
308	cd src/gnu/usr.bin/texinfo
309	make MKINFO=no dependall install
310
31120030630:
312	Groff was updated to 1.19; it's probably necessary to do
313		cd share/mk && make install
314		cd src/gnu/usr.bin/groff
315		make MKMAN=no dependall install
316	(untested).
317
31820030516:
319	Due to bugs in the export handling code, invalid export lines
320	were accepted before and caused the kernel to panic when
321	mountd got restarted because it freed memory that had already
322	been freed. This has been fixed and the kernel checks
323	export addresses very strictly. If you upgrade your kernel,
324	make sure you also upgrade mountd, because if your export
325	file contains lines with an old inet4 address syntax (i.e.
326	a.b.c or a.b or a), they will get rejected by the new kernel.
327
32820030402:
329	The superblock layout for FFS was changed.  If you have 1.6
330	fsck binaries, they will signal a fatal superblock mismatch
331	with the first alternate, because they compare too many
332	fields (even ones that aren't useful).  If possible, upgrade
333	your fsck_ffs binary before using a new kernel.
334	None of this signals actual filesystem damage.
335
33620030324:
337	sendmail version 8.12.8 was imported.  Since sendmail is
338	now setgid to the smmsp group, and runs in "collection"
339	mode for most common activities, there is a new config
340	file called submit.cf that needs to live in /etc/mail.
341	The generic submit.cf sample in /usr/share/sendmail/cf
342	is named netbsd-msp.cf.  Upgrading your regular sendmail
343	configuration file is also strongly advised.
344
345	See the section named "MESSAGE SUBMISSION PROGRAM" in
346	the updated /usr/share/sendmail/README file for more
347	information.
348
34920030117:
350	Texinfo was updated to 4.3.  To avoid failures when trying to
351	build the included texinfo files, do:
352
353	cd src/gnu/usr.bin/texinfo
354	make MKINFO=no dependall install
355
35620021223:
357	The METALOG format changed slightly, to remove the leading
358	"${DESTDIR}" from path names.
359	This only affects people building with UNPRIVED.
360	For complete safety, remove the DESTDIR entirely and
361	update tools/mtree, before running make build.
362
36320021219:
364	CVS repository layout was changed.  See the following for details
365	if you are using (anonymous) cvs to update your tree.
366
367	http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html
368
36920021219:
370	install(1) had a '-N dbdir' option added, to specify an
371	alternate location to look up users & groups (instead
372	of the host system passwd(5) and group(5) databases).
373
374	The build system was modified to take advantage of
375	this option (using ${NETBSDSRCDIR}/etc), so if you
376	use USETOOLS==no, you may have to rebuild and
377	reinstall usr.bin/xinstall first.
378
37920021130:
380	fparseln(3) moved from libutil to libc.
381	If building to DESTDIR=/, reinstall the includes
382	and rebuild libc:
383		make includes
384		make do-lib-libc
385	If using build.sh, "cd tools/compat && make clean"
386	before rebuilding the tools.
387
38820021126:
389	The mk.conf(5) variable SYS_INCLUDE has been deprecated,
390	including the optional "SYS_INCLUDE=symlinks" support.
391	All header files, including <sys/*.h> are copied into
392	/usr/include.
393
39420021121:
395	The C run-time support files crtbegin.o and crtend.o
396	(and their companions crtbeginS.o and crtendS.o) were
397	split up, with new crti.o and crtn.o files resulting.
398	This means that libtool needs to be rebuilt once the
399	new libraries are installed.  The process of rebuilding
400	libtool will cause it to automatically notice the new
401	required files, but it *must* be rebuilt in order to
402	do this.
403
404	An out-of-date libtool will result in shared libraries
405	which lack _init() and _fini() routines, which means that
406	their global contructors/destructors will not be invoked.
407
40820021121:
409	A bug related to how ARM ELF objects were tagged has been
410	corrected.
411
412	NetBSD ARM ELF uses the soft-VFP floating point model by
413	default.  However, the assembler lacked support for marking
414	objects as using the VFP floating point format, and the
415	compiler was not properly passing the flag indicating "soft-VFP"
416	to the assembler.
417
418	Unfortunately, this means that the linker will now consider
419	old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be
420	incompatible with new (properly marked) objects.
421
422	The problem will only manifest itself if you attempt to compile
423	a new program using the fixed toolchain, and link that program
424	against old libraries which do not have the proper "softvfp"
425	markings.  ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES
426	WILL CONTINUE TO WORK PROPERLY.
427
428	The only work-around for the problem is to recompile all of
429	the libraries on the system.  The easiest way to do this for
430	system libraries is to install a binary snapshot; they are
431	generally available on releng.NetBSD.org.  Any packages you
432	have installed which supply libraries will have to be recompiled
433	if you wish to link new programs against those libraries.
434
435	If you have questions about this matter, please contact
436	port-arm@NetBSD.org.
437
43820021011:
439	Systrace has been improved to support privilege elevation.
440	Updating the kernel requires the userland part of systrace
441	to be rebuilt.
442
44320021010:
444	The config(8) grammar was changed to allow options to register
445	dependencies on attributes, as well as other options.  Users
446	must update and reinstall usr.sbin/config before building a new
447	kernel.
448
44920021009:
450	A new attribute dependency syntax was introduced to config(8),
451	which is now used by the SCSI configuration description.  Users
452	must update and reinstall usr.sbin/config before building a new
453	kernel.
454
45520021003:
456	Several changes have been made to the autoconfiguration
457	framework.  Users must update and reinstall usr.sbin/config
458	before building a new kernel.
459
46020021001:
461	The i386mp branch has been merged.  To compile a kernel, users
462	will need to add the option 'cpu* at mainbus?' to their configuration
463	file.  Multiprocessor kernels will need
464	ioapic*		at mainbus? apid ?
465	options		MULTIPROCESSOR
466	options		COM_MPLOCK
467
46820020922:
469	MKDYNAMICROOT=yes enabled by default, which means that
470	certain shared libraries are installed into /lib, the shared
471	linker is installed into /libexec, and all programs in /bin
472	and /sbin are dynamically linked.
473	If you do not use "make build", you should ensure that
474	you have the libraries and shared linker in the new locations,
475	with:
476		make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so
477
47820020917:
479	USE_NEW_TOOLCHAIN has been replaced with:
480	    -	TOOLCHAIN_MISSING -- set to "yes" on platforms for which
481		there is no working in-tree toolchain (hppa, ns32k, sh5,
482		x86_64).
483	    -	EXTERNAL_TOOLCHAIN -- if defined by the user, points to the
484		root of an external toolchain (e.g. /usr/local/gnu).  This
485		enables the cross-build framework even for TOOLCHAIN_MISSING
486		platforms.
487
48820020906:
489	gehenna-devsw has been merged into the trunk. Need to update and
490	reinstall usr.sbin/config before building the kernel.
491
49220020822:
493	Crunched rescue tools (contents of /bin and /sbin, plus others)
494	are now provided in /rescue.
495
496	To ensure that these are built statically linked (no matter
497	what the setting of LDSTATIC is), use a crunchgen(1) built
498	from sources newer than 20020820 (see the next entry).
499
50020020820:
501	crunchgen(1) changed to ensure that the generated program
502	is statically linked.
503
504	Solution: update and reinstall usr.bin/crunch
505
50620020605:
507	smmsp user/group has been added for sendmail.
508
509	Add the following into /etc/group:
510
511	smmsp:*:17:
512
513	and the following to /etc/master.passwd (via vipw):
514
515	smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin
516
51720020515:
518	sshd user/group has been added.  Need to hand add this in, or sshd
519	will not let you log in (with default, or UsePrivlegeSeparation=yes)
520
521	Add the following into /etc/group:
522
523	sshd:*:16:
524
525	and the following to /etc/master.passwd (via vipw):
526
527	sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin
528	
529	Also /var/chroot/sshd directory needs to be present (digged as part of
530	the build process).
531
53220020426:
533	NBUILDJOBS obsoleted in favor of just using -j.
534
53520020426:
536	etc/postinstall added, which performs various checks for 
537	configuration file updates and changes, and can fix most of
538	the problems identified.
539	This should make it much easier to upgrade a system's
540	configuration from earlier systems (as far back as NetBSD 1.5).
541
54220020320:
543	<bsd.lib.mk> needs a new install(1) for its "-a cmd" support.
544	Build and install at usr.bin/xinstall before the build.
545
54620020319:
547	Raw IPv6 socket now makes strict checking for sa_family and sa_len
548	on send(2) operation.  Be sure to have sbin/rtsol and usr.sbin/rtsold
549	newer than November 2001 when you upgrade the kernel.
550
55120020311:
552	ssh configuration files were moved from /etc to /etc/ssh.  Beware
553	if you restart your machine from remote.  Note that sshd.conf needs
554	to be changed (due to the use of "/etc" inside).
555
55620020223:
557	Users of the VAX port will need to rebuild and install gas
558	so it deal with the now present register prefix used in all
559	the VAX assembly files.
560
56120020118:
562	ntpd user/group has been added.  Need to hand add this in or builds
563	will break as mtree aborts early.
564
565	Add the following into /etc/group:
566
567	ntpd:*:15:
568
569	and the following to /etc/master.passwd (via vipw):
570
571	ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
572
57320011207:
574	If you're attempting to build a snapshot on sparc64 and are getting
575	reloc errors from the toolchain groff binary this means your native
576	toolchain has some broken C++ bits.
577
578	To fix:
579
580	Build a new toolchain (i.e. build.sh -t)
581	Use the new toolchain to build and install natively (i.e. /usr/lib)
582
583	gnu/lib/libgcc
584	gnu/lib/libstdc++
585
586	After this a snapshot will be able to be built.
587
58820011201:
589	In order for a sparc64 build to work you must have a working awk. If
590	you've built and installed a system with the new toolchain up to this
591	point you do not have a working awk as its ability to do floating
592	point is broken. 
593
594	To build:
595
596	remake and install gnu/lib/libgcc
597	remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
598	against the new libgcc.a)
599
60020011128:
601	Kernel config information was changed to use defflag in
602	the various "files" files.  Bug fixes to config(8) are
603	required in order for this to work properly.  Make sure
604	to build and install in usr.sbin/config before attempting
605	to build a new kernel.
606
60720011030:
608	libc/locale/wcstod.c now needs new lint(1). Update lint(1)
609	before building libc.
610
61120011029:
612	The new document BUILDING.mdoc (view with nroff | more, or
613	see pre-generated .txt and .html versions) describes the build
614	procedure in great detail.  BUILDING, and the USE_NEW_TOOLCHAIN
615	build process, are intended in the long run to replace this
616	manual update log.
617
618	Users building a USE_NEW_TOOLCHAIN system should read the
619	BUILDING document for caveats.  Generally, BUILDING supersedes
620	UPDATING for these systems, as tool updating is taken care of
621	by the new build system.
622
62320011028:
624	src/etc/Makefile now needs install to be able to handle
625	symlinks that point to nowhere. A bug in install that
626	prevented this was corrected.
627
628	Solution: update and reinstall usr.bin/xinstall
629	Better Solution: Use the new toolchain and it will just work
630	for you.
631
63220011006:
633	/etc/mtree/NetBSD.dist has been updated to take advantage of
634	absolute path support added to mtree(8). Older mtree(8)s don't
635	understand the format.
636
637	Solution: update and reinstall usr.sbin/mtree
638
63920011004:
640	Crunchgen has been updated to work via reach-over makefiles. Updating
641	is suggested before running a snapshot build
642
64320010915:
644	The new "ubcperf" code committed by Chuck Silvers removed
645	a header file, uvm/uvm_vnode.h.  There may be stale .depend
646	files that still reference this file.
647
648	Solution: "make cleandir && make dependall" in affected
649	directories.
650
65120010803:
652	grep.info is now built from grep.texi using makeinfo.  Since it
653	requires makeinfo v4.0, you need to install new texinfo before
654	building gnu/usr.bin/grep.  To install new texinfo, please follow
655	the instruction described in 20010726 entry.
656
65720010803: 
658	(i386 only): i386 kernel now uses new instructions like
659	`fxsave' which old gas doesn't understand.  To build the
660	kernel successfully, you need to build and install a new toolchain, 
661	(i.e., build.sh -t) or 	(temporarily) comment out "options I686_CPU" 
662	from your kernel configuration until you rebuild your userland.
663	See 20011029 above and BUILDING file in this directory for more information.
664	[updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled]
665
66620010731:
667	Bootloader update on ELF platforms.  DDB in kernels from before
668	this will be unable to read symbol tables provided by newer
669	bootloaders.
670
67120010726:
672	Texinfo was updated to 4.0.  To avoid failures when trying to
673	build the included texinfo files, do:
674
675	cd src/gnu/usr.bin/texinfo
676	make MKINFO=no dependall install
677
67820010718:
679	Enabled correct .init/.fini processing in crt0.  The way this
680	was done was to change a -I directive to cc(1), which means
681	make(1) will have a stale dependency (it will be checking the
682	timestamp on the wrong "dot_init.h").
683
684	The symptom you will see is that new programs die with SIGSEGV
685	if you have a stale dependency.
686
687	Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
688	before starting your build.
689
69020010628:
691	A construct was added to uvm_page.h that uncovered a bug
692	in lint(1).  If you get a warning/error about a non-portable
693	bitfield, update your lint(1) before proceeding.
694
69520010226:
696	Added named user/group to system. Need to hand add this in or builds
697	will break as mtree aborts early.
698
699	To work around add by hand:
700
701	named:*:14:
702
703	to /etc/group and add:
704
705	named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
706
707	to master.passwd (use vipw for instance if doing by hand).
708
709	Now a make build should progress.
710
71120010219:
712	get/setprogname() added. Any hostprogs that may use this will need
713	to be bootstrapped manually until the host system is current.
714
715	Known problems: sys/arch/macppc/stand/fixcoff
716			usr.sbin/config (adding -DMAKE_BOOTSTRAP to
717			  CFLAGS and rebuilding should work)
718			usr.sbin/mdsetimage - Build a static copy if
719			  building a snapshot before fully bootstrapped.
720
72120010204:
722	prepare the code to compile with stricter gcc flags. in
723	particular start eliminating redundant declarations. Yacc
724	needs to be installed before make build.
725
72620010114:
727	introduce .if commands(target) in make(1). You need to
728	bring everything up-to-date first, then without installing
729	anything make and install in usr.bin/make, then proceed
730	with make build.
731
73220010101:
733	bsd.subdir.mk committed 20001230 had a bug which caused
734	afterinstall targets to run too soon; update again.
735
73620001230:
737	New share/mk files needed to support .WAIT in SUBDIR variables.
738	If you get make errors, 
739		(cd share/mk; make install)
740	Also, PRINTOBJDIR has changed and is now used more heavily.
741
74220001019:
743	The `ca' device driver has been replaced by `ld'; although the
744	major and minor numbers haven't changed, you should update your /dev
745	directory.
746
74720000929:
748	The following make directives are obsoleted.
749	MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 
750	By default, RSA is built into libcrypto.  IDEA and RC5 will not be
751	built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
752	additional library libcrypto_{idea,rc5}.
753
754
755Hints for a more successful build:
756^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
757    Use build.sh, but do not use its "expert mode":
758	This will automatically build the tools in the
759	   correct order, and it will keep the tools and the
760	   new build products from interfering with the running
761	   system.  This will allow you to ignore most of the
762	   other advice in this file.
763    Build a new kernel first:
764	This makes sure that any new system calls or features
765	   expected by the new userland will be present.  This
766	   helps to avoid critical errors when upgrading.
767    Use object directories:
768	This helps to keep stale object
769	   files from polluting the build if a Makefile "forgets"
770	   about one.  It also makes it easier to clean up after
771	   a build.  It's also necessary if you want to use the
772	   same source tree for multiple machines.
773	   To use object directories with build.sh:
774	    a) invoke build.sh with the "-M" or "-O" options.
775	   To use object directories without using build.sh:
776	    a) cd /usr/src ; make cleandir
777	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
778	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
779	    d) cd /usr/src ; make build
780	   Note that running "make obj" in a directory will create
781	   in obj.$MACHINE directory.
782    Build to a DESTDIR:
783	This helps to keep old installed files (especially libraries)
784	   from interfering with the new build.
785	   To build to a DESTDIR with build.sh, use the "-D" option.
786	   To build to a DESTDIR without using build.sh, set the DESTDIR
787	   environment variable before running make build.  It should be
788	   set to the pathname of an initially empty directory.
789	   Problems: if you do not use build.sh, you might need to
790		update critical utilities without using DESTDIR since
791		nothing is executed from what is installed in DESTDIR.
792		(See critical utils, below.)
793    Build often:
794	This keeps critical utilities current enough to not choke
795	on any other part of the source tree that depends on up to
796	date functionality.  If you use build.sh, you should not have
797	this problem.
798 
799What to do if things don't work:
800^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
801When things don't work there is usually a few things that commonly
802should be done.
803    1)	make includes
804	This should be done automatically by make build.
805    2)  cd share/mk && make install
806	Again, automatically done by make build.
807
808Failsafe rebuild of a small part of the tree:
809^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
810To make sure you rebuild something correctly you want to do
811something like the following:
812    1)  Make sure the includes and .mk files are up to date.
813    2)  Make sure any program used to build the particular
814	utility is up to date.  (yacc, lex, etc...)
815    3)  cd ...path/to/util...
816	make cleandir
817	rm ...all obj directories...
818	make cleandir			# yes, again
819	make obj
820	make depend && make
821
822Failsafe rebuild of the entire tree:
823^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
824If you really want to make sure the source tree is clean and
825ready for a build try the following.  Note that sourcing /etc/mk.conf
826(a make(1) Makefile) in this manner is not right, and will not work
827for anyone who uses any make(1) features in /etc/mk.conf.
828
829---cut here---
830#!/bin/sh
831. /etc/mk.conf
832
833if [ -z $NETBSDSRCDIR ] ; then
834    NETBSDSRCDIR=/usr/src
835fi
836if [ \! -d $NETBSDSRCDIR ] ; then
837    echo Unable to find sources
838    exit 1
839fi
840find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
841
842if [ -z $BSDOBJDIR ] ; then
843    BSDOBJDIR=/usr/obj
844fi
845if [ -d $BSDOBJDIR ] ; then
846    rm -rf $BSDOBJDIR
847fi
848
849cd $NETBSDSRCDIR && make cleandir
850
851---cut here---
852
853Critical utilities:
854^^^^^^^^^^^^^^^^^^^
855	usr.bin/compile_et
856	usr.bin/make
857	usr.bin/yacc
858	usr.bin/lex
859	usr.bin/xlint
860	usr.bin/config
861
862Other problems and possible solutions:
863^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
864Symptom:Complaints involving a Makefile.
865Fix:	Rebuild usr.bin/make:
866	cd usr.bin/make && make && make install
867	Or, a failsafe method if that doesn't work:
868	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
869
870Fix:	Make sure .mk files are up to date.
871	cd share/mk && make install
872
873Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
874Fix:	Rebuild usr.bin/config
875
876Symptom:
877Fix:	Rebuild usr.bin/yacc
878
879Symptom:
880Fix:	Rebuild usr.bin/lex
881
882Symptom:
883Fix:	rm /usr/lib/libbfd.a
884
885Symptom:Obsolete intermediate files are used during compilation
886Fix:	Try the following sequence of commands in the directory in question.
887	make cleandir; rm `make print-objdir`; make cleandir; make obj
888	(If you built the tree without "make obj" in the past, obsolete files
889	may remain.  The command tries to clean everything up)
890
891Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
892Fix:	Rebuild and install usr.bin/menuc
893
894Symptom:mklocale not found during build in share/locale/ctype
895Fix:	Build and install usr.bin/mklocale
896
897Symptom:undefined reference to `__assert13' or `__unsetenv13'
898Fix:    Rebuild and install lib/libc
899
900Symptom:usr.bin/config fails to build.
901Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
902
903Symptom:undefined reference to `getprogname' or `setprogname'
904Fix:    Rebuild and install lib/libc
905
906Symptom:lint does not understand the '-X' option
907Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
908