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