UPDATING revision 1.340
1$NetBSD: UPDATING,v 1.340 2023/07/11 15:05:17 martin 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
14Sections are marked with "^^^^^".  After the section on "Recent changes"
15are several sections containing more general information.
16
17See also: BUILDING, build.sh, Makefile.
18
19Recent changes:
20^^^^^^^^^^^^^^^
21
2220230604:
23	Building native kernels with the installed make(1) instead of
24	the $TOOLDIR/bin/nbmake-${arch} wrapper will fail if userland
25	has not been updated. Note that this is an unsupported build
26	configuration (but usually works if userland is -current enough).
27
2820230523:
29	ctfmerge was fixed as macOS host tool. This may require a clean tools
30	rebuild to detect the update to tools/compat/configure.
31
3220230515:
33	New openssl build requires removal of the crypto/external/bsd/openssl
34	and tests/crypto/libcrypto subdirectories in the ${OBJDIR} hierachy.
35	Otherwise test results may be wrong due to wrong "golden" output
36	files being installed.
37
3820230322:
39	Fixes for moved /lib/libisns* mean that builds will complain about
40	./usr/lib/libisns* being missing until src/lib/libisns is forced
41	to (re)install the files, including the symlinks.  The simplest
42	way is to clean this subdir before building.
43
4420230112:
45	New binutils require an updated ld.elf_so. If you are doing
46	(unsupported) in-place self builds (with the -E flag to build.sh),
47	make sure to have installed latest ld.elf_so before you rebuild
48	userland.
49
5020221116:
51	The addition to NetBSD's version of UFS2 of support for extended
52	attributes broke backward compatibility with previous releases
53	of NetBSD, so UFS2 has been restored to being compatible with
54	previous NetBSD releases by disabling extended attributes.
55	(Note that ACLs are implemented as extended attributes, so
56	this changes disables ACLs as well.)
57
58	Support for UFS2 with extended attributes is now available in a new
59	UFS variant called UFS2ea.  If you have created extended attributes
60	in an original UFS2 file system then "fsck -p" will now fail due to
61	the unexpected presence of extended attributes and "fsck -y" will
62	remove all extended attributes.  If you wish to preserve extended
63	attributes rather than delete them, there is a utility to convert
64	a UFS2 file system to UFS2ea and leave extended attributes in place,
65	but this should be used with caution since it will preserve any
66	extended attributes that have been corrupted by the backward
67	incompatibility too.
68
69	If you wish to use a UFS2ea file system as your root file system,
70	then you will need to update your boot loader to a version that
71	supports UFS2ea.
72
73	For more information, see:
74	https://wiki.netbsd.org/features/UFS2ea
75
7620221111:
77	The new libdrm import worsened the conflict issues for the
78	kdump/ktruss ioctl, and i915 now conflicts with base, and has
79	been turned off.  This will cause update build issues like:
80
81		kdump-ioctl.c:12175:143: error: 'DRM_IOCTL_I915_DESTROY_HEAP'
82		   undeclared here (not in a function);
83		   did you mean 'DRM_IOCTL_MODE_DESTROY_DUMB'?
84
85	You'll need to clean usr.bin/ktruss, usr.bin/kdump, and rescue.
86
8720220921:
88	Since the kernel version was bumped to 9.99.100, the bootloader
89	must be updated on x86 or EFI boot platforms in order to load
90	modules from boot.cfg(5) or interactively at the bootloader
91	prompt.
92
93	The kernel can still load modules at runtime, with modload(8)
94	or modules.conf(5), with no bootloader update.  This will not
95	affect release branches because it only applies to patch
96	numbers >=100.
97
98	On x86 (i386 or amd64) with BIOS boot, this requires copying a
99	new /usr/mdec/boot to /boot.  You can build this in the destdir
100	by running `$TOOLDIR/bin/nbmake-$ARCH dependall install' in
101	sys/arch/i386/stand.
102
103	On platforms with EFI boot (including x86 with EFI boot), this
104	requires copying a new /usr/mdec/boot*.efi to the EFI/BOOT/
105	directory on the EFI system partition.  The boot*.efi file is:
106
107	aarch64	bootaa64.efi
108	amd64	bootx64.efi
109	arm	bootarm.efi	(32-bit arm)
110	i386	bootx32.efi
111
112	You can build this in the destdir by running
113	`$TOOLDIR/bin/nbmake-$ARCH dependall install' in
114	sys/stand/efiboot/boot*.
115
11620220821:
117	Support for building extsrc/ has been deprecated.
118	EXTSRCSRCDIR and MKEXTSRC have been deprecated.
119
12020220714:
121	Updates to xorg-server and associated drivers may cause builds to
122	fail.  Cleaning both DESTDIR and the xorg build tree may be needed.
123
12420220628:
125	Changes in the build of src/games/robots require a clean build
126	of that program.
127
12820211116:
129	Changes in the xorg build require clean obj dirs for external/mit/xorg
130	(or a full clean/non-update build).
131
13220211112:
133	Device tree sources were updated for evbarm.  Some device nodes
134	(in particular, ld(4) devices on the ROCKPro64) will be renumbered.
135
13620211014:
137	MKPIE default for aarch64 has changed, a clean build is required.
138
13920210917:
140	Changed MNT_ACLS to default to POSIX1e ACLs instead of NFSv4
141	ACLs, to be compatible with FreeBSD. If you are using NFSv4 ACLs
142	and have "acls" in /etc/fstab you'll need to change it to "nfs4acls".
143
14420210711:
145	Updated GMP sources may require cleaning in tools/gmp and/or in
146	external/lgpl3/gmp/lib, particularly if GCC itself does not build.
147
14820210417:
149	GCC 10 was enabled for several platforms.  If builds fail in either
150	tools/gcc or external/gpl/gcc, first try cleaning those objects and
151	removing the $DESTDIR/usr/include/g++ subdirectory.
152
15320201230:
154	lint1/ops.c is no longer autogenerated.  If this makes the build
155	fail, clean $OBJDIR/tools/*lint* and $OBJDIR/usr.bin/*xlint*.
156
15720201016:
158	MIPS kernel modules have been disabled until they work.  This will
159	turn up in extra files in the DESTDIR, which should be cleaned.
160
16120200925:
162	GNU MPC and MPFR have been updated.  At least MPFR needs cleaning
163	in both the tools and external dirs.
164
16520200912:
166	GCC 9 has arrived for Arm and x86 platforms, and will be coming
167	for several more, as will binutils 2.34.  Clean as required.
168
16920200907:
170	GCC 9 is coming, and binutils has been updated for MIPS.  This
171	probably requires cleaning the tools/binutils.
172
17320200811:
174	GCC updates may require cleaning the objdir.  This may occur
175	due to GCC 7.5 update, GCC 8.4 move to gcc.old, or the upcoming
176	GCC 9 upgrade.
177
17820200614:
179	blacklist* has been renamed to blocklist*. postinstall(8)
180	should handle the migration.
181
18220200601:
183	Due to a mistake in LIBISPRIVATE handling, .so libraries were
184	created in the build directories and need cleaning.
185
18620200311:
187	GCC 8 ports will need cleaning in src/tools/gcc and
188	src/external/gpl3/gcc due to GCC 8.4 update.
189
19020191118:
191	More architectures were switched to gcc8:
192	    i386, ia64 powerpc64, sparc, sparc64, arm
193	The same comments as in 20191022 apply.
194
19520191112:
196	The LLVM update requires a clean rebuild for all architectures using
197	LLVM during the tools build phase (i386, amd64, aarch64).
198
19920191022:
200	Ports amd64 and aarch64 switched to GCC 8.3 by default.
201	In-place ("expert mode", build.sh -E) builds are not supported
202	when going from a GCC 7 userland to GCC 8. Do a regular
203	build to a different DESTDIR (or preferably: build.sh -U) at least
204	once and install sets, or download comp.{tar.xz,tgz} from the
205	daily builds and install that before doing the next in-place build.
206
20720191001:
208	GCC 8.3 was imported.  Builds of src/tools/gcc may fail if
209	old builds with GCC 7 output now uses GCC 8.  Clean this
210	directory, and also clean src/external/gpl3/gcc.
211
21220190903:
213	Files with names that coincide with existing files' names on
214	case-insensitive file systems were inadvertently committed, for
215	radeon GPU firmware.  We cannot mark these as obsolete for
216	postinstall to fix, so if you updated src since 2019-08-26, and
217	ran build.sh distribution or ran build.sh release, you must
218	manually delete the following files in your DESTDIR (which is
219	usually $OBJDIR/destir.$ARCH), or from / if you have installed
220	them:
221
222		/libdata/firmware/radeon/bonaire_ce.bin
223		/libdata/firmware/radeon/bonaire_mc.bin
224		/libdata/firmware/radeon/bonaire_me.bin
225		/libdata/firmware/radeon/bonaire_mec.bin
226		/libdata/firmware/radeon/bonaire_pfp.bin
227		/libdata/firmware/radeon/bonaire_rlc.bin
228		/libdata/firmware/radeon/bonaire_sdma.bin
229		/libdata/firmware/radeon/bonaire_smc.bin
230		/libdata/firmware/radeon/bonaire_uvd.bin
231		/libdata/firmware/radeon/hainan_ce.bin
232		/libdata/firmware/radeon/hainan_mc.bin
233		/libdata/firmware/radeon/hainan_me.bin
234		/libdata/firmware/radeon/hainan_pfp.bin
235		/libdata/firmware/radeon/hainan_rlc.bin
236		/libdata/firmware/radeon/hainan_smc.bin
237		/libdata/firmware/radeon/hawaii_ce.bin
238		/libdata/firmware/radeon/hawaii_mc.bin
239		/libdata/firmware/radeon/hawaii_me.bin
240		/libdata/firmware/radeon/hawaii_mec.bin
241		/libdata/firmware/radeon/hawaii_pfp.bin
242		/libdata/firmware/radeon/hawaii_rlc.bin
243		/libdata/firmware/radeon/hawaii_sdma.bin
244		/libdata/firmware/radeon/hawaii_smc.bin
245		/libdata/firmware/radeon/kabini_ce.bin
246		/libdata/firmware/radeon/kabini_me.bin
247		/libdata/firmware/radeon/kabini_mec.bin
248		/libdata/firmware/radeon/kabini_pfp.bin
249		/libdata/firmware/radeon/kabini_rlc.bin
250		/libdata/firmware/radeon/kabini_sdma.bin
251		/libdata/firmware/radeon/kaveri_ce.bin
252		/libdata/firmware/radeon/kaveri_me.bin
253		/libdata/firmware/radeon/kaveri_mec.bin
254		/libdata/firmware/radeon/kaveri_mec2.bin
255		/libdata/firmware/radeon/kaveri_pfp.bin
256		/libdata/firmware/radeon/kaveri_rlc.bin
257		/libdata/firmware/radeon/kaveri_sdma.bin
258		/libdata/firmware/radeon/mullins_ce.bin
259		/libdata/firmware/radeon/mullins_me.bin
260		/libdata/firmware/radeon/mullins_mec.bin
261		/libdata/firmware/radeon/mullins_pfp.bin
262		/libdata/firmware/radeon/mullins_rlc.bin
263		/libdata/firmware/radeon/mullins_sdma.bin
264		/libdata/firmware/radeon/oland_ce.bin
265		/libdata/firmware/radeon/oland_mc.bin
266		/libdata/firmware/radeon/oland_me.bin
267		/libdata/firmware/radeon/oland_pfp.bin
268		/libdata/firmware/radeon/oland_rlc.bin
269		/libdata/firmware/radeon/oland_smc.bin
270		/libdata/firmware/radeon/pitcairn_ce.bin
271		/libdata/firmware/radeon/pitcairn_mc.bin
272		/libdata/firmware/radeon/pitcairn_me.bin
273		/libdata/firmware/radeon/pitcairn_pfp.bin
274		/libdata/firmware/radeon/pitcairn_rlc.bin
275		/libdata/firmware/radeon/pitcairn_smc.bin
276		/libdata/firmware/radeon/tahiti_ce.bin
277		/libdata/firmware/radeon/tahiti_mc.bin
278		/libdata/firmware/radeon/tahiti_me.bin
279		/libdata/firmware/radeon/tahiti_pfp.bin
280		/libdata/firmware/radeon/tahiti_rlc.bin
281		/libdata/firmware/radeon/tahiti_smc.bin
282		/libdata/firmware/radeon/verde_ce.bin
283		/libdata/firmware/radeon/verde_mc.bin
284		/libdata/firmware/radeon/verde_me.bin
285		/libdata/firmware/radeon/verde_pfp.bin
286		/libdata/firmware/radeon/verde_rlc.bin
287		/libdata/firmware/radeon/verde_smc.bin
288
289	We will re-import these radeon firmware images another way
290	later.
291
29220190727:
293	The uefi bootloader has gained tftp support and needs a clean
294	build. If you do update builds, manually clean its object
295	directory by something like:
296	cd sys/arch/i386/stand/efiboot && make clean
297
29820190723:
299	The jemalloc allocator in libc is now build without extended
300	debugging (for performance reasons). In update builds make sure
301	to rebuild it completely, by removing all affected object files,
302	including compat builds, something like:
303	cd /usr/obj && find . -type d -name jemalloc|xargs rm -rf
304
30520190207:
306	GCC 7 switched for many ports.  Update builds are likely to fail.
307
30820180924:
309	A newer OpenSSL version has been imported. If you are doing
310	update builds, make sure to remove all old obj dirs, like:
311	cd /usr/obj && find . -type d -name openssl | xargs rm -rf
312
31320180717:
314	On aarch64 int64_t and related types have changed from long long
315	to long. This requires recompiling all C++ binaries.
316
31720180713:
318	On amd64 and i386 static binaries are now build position
319	independend. This requires recompilation of all object
320	files used to create the crunched /rescue binary.
321	Clean the rescue directory in your obj directory before
322	doing an update build, otherwise linking will fail.
323
32420180414:
325	Existing binutils was migrated to binutils.old.  Manual
326	removal of tools/binutils objects directory may be required
327	to fix tools build failure.
328
32920180311:
330	bdftopcf was updated and may need cleaning in the
331	src/external/mit/xorg/tools/bdftopcf subdirectory if there are
332	link errors.
333
33420180212:
335	between OpenSSL and GCC updates, many things may fail to build.
336	any failure that looks like GCC or openssl is best handled by
337	a clean destdir and objdir.  Full cleandir and destdir deletion
338	is recommended if build failures occur.
339
34020171225:
341	removal of the vadvise syscall requires manual removal of all
342	associated files from the libc build object directory (including
343	the .depend files) - a command like:
344		cd $OBJ && find . -type d -name libc | xargs rm -rf
345	For architectures that support multiple "compat" binary targets,
346	you'll need to cleanup both the regular libc directory and the
347	compat ones (the above command will do that).
348
34920171010:
350	a change to the build structure of external/bsd/acpica/bin/iasl
351	means that its objdir (or *.d and .depend at least) might need
352	to be manually removed - or a build done once without -u.
353
35420170822:
355	a new version of GMP has been imported and probably
356	will break parts of builds related to themselves or GCC, both
357	in the tools and the native section.  Remove all GCC, GMP, MPFR
358	and MPC objdirs or build once without -u.
359
36020170816:
361	a new version of MPFR and MPC have been imported and probably
362	will break parts of builds related to themselves or GCC, both
363	in the tools and the native section.  Remove all GCC, GMP, MPFR
364	and MPC objdirs or build once without -u.
365
36620170402:
367	a new version of dhcpcd has been imported, which does not support
368	update builds from the previous version. Remove your
369	external/bsd/dhcpcd object dir or build once without -u.
370
37120170211:
372	a new terminfo database has been imported.
373	The structure of it has changed slightly from prior versions and
374	an updated tic tool is required.
375	If you build.sh, don't use -u
376
37720170207:
378	various arch dependent libc/exect.S files were removed
379	Either remove the obj directories (lib/libc and compat/amd64/i386/lib
380	if it exists) or do a clean build.
381	(This is a bug in the make system, it should be corrected without
382	human intervention, but isn't.)
383
38420170104:
385	xinput build options have changed.
386	Remove the obj directory (external/mit/xorg/bin/xinput)
387	if you build.sh -u
388
38920170103:
390	a new version of flex has been imported.
391	Remove the file from obj (external/bsd/flex)
392	if you build.sh -u
393
39420161014:
395	a new version of OpenSSL has been imported.
396	Remove the files from obj (crypto/external/bsd/openssl) 
397	if you build.sh -u
398
39920161009:
400	a new version of dhcpcd has been imported with slightly changed
401	build infrastructure. When doing a build.sh -u this requires
402	pruning the external/bsd/dhcpcd objdir.
403
40420160914:
405	i386, amd64, shark, ofppc and macppc have joined shark and x68k
406	ports in using xorg-server 1.18. This requires a clean destdir
407	and a clean objdir.
408
40920160527:
410	i386 needs a full cleandir or objdir deletion because PIE has
411	been enabled. (see the amd64 entry two down for further info)
412
41320160418:
414	libedit needs manual removal of all autogenerated files since
415	some of them are not autogenerated anymore. Remember that there
416	might be two copies of libedit if your platform builds "compat".
417
41820160410:
419	amd64 needs full "make cleandir" or deletion of objdir now that
420	PIE has been enabled for amd64.  PIE, or position-independent
421	executables, means all code, including executables and not just
422	shared libraries, is position-independent and hence able to be
423	relocated by ASLR, address space layout randomization.
424
425	The change was made in Makefile variables for compiler and
426	linker flags, for which make(1) does not record dependencies,
427	hence it is unable to detect that all .o files need rebuilding.
428
429	Partial rebuilds with some modified source files will likely
430	fail when linking executables, since the linker refuses to mix
431	position-independent code with position-dependent code in
432	position-independent executables:
433
434		.../x86_64--netbsd/bin/ld: foo.o: relocation R_X86_64_32 against `...' cannot be used when making a shared object; recompile with -fPIC
435
43620160401:
437	Ports switching to GCC 5.3 will need a full "make cleandir".
438	Some people have found that cleandir is not sufficient, so if
439	in doubt delete the entire object directory tree for gcc.
440
44120160306:
442	NetBSD's regexp implementation is now part of libnbcompat.
443	Nblex, nbm4, nbpax, nbsed use it and they may crash on
444	non-NetBSD hosts if linked with stale object files produced
445	while they included a non-NetBSD regex.h.
446	In any case, you should "make cleandir" at least these tools
447	before updating your toolchain.
448
44920160125:
450	Dtrace has been enabled by default on some architectures.
451	When doing an update build, make sure to clean the etc/mtree
452	object directory before starting the build - otherwise the
453	needed directories in destdir will not be created.
454	An easy way to do this is:
455	   cd src/etc/mtree && $TOOLDIR/bin/nbmake-$arch cleandir
456
45720150818:
458	New acpica requires "make cleandir" in src/external/bsd/acpica
459	again.
460
46120150413:
462	New acpica requires "make cleandir" and reinstalling yacc
463	in /usr/src/external/bsd/byacc and /usr/src/tools/yacc and
464	also "make cleandir" in /usr/src/external/bsd/acpica.
465
46620150404:
467	Lint changes require a full rebuild of the tool, so make
468	sure to build without -u option to build.sh, or manually
469	do a make cleandir in src/tools/lint1 and
470	src/usr.bin/xlint.
471
47220150310:
473	Improvements to openssl for arm mean that update builds of
474	the openssl libraries will fail. A make cleandir in
475	external/bsd/openssl/lib is needed
476
47720141026:
478	A mishap during the import of pppd may cause your corruption
479	in your cvs directory if you happened to do a cvs update
480	during a short period of time. To fix, just remove the
481	directory src/external/bsd/ppp/dist/pppd completely
482	and let cvs restore it on next update.
483
48420140721:
485	The src/external/mit/lua/src directory was accidentally created
486	and then deleted in the CVS repository.  If you get errors like
487
488	cvs [update aborted]: cannot open directory
489	/cvsroot/src/external/mit/lua/src: No such file or directory
490
491	then delete your local copy of that directory tree and try again.
492
49320140530:
494	ARM eABI switched to DWARF based exception handling. This requires
495	rebuilding all C++ code. It is strongly advised to do a clean build.
496
49720140131:
498	The new compiler_rt/libc integration moved a few things. It is strongly
499	advised to do a clean build. At least lib/libc, the compat version(s)
500	of libc, libkern, rump and the kernels need to be cleaned.
501
50220131227:
503	1. The new ntpd runs in a restricted mode to prevent amplification
504	   attacks. If you need ntpdc to work you need to explicitly enable
505	   mode7 in your config file. Make sure you put the necessary restrict
506	   statements to avoid being exposed.
507	2. strncat has moved from lib/libc to common/lib/libc; you might need
508	   to make clean in libc
509
51020131129:
511	The GMP sources were updated, and builds will likely fail without
512	cleaning their build trees for both tools and in-tree, like below.
513
51420131128:
515	The MPC and MPFR sources were updated, and builds may require their
516	tools and in-tree directories cleaned for successful updates.
517
51820130605:
519	The kernel option FAST_IPSEC no longer exists, it's been renamed
520	to IPSEC (and the older IPSEC version removed).
521
52220130605:
523	Previous freetype installations erroneously installed private
524	header files. If you are building against a non-empty $DESTDIR,
525	please remove ${DESTDIR}//usr/X11R7/include/freetype2/freetype/.
526
52720130531:
528	The xdm update may cause build failure due to xdm.man being
529	in the obj tree.  Make sure to ensure any like this:
530		nbmake: nbmake: don't know how to make xdm.man. Stop
531	is fixed by deleting the xdm.man in the obj tree.
532
53320130530:
534	Updates of many xsrc packages will leave old .pc files around.
535	Best to clean out the xsrc objdir entirely before rebuilds.
536
53720130301:
538	The removal of netiso requires manual removal of /usr/include/netiso
539	prior to the build and make cleandir in /usr/src/usr.bin/{ktruss,kdump}
540
54120120726:
542	The update of OpenSSL requires cleaning both the OpenSSL build
543	directory and DESTDIR.  *Even non-update builds require cleaning
544	DESTDIR.* Builds done without taking these steps may fail, or in
545	some cases may succeed and install broken OpenSSL libraries that
546	cause third-party software to link incorrectly and/or crash.
547
54820120507:
549	The database schema for makemandb was changed.  You will
550	need to update the database using 'makemandb -f' or wait
551	for the next weekly run to fix it.
552
55320120319:
554	sys/conf/Makefile.kern.inc has been modified to adjust the
555	size of db_symtab automatically.  You need to update dbsym in
556	your $TOOLDIR to build kernels with options SYMTAB_SPACE.  If
557	you don't want this behavior, add AUTO_SYMTAB_SPACE=no to your
558	mk.conf.
559
56020120216:
561	Default for MKCATPAGES changed to NO.  Update builds will fail
562	unless DESTDIR is cleaned manually.  If you built between 20120207
563	and 20120216, daily and weekly could have created an unreadable
564	/var/db/man.db index for apropos.  Running makemandb -f or
565	the next run of weekly will fix it.
566
56720111227:
568	If you built between 20111225 and 20111227 you need to remove
569	/usr/lib/libpam.so.4* and /usr/lib/security/*.so.4, since the
570	bump has been reverted.
571
57220111125:
573	The "rnd" pseudodevice has been added to sys/conf/std, which
574	means it should no longer be explicitly listed in kernel
575	configuration files.  The line "pseudo-device rnd" should be
576	removed from any custom kernel config files users may have.
577
57820111119:
579	A problem with the datastructures used by the rndctl(8)
580	utility (pointers in datastructures in an array, making 32->64
581	bit compatibility very painful) has been fixed in a
582	non-backwards-compatible way.  If you replace your kernel,
583	replace your rndctl executable too.
584
58520111001:
586	the prop_*_send_syscall() functions from proplib(3) have been
587	changed and their new version is not backward compatible with the old
588	one.  So ensure that all consumers of these functions (currently:
589	quota2 code and its tests) are updated together with the new lib.
590
59120110817:
592	sparc has been changed to use GCC 4.5.3, so any objdir or
593	DESTDIR for them should be deleted before updating.
594
59520110806:
596	i386 and amd64 have been changed to use GCC 4.5.3, so any
597	objdir or DESTDIR for them should be deleted before updating.
598
59920110805:
600	The update to GCC 4.5.3 requires a non-trivial portion of
601	the tree to be cleaned.  Best to delete both objdir and
602	DESTDIR before running this update.  So far, only the
603	sparc64, mips and powerpc platforms have changed.
604
60520110803:
606	The layout of external/public-domain/xz has changed.  To do an
607	update build you will have to remove the contents of the OBJDIR
608	for external/public-domain/xz/bin by hand as the xz entry there
609	is now a directory.
610
61120110410:
612	The configuration of src/tools/gcc has changed.  To do an
613	update build you have to clean both tools/binutils and
614	tools/gcc by hand.
615
61620110328:
617	Building the Xorg binary was moved into a subdirectory to fix
618	ordering issues with "make all".  It may be necessary to remove
619	the OBJDIR for external/mit/xorg/server/xorg-server/hw/xfree86
620	if your update build fails, as the "Xorg" entry there is now a
621	directory.
622
62320110121:
624	Assembler files no longer use -traditional-cpp.  This can break
625	the build of individual parts of the tree.  This is handled
626	correctly by build.sh.  Manual builds have to update /usr/share/mk
627	and re-run config(1) for any kernel configurations as needed.
628
62920101217:
630	The tcpdump(8) program was changed to drop privileges and chroot(2)
631	by default.  It may be necessary to manually update passwd(5) and
632	group(5) in order to make the program work with existing setups.
633
63420101125:
635	The latest changes to setenv(3) disallow setting environment
636	variables with names that contain '='.  Revision 1.18 of env.c
637	assumed that this was allowed.  Installing a new libc with an
638	old copy of /usr/bin/env causes env x=1 printenv | grep x= to
639	break which affects the autoconf tests for dependency finding,
640	so building gcc will end up printing:
641	    checking dependency style of gcc... none
642	    configure: error: no usable dependency style found
643	Fix it by rebuilding and re-installing env.
644
64520101119:
646	Recent Xorg updates in xsrc/external/mit/ may cause various build
647	or run-time problems.  Delete your entire DESTDIR and OBJDIR if you
648	have any build problems with xsrc, or problems with mismatched
649	versions between xorg-server and drivers.
650
65120100604:
652	The update of ATF to 0.9 causes old tests written in shell to fail
653	unless they are rebuilt.  If you are building with MKUPDATE=yes,
654	you need to clean the src/external/bsd/atf/tests/ and the src/tests/
655	trees by hand.
656
65720100522:
658	Recent Xorg updates in xsrc/external/mit/ will cause various build
659	problems.  Delete your entire DESTDIR and OBJDIR if you have any
660	build problems with xsrc.
661
66220100522:
663	private section of <ctype.h> was split, and now mklocale(1)
664	include ctype_local.h, so you have to make cleandir in tools/mklocale.
665
66620100520:
667	The location of the xkb compiled descriptions has changed.  Please
668	remove usr/X11R7/lib/X11/xkb/compiled from your $DESTDIR.
669
67020100222:
671	The shared objects file extension has been changed from .so to
672	.pico, in order to avoid conflicts with shared libraries names
673	libXX.so.  All now stale regular .so files can be removed from
674	your object directories.
675
67620100204:
677	The termcap database has been removed from the sources,
678	but has not been marked obsolete so it is not removed
679	from the system when upgrading.
680	As such, you will need to remove them from your object
681	and destination directories.
682
68320091101:
684        After updating, it may be necessary to make the 'cleandir'
685        target in src/tools/yacc/ and in src/usr.bin/yacc/ before a
686        'build.sh -u tools' or 'build.sh -u distribution'.  Ditto
687        src/tools/lex/ and src/usr.bin/lex/.
688
68920091001:
690	On amd64 you must rebuild tools (to get the new binutils)
691	before building a kernel, or the build fails on cpufunc.S.
692
69320091001:
694	An error will create a ./usr/X11R7/lib/X11/xkb/compiled/xkb
695	symlink, failing the build.  Delete the link, and the subdir
696	it is in, and retry your build.
697
69820090718:
699	libc build changed so that strchr() provides the extra entry
700	point for index().  Update build of libc.a (and libc_pic.a)
701	may fail because the archive contains the unwanted index.o.
702	(Similarly for strrchr() and rindex().)
703
70420090709:
705	Native Xorg was upgraded again.  Builds will probably fail again
706	without a clean objdir, at least for src/external/mit/xorg.
707
70820090616:
709	Native Xorg was upgraded.  Builds will need a clean objdir for
710	src/external/mit/xorg.  Upgrading a system from sets will not
711	work properly yet as the /usr/X11R7/lib/X11/xkb/symbols/pc
712	subdirectory has been changed into a file, and this needs to
713	be manually "rm -r"'ed before installing xbase.tgz.
714
71520090501:
716	Several new functions were added to string.h/libc, and this
717	can cause autoconf problems during the tool build for people
718	who fail to clean out their tools objects properly.  If you
719	note messages about stpcpy, stpncpy or strnlen accompanying a
720	failure during the tool build, clean out all your tools
721	objects and start again.
722
72320090325:
724	The i386 port was switched to i486 default toolchain.  This requires
725	cleaning your src/tools directory and $TOOLDIR and rebuilding them.
726
72720090126:
728	The __posix_fadvise50 system call changed assembly stub type.  You
729	need to 'rm -f __posix_fadvise50.*' in the libc build directory
730	to avoid using the old assembly stub.
731
73220090202:
733	pkg_install now depends on the pkgdb cache for automatic conflict
734	detection.  It is recommended to rebuild the cache with
735	``pkg_admin rebuild''.
736
73720090110:
738	time_t and dev_t have been bumped to 64 bit quantities.  To upgrade:
739	1. Make sure your kernel has COMPAT_50 in it.  Build and install.
740	   This is needed even in the MODULAR kernel because there is
741	   conditionally compiled code in rtsock.c.
742	2. make sure build.sh completes and the binaries in a chroot work
743	   before installing.
744	3. If you don't use build.sh and you build directly to root, and
745	   your build breaks in the middle, don't despair.  Make sure headers
746	   are installed properly, and start building libraries first libc
747	   and libutil, install them and then continue building all the
748	   libraries in src/lib and src/gnu/lib and install them.  Once
749	   the new libraries are installed, you can restart the build.
750	4. If you compile packages and you notice link time warnings,
751	   rebuild the required packages to update their shared libraries.
752	   Any package you rebuild will require rebuilding all the packages
753	   that depend on it.
754	5. Next time you run pwd_mkdb with the new binary, the file
755	   will be upgraded and it will not be backwards compatible.
756	6. The utmpx/wtmpx files (/var/run/utmpx and /var/log/wtmpx, see
757	   lastlogx(5)) have been versioned, and there is a heuristic
758	   for utmp.  You are better off removing the old files after
759	   upgrading.  The automated clearing of /var/run during
760	   boot, and the automated rotating of files in /var/log by
761	   newsyslog(8), may mean that you do not have to remove the
762	   files manually.
763	7. The optional accounting file (/var/account/acct, see
764	   accton(8)) has not been versioned, and will need to be
765	   removed.  The automatic rotation of the accounting file by
766	   /etc/daily limits the bad consequences of failure to remove
767	   the file.
768	8. Application software that writes time_t to binary files on
769	   disk will break or need attention.  Most notably: if you are
770	   using PostgreSQL < 8.4, you need to dump your databases,
771	   rebuild PostgreSQL with the new time_t, then restore.
772
77320081219:
774	config(1) has been updated, and one of the files it creates -
775	swapnetbsd.o - has changed format.  You need to rebuild config
776	(done automatically by build.sh) and then you need to rerun
777	config on all kernel configuration files before rebuilding those
778	kernels.
779
78020081205:
781	If you build with MKX11=no, you should remove /etc/rc.d/xdm and
782	/etc/rc.d/xfs from DESTDIR because those files were moved to the xetc
783	set and will appear as extra files for MKX11=no update builds.
784
78520081122:
786	On i386, various kernel options(4) in GENERIC including
787	file systems have been disabled and moved into kernel modules.
788	Before trying a new GENERIC kernel, you have to prepare the
789	following files as well as a new GENERIC kernel:
790
791	- build and install kernel modules from src/sys/modules
792
793	- install the latest bootloader, which will load a module
794	  for the file system from which the kernel is loaded automatically
795
796	If you have to load your kernel from a file system which is not of
797	the same type as the root file system, you have to load the necessary
798	file system module manually on the boot prompt or in the boot.cfg file.
799
80020080827:
801	If you built and installed a libc from sources between
802	2008/08/20 and 2008/08/26 you got a broken strtouq(3)
803	which results in false errors reported by lint(1).
804	Since this breaks the libc build itself, manual help is
805	needed -- lint must be disabled temporarily, e.g.:
806	  $ (cd lib/libc && make MKLINT=no dependall install)
807
80820080813:
809	MKDEBUG build was broken because the .depend files did not know
810	about .go files.  You need to remove all .depend files and rebuild.
811
81220080802:
813	A regression in binary compatibility for pthread_mutex_t has
814	been fixed.  Unfortunately, the price is breaking compatibility
815	for -current.
816
817	Threaded programs (using libpthread) and C++ programs (using
818	libstdc++) compiled after 20070907 and before 20080802 need to
819	be recompiled.
820
821	One way to find affected pkgsrc packages:
822
823	  $ grep REQUIRES=/usr/lib/libpthread /var/db/pkg/*/+BUILD_INFO
824	  $ grep REQUIRES=/usr/lib/libstdc++ /var/db/pkg/*/+BUILD_INFO
825
82620080731:
827	WAPBL (metadata journaling support) has been added, but at this
828	time isn't backwards compatible with pre-WAPBL aware kernels
829	and userland (fsck_ffs in particular).  Please make sure you
830	don't use a journaled filesystem with an older kernel/userland,
831	especially an uncleanly mounted journaled filesystem.  WAPBL
832	also requires the super block to be in the UFS2 format.  You
833	can use fsck_ffs -c 4 to update the superblock format.
834
83520080721:
836	Assembler warnings are now fatal if $WARNS>0 and $NOGCCERROR
837	isn't defined.
838
83920080531:
840	The ioctl number of DRVSUSPENDDEV command on /dev/drvctl changed
841	from 125 (conflicted with DRVCTLCOMMAND) to 129.  The drvctl(8)
842	utility needs to be rebuilt and reinstalled as older binaries
843	won't work correctly.  The following sequence of commands:
844
845	  $ (cd sys/sys/ && nbmake-$arch includes)
846	  $ (cd sbin/drvctl/ && nbmake-$arch clean)
847	  $ (cd sbin/drvctl/ && nbmake-$arch all)
848
849	leaves new drvctl utility in sbin/drvctl build directory.
850
85120080503:
852	The <bsd.lib.mk> variable MKPRIVATELIB was renamed to LIBISPRIVATE.
853
85420080521:
855	For a while, unprivileged UPDATE builds would fail to
856	succeed at the checkflist stage, complaining that
857	${DESTDIR}/stand/<arch>/ did not exist.  A fix for this
858	problem was committed to share/mk/bsd.kmodule.mk, revision 1.9.
859	If you already hit this problem, update the .mk file,
860	remove ${DESTDIR}/stand/<arch>, and re-run the build.
861
86220080303:
863	Linker warnings are now fatal if $WARNS>0.
864
86520080126:
866	The posix_fadvise system call has been changed from an assembly
867	stub, to a c file that calls an assembly stub.  You need to
868	'rm -f posix_fadvise.* .depend' in the libc build directory to
869	avoid using the old assembly stub.
870
87120071209:
872	The acpiec(4) driver has been split into two attachments.  If you
873	get ACPI errors before the attachment, please update your kernel
874	configuration file appropriately or see GENERIC for more details.
875
87620071115:
877	The it(4) driver has been renamed to itesio(4) and the old port
878	argument specified in the kernel configuration file is not valid
879	anymore.  The itesio(4) driver now uses the Super I/O address port
880	rather than the EC address port.  Please update your kernel
881	configuration file appropriately or see GENERIC for more details.
882
88320071028:
884	The pccons(4) driver has been removed from the NetBSD/shark port.
885	You need to update any custom kernel configuration file you have
886	to remove any references to pccons (which includes removing the
887	now useless XSERVER option) and replace them with the correct
888	entries for the wscons driver.  See the GENERIC configuration file
889	for more details.
890
89120070913:
892	A latent bug in dhclient/dhcpd that caused it to be unable to
893	enumerate interfaces was fixed.  The bug began to cause
894	problems after 20070911 when the kernel's SIOCGIFCONF
895	implementation was repaired.  From 20070529 to 20070911 racoon
896	could not enumerate interfaces.  (These are noted because
897	normal kernel/userspace version matching hygiene is not
898	sufficient to avoid this problem.)  Ensure that both kernel
899	and userland are from after 20070913.
900
90120070703:
902	nbinstall has been renamed ${MACHINE_GNU_ARCH}-install.  It
903	calls the target-specific strip program, and the logic to pass
904	down STRIP from make has been removed.  This requires a
905	re-installation of tools.
906
90720070422:
908	The way OS emulations lookup filenames inside the emulation root
909	has been changed.  Rather than modify the pathname (and copy back
910	to userspace) namei() and lookup() directly check the emulation
911	root.  One side effect is that absolute symlinks inside the emulated
912	root file system will be relative to that file system - unless they
913	start /../ this is useful when the emulated root is a real install
914	that has such links.
915	This might affect symlinks that have been added to reference outside
916	the emulated root.
917
91820070412:
919	The pckbc driver on sgimips IP32 has been removed.  Use macekbc
920	instead.  See the GENERIC32_IP3x kernel configuration for an
921	example.
922
92320070319:
924        src/lib/libc/Makefile revision 1.129 broke libc and ld.elf_so
925        on many platforms due to incorrect flags settings.  If you
926        updated and built after about 20070315, do "nbmake-$arch
927	cleandir" in src/lib/libc and src/libexec/ld.elf_so to force a
928	rebuild of object files that might have been built
929	incorrectly, and ensure that you have at least
930	src/lib/libc/Makefile 1.130.
931
93220070210:
933        src/sys/sys/{sa.h,savar.h} were removed.
934          find ${OBJDIR} \( -name .depend -o -name '*.d' \) -print \
935              | xargs egrep -l '/sa.h|/savar.h' | xargs rm
936        will allow dependencies on those files to get get rebuilt
937
93820070209:
939        The threading model was changed when the newlock2 branch
940        was merged to NetBSD-current.  If you boot with a new
941        kernel (version 4.99.10), then you also need a new pthread
942        library (/usr/lib/libpthread.so.0.7).  If you boot with
943        an old kernel, then you need the old pthread library
944        (/usr/lib/libpthread.so.0.6).  Provided you keep the kernel and
945        the pthread library in sync, old threaded applications should
946        continue to work with an old or new kernel.  Note that named(8)
947	is the only threaded application in the base system.
948
94920061214:
950	Following the move of string_to_flags() and flags_to_string()
951	from the bin/ls/ sources to libutil, users doing UPDATE builds
952	will need to do a "make cleandir" in
953		tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/,
954		bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/,
955		usr.bin/xinstall/, libexec/ftpd/, rescue/, as well
956		as the installation images in distrib/
957	in order to excise stale references to the old stat_flags.h header
958	file in the ls sources -- stat_flags.h has been removed.
959
96020061108:
961	The configure script used in the src/tools/gcc compiler has been
962	changed to indicate that our libc has ssp support built-in and
963	does not depend on -lssp and -lssp-nonshared.  You'll need to
964	make clean in src/tools/gcc first to rebuild the compiler.
965
96620061009:
967	The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer
968	available.  Use net.inet{,6}.tcp{,6}.congctl.selected instead.
969
97020060814:
971	The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been
972	withdrawn.  Use vidcvideo and pckbd instead.  See the GENERIC
973	kernel configuration for an example.  X servers from the last
974	few years should cope.
975
97620060703:
977	MPACPI is no more.  We always configure PCI interrupts using ACPI
978	if we have an ACPI kernel.  The option MPACPI_SCANPCI has been renamed
979	to ACPI_SCANPCI.  Thanks to work from fvdl.
980
98120060627:
982	socket(2) has changed, and its system call has been versioned.
983	For userlands with the old version of socket(2), make sure that
984	your kernel has 'options COMPAT_30' set, or else 'bad system call'
985	errors will result.
986
987Hints for a more successful build:
988^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
989    Use build.sh, but do not use its "expert mode":
990	This will automatically build the tools in the
991	   correct order, and it will keep the tools and the
992	   new build products from interfering with the running
993	   system.  This will allow you to ignore most of the
994	   other advice in this file.
995    Build a new kernel first:
996	This makes sure that any new system calls or features
997	   expected by the new userland will be present.  This
998	   helps to avoid critical errors when upgrading.
999    Use object directories:
1000	This helps to keep stale object
1001	   files from polluting the build if a Makefile "forgets"
1002	   about one.  It also makes it easier to clean up after
1003	   a build.  It's also necessary if you want to use the
1004	   same source tree for multiple machines.
1005	   To use object directories with build.sh:
1006	    a) invoke build.sh with the "-M" or "-O" options.
1007	   To use object directories without using build.sh:
1008	    a) cd /usr/src ; make cleandir
1009	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
1010	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1011	    d) cd /usr/src ; make build
1012	   Note that running "make obj" in a directory will create
1013	   in obj.$MACHINE directory.
1014    Build to a DESTDIR:
1015	This helps to keep old installed files (especially libraries)
1016	   from interfering with the new build.
1017	   To build to a DESTDIR with build.sh, use the "-D" option.
1018	   To build to a DESTDIR without using build.sh, set the DESTDIR
1019	   environment variable before running make build.  It should be
1020	   set to the pathname of an initially empty directory.
1021	   Problems: if you do not use build.sh, you might need to
1022		update critical utilities without using DESTDIR since
1023		nothing is executed from what is installed in DESTDIR.
1024		(See critical utils, below.)
1025    Build often:
1026	This keeps critical utilities current enough to not choke
1027	on any other part of the source tree that depends on up to
1028	date functionality.  If you use build.sh, you should not have
1029	this problem.
1030
1031What to do if things don't work:
1032^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1033When things don't work there are usually a few things that commonly
1034should be done.
1035    1)	make includes
1036	This should be done automatically by make build.
1037    2)  cd share/mk && make install
1038	Again, automatically done by make build.
1039
1040Failsafe rebuild of a small part of the tree:
1041^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1042To make sure you rebuild something correctly you want to do
1043something like the following:
1044    1)  Make sure the includes and .mk files are up to date.
1045    2)  Make sure any program used to build the particular
1046	utility is up to date.  (yacc, lex, etc...)
1047    3)  cd ...path/to/util...
1048	make cleandir
1049	rm ...all obj directories...
1050	make cleandir			# yes, again
1051	make obj
1052	make depend && make
1053
1054Failsafe rebuild of the entire tree:
1055^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1056If you really want to make sure the source tree is clean and
1057ready for a build try the following.  Note that sourcing /etc/mk.conf
1058(a make(1) Makefile) in this manner is not right, and will not work
1059for anyone who uses any make(1) features in /etc/mk.conf.
1060
1061---cut here---
1062#!/bin/sh
1063. /etc/mk.conf
1064
1065if [ -z $NETBSDSRCDIR ] ; then
1066    NETBSDSRCDIR=/usr/src
1067fi
1068if [ \! -d $NETBSDSRCDIR ] ; then
1069    echo Unable to find sources
1070    exit 1
1071fi
1072find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
1073
1074if [ -z $BSDOBJDIR ] ; then
1075    BSDOBJDIR=/usr/obj
1076fi
1077if [ -d $BSDOBJDIR ] ; then
1078    rm -rf $BSDOBJDIR
1079fi
1080
1081cd $NETBSDSRCDIR && make cleandir
1082
1083---cut here---
1084
1085Critical utilities:
1086^^^^^^^^^^^^^^^^^^^
1087	usr.bin/compile_et
1088	usr.bin/make
1089	usr.bin/yacc
1090	usr.bin/lex
1091	usr.bin/xlint
1092	usr.bin/config
1093
1094Other problems and possible solutions:
1095^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1096Symptom:Complaints involving a Makefile.
1097Fix:	Rebuild usr.bin/make:
1098	cd usr.bin/make && make && make install
1099	Or, a failsafe method if that doesn't work:
1100	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
1101
1102Fix:	Make sure .mk files are up to date.
1103	cd share/mk && make install
1104
1105Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
1106Fix:	Rebuild usr.bin/config
1107
1108Symptom:
1109Fix:	Rebuild usr.bin/yacc
1110
1111Symptom:
1112Fix:	Rebuild usr.bin/lex
1113
1114Symptom:
1115Fix:	rm /usr/lib/libbfd.a
1116
1117Symptom:Obsolete intermediate files are used during compilation
1118Fix:	Try the following sequence of commands in the directory in question.
1119	make cleandir; rm `make print-objdir`; make cleandir; make obj
1120	(If you built the tree without "make obj" in the past, obsolete files
1121	may remain.  The command tries to clean everything up)
1122
1123Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible
1124	pointer type
1125Fix:	Rebuild and install usr.bin/menuc
1126
1127Symptom:mklocale not found during build in share/locale/ctype
1128Fix:	Build and install usr.bin/mklocale
1129
1130Symptom:undefined reference to `__assert13' or `__unsetenv13'
1131Fix:    Rebuild and install lib/libc
1132
1133Symptom:usr.bin/config fails to build.
1134Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
1135
1136Symptom:undefined reference to `getprogname' or `setprogname'
1137Fix:    Rebuild and install lib/libc
1138
1139Symptom:lint does not understand the '-X' option
1140Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
1141
1142Symptom:Update build fails in src/tools/gcc complaining that a variable
1143	(e.g. CPPFLAGS) has changed since the previous run.
1144Fix:    Run "nbmake-${ARCH} clean" in src/tools/gcc or do a clean build.
1145
1146Symptom:cvs [update aborted]: cannot open directory /cvsroot/src/...:
1147	No such file or directory.
1148Cause:	If a directory is created by mistake, then it is sometimes
1149	deleted from the CVS repository using administrative commands
1150	that bypass the normal cvs access controls.  If your cvs working tree
1151	contains references to a directory that has been deleted on the
1152	server in this way, then "cvs update" reports this error.
1153Fix:	Recursively delete the affected directory from your working tree
1154	and try the update again.
1155