Home | History | Annotate | Line # | Download | only in src
UPDATING revision 1.379
      1 $NetBSD: UPDATING,v 1.379 2025/04/27 23:30:39 kre Exp $
      2 
      3 This file (UPDATING) is intended to be a brief reference to recent
      4 changes that might cause problems in the build process, and a guide for
      5 what to do if something doesn't work.
      6 
      7 For a more detailed description of the recommended way to build NetBSD
      8 using build.sh, see the BUILDING file.
      9 
     10 Note that much of the advice in this UPDATING file was written before
     11 build.sh existed.  Nevertheless, the advice here may be useful for
     12 working around specific problems with build.sh.
     13 
     14 Sections are marked with "^^^^^".  After the section on "Recent changes"
     15 are several sections containing more general information.
     16 
     17 See also: BUILDING, build.sh, Makefile.
     18 
     19 Recent changes:
     20 ^^^^^^^^^^^^^^^
     21 
     22 20250427:
     23 	The KERNEL_DIR option to build.sh is now functional.  Set it
     24 	with ``-V KERNEL_DIR=yes'' on your build.sh command.
     25 	With this, you can now colocate kernel and associated modules
     26 	in /netbsd/{kernel,kernel.dbg,modules} instead of having the
     27 	kernel in / but modules in /stand.
     28 
     29 	Note that you'll need new bootstrap code to use this feature.
     30 
     31 	This completes work begun many years ago by christos@ :-)
     32 
     33 20250413:
     34 	A change to bsd.lib.mk requires a clean build of all libraries.
     35 
     36 20250131:
     37 	The switch to the new jemalloc requires cleaning in libc.
     38 
     39 20241122:
     40 	Changes to various libraries' build options require cleaning
     41 	their objdirs in update builds:
     42 
     43 	cd external/bsd/file/lib && $TOOLDIR/bin/nbmake-$ARCH clean
     44 	cd external/bsd/libarchive/lib && $TOOLDIR/bin/nbmake-$ARCH clean
     45 	cd external/public-domain/xz/lib && $TOOLDIR/bin/nbmake-$ARCH clean
     46 
     47 	Also, for architectures with MKCOMPAT, it is necessary to clean
     48 	the compat objdirs too.  The easiest way is:
     49 
     50 	rm -rf OBJDIR/compat/*/*/external/bsd/file/lib
     51 	rm -rf OBJDIR/compat/*/*/external/bsd/libarchive/lib
     52 	rm -rf OBJDIR/compat/*/*/external/public-domain/xz/lib
     53 
     54 	Changes to bsd.lib.mk to improve detecting differences in
     55 	shared library symbol exports may cause some .actsym files in
     56 	the objdir to become stale in update builds.
     57 
     58 	To work around this, delete all files matching `*.actsym' in
     59 	the objdir.  For example:
     60 
     61 	find OBJDIR -name '*.actsym' -type f -print0 | xargs -0 rm
     62 
     63 20241104:
     64 	Changes around the integration of the zstd compression
     65 	library may require manual deletion of some object directories
     66 	if you update from a build from a few days ago:
     67 	rm -rf DESTDIR/usr/lib/*/libarchive*
     68 	rm -rf DESTDIR/usr/lib/*/libmagic*
     69 	rm -rf DESTDIR/usr/lib/*/libzstd*
     70 	rm -rf DESTDIR/usr/lib/libarchive*
     71 	rm -rf DESTDIR/usr/lib/libmagic*
     72 	rm -rf DESTDIR/usr/lib/libzstd*
     73 	rm -rf OBJDIR/compat/*/*/external/bsd/file/
     74 	rm -rf OBJDIR/compat/*/*/external/bsd/libarchive/
     75 	rm -rf OBJDIR/compat/*/*/external/bsd/zstd/
     76 	rm -rf OBJDIR/external/bsd/file/
     77 	rm -rf OBJDIR/external/bsd/libarchive/
     78 	rm -rf OBJDIR/external/bsd/zstd/
     79 	rm -rf OBJDIR/external/gpl3/gcc/
     80 	rm -rf OBJDIR/tools/gcc/
     81 
     82 20240926:
     83 	Building -current when running on amd64 from about 20240924
     84 	to about 20240926 will not work due to a "malloc_np.h"
     85 	error. Please downgrade to a version from 20240924 or older,
     86 	or upgrade to a newer version e.g. using a binary release from
     87 	the NetBSD build servers.
     88 
     89 20240923:
     90 	Update builds will require cleaning the object directories for
     91 	jemalloc (like: "rm -rf $OBJ/external/bsd/jemalloc*") and the
     92 	libc dependency files (like: "rm $OBJ/lib/libc/jemalloc.*").
     93 	On architectures with COMPAT libs, those also have to be cleaned,
     94 	e.g. on sparc64: "rm -rf $OBJ/compat/sparc64/sparc/external/bsd/jemalloc*"
     95 	and "rm $OBJ/compat/sparc64/sparc/lib/libc/jemalloc.*".
     96 
     97 20240817:
     98 	Update builds will require cleaning in src/external/historical/nawk/bin
     99 	in order to remove the awk binary since now there is a subdirectory
    100 	called awk.
    101 
    102 20240812:
    103 	Update builds will require removing the tools objdir for gdb
    104 	if building with MKCROSSGDB=yes. All architectures use gdb.old
    105 	now.
    106 
    107 20240630:
    108 	Update builds will require removing the tools objdir for binutils
    109 	(as most architectures should use binutils.old now).
    110 
    111 20240610:
    112 	Update builds are likely to require removing the objdir for
    113 	distrib/<arch>/cdroms - or at least references to libarchive
    114 	from within there after the recent libarchive update.
    115 
    116 20240504:
    117 	Update builds on x86 require making the `cleandir' target in
    118 	lib/libm, or deleting the objdir for lib/libm.
    119 
    120 20240423:
    121 	Update builds with x11 may fail after switching to Mesa 21.
    122 
    123 20240410:
    124 	Update builds may require manually deleting
    125 	$DESTDIR/var/run/named (and, potentially,
    126 	$DESTDIR/var/run/lwresd) in order to avoid checkflist failure.
    127 
    128 20240409:
    129 	32-bit compatibility libraries were moved into the base32
    130 	and debug32 sets.  HTML man pages were moved into the manhtml set.
    131 
    132 20230828:
    133 	If:
    134         - you updated to current and ran postinstall between 20230826
    135 	  and 20230828 inclusive, and
    136         - you are not using anything outside the base system to
    137 	  populate /etc/openssl/certs (e.g., manually adding
    138 	  certificates or using ca-certificates or mozilla-rootcerts or
    139 	  mozilla-rootcerts-openssl from pkgsrc),
    140 	delete /etc/openssl/certs and rerun postinstall or just
    141 	`certctl rehash'.
    142 
    143 	Otherwise, certctl(8) will think someone else has left
    144 	/etc/openssl/certs in the way and will avoid clobbering it on
    145 	upgrade from older NetBSD.
    146 
    147 20230718:
    148 	build.sh will use mk.conf in the same directory as build.sh instead
    149 	of /etc/mk.conf, unless MAKECONF is already defined in the environment.
    150 
    151 20230714:
    152 	Import of gcc 10.5 requires a clean build of at least tools/gcc
    153 	and external/gpl3/gcc* object directories. An update build
    154 	without cleaning will result in obscure failures in rare corner
    155 	cases.
    156 
    157 20230604:
    158 	Building native kernels with the installed make(1) instead of
    159 	the $TOOLDIR/bin/nbmake-${arch} wrapper will fail if userland
    160 	has not been updated. Note that this is an unsupported build
    161 	configuration (but usually works if userland is -current enough).
    162 
    163 20230523:
    164 	ctfmerge was fixed as macOS host tool. This may require a clean tools
    165 	rebuild to detect the update to tools/compat/configure.
    166 
    167 20230515:
    168 	New openssl build requires removal of the crypto/external/bsd/openssl
    169 	and tests/crypto/libcrypto subdirectories in the ${OBJDIR} hierarchy.
    170 	Otherwise test results may be wrong due to wrong "golden" output
    171 	files being installed.
    172 
    173 20230322:
    174 	Fixes for moved /lib/libisns* mean that builds will complain about
    175 	./usr/lib/libisns* being missing until src/lib/libisns is forced
    176 	to (re)install the files, including the symlinks.  The simplest
    177 	way is to clean this subdir before building.
    178 
    179 20230112:
    180 	New binutils require an updated ld.elf_so. If you are doing
    181 	(unsupported) in-place self builds (with the -E flag to build.sh),
    182 	make sure to have installed latest ld.elf_so before you rebuild
    183 	userland.
    184 
    185 20221116:
    186 	The addition to NetBSD's version of UFS2 of support for extended
    187 	attributes broke backward compatibility with previous releases
    188 	of NetBSD, so UFS2 has been restored to being compatible with
    189 	previous NetBSD releases by disabling extended attributes.
    190 	(Note that ACLs are implemented as extended attributes, so
    191 	this changes disables ACLs as well.)
    192 
    193 	Support for UFS2 with extended attributes is now available in a new
    194 	UFS variant called UFS2ea.  If you have created extended attributes
    195 	in an original UFS2 file system then "fsck -p" will now fail due to
    196 	the unexpected presence of extended attributes and "fsck -y" will
    197 	remove all extended attributes.  If you wish to preserve extended
    198 	attributes rather than delete them, there is a utility to convert
    199 	a UFS2 file system to UFS2ea and leave extended attributes in place,
    200 	but this should be used with caution since it will preserve any
    201 	extended attributes that have been corrupted by the backward
    202 	incompatibility too.
    203 
    204 	If you wish to use a UFS2ea file system as your root file system,
    205 	then you will need to update your boot loader to a version that
    206 	supports UFS2ea.
    207 
    208 	For more information, see:
    209 	https://wiki.netbsd.org/features/UFS2ea
    210 
    211 20221111:
    212 	The new libdrm import worsened the conflict issues for the
    213 	kdump/ktruss ioctl, and i915 now conflicts with base, and has
    214 	been turned off.  This will cause update build issues like:
    215 
    216 		kdump-ioctl.c:12175:143: error: 'DRM_IOCTL_I915_DESTROY_HEAP'
    217 		   undeclared here (not in a function);
    218 		   did you mean 'DRM_IOCTL_MODE_DESTROY_DUMB'?
    219 
    220 	You'll need to clean usr.bin/ktruss, usr.bin/kdump, and rescue.
    221 
    222 20220921:
    223 	Since the kernel version was bumped to 9.99.100, the bootloader
    224 	must be updated on x86 or EFI boot platforms in order to load
    225 	modules from boot.cfg(5) or interactively at the bootloader
    226 	prompt.
    227 
    228 	The kernel can still load modules at runtime, with modload(8)
    229 	or modules.conf(5), with no bootloader update.  This will not
    230 	affect release branches because it only applies to patch
    231 	numbers >=100.
    232 
    233 	On x86 (i386 or amd64) with BIOS boot, this requires copying a
    234 	new /usr/mdec/boot to /boot.  You can build this in the destdir
    235 	by running `$TOOLDIR/bin/nbmake-$ARCH dependall install' in
    236 	sys/arch/i386/stand.
    237 
    238 	On platforms with EFI boot (including x86 with EFI boot), this
    239 	requires copying a new /usr/mdec/boot*.efi to the EFI/BOOT/
    240 	directory on the EFI system partition.  The boot*.efi file is:
    241 
    242 	aarch64	bootaa64.efi
    243 	amd64	bootx64.efi
    244 	arm	bootarm.efi	(32-bit arm)
    245 	i386	bootx32.efi
    246 
    247 	You can build this in the destdir by running
    248 	`$TOOLDIR/bin/nbmake-$ARCH dependall install' in
    249 	sys/stand/efiboot/boot*.
    250 
    251 20220821:
    252 	Support for building extsrc/ has been deprecated.
    253 	EXTSRCSRCDIR and MKEXTSRC have been deprecated.
    254 
    255 20220714:
    256 	Updates to xorg-server and associated drivers may cause builds to
    257 	fail.  Cleaning both DESTDIR and the xorg build tree may be needed.
    258 
    259 20220628:
    260 	Changes in the build of src/games/robots require a clean build
    261 	of that program.
    262 
    263 20211116:
    264 	Changes in the xorg build require clean obj dirs for external/mit/xorg
    265 	(or a full clean/non-update build).
    266 
    267 20211112:
    268 	Device tree sources were updated for evbarm.  Some device nodes
    269 	(in particular, ld(4) devices on the ROCKPro64) will be renumbered.
    270 
    271 20211014:
    272 	MKPIE default for aarch64 has changed, a clean build is required.
    273 
    274 20210917:
    275 	Changed MNT_ACLS to default to POSIX1e ACLs instead of NFSv4
    276 	ACLs, to be compatible with FreeBSD. If you are using NFSv4 ACLs
    277 	and have "acls" in /etc/fstab you'll need to change it to "nfs4acls".
    278 
    279 20210711:
    280 	Updated GMP sources may require cleaning in tools/gmp and/or in
    281 	external/lgpl3/gmp/lib, particularly if GCC itself does not build.
    282 
    283 20210417:
    284 	GCC 10 was enabled for several platforms.  If builds fail in either
    285 	tools/gcc or external/gpl3/gcc, first try cleaning those objects and
    286 	removing the $DESTDIR/usr/include/g++ subdirectory.
    287 
    288 20201016:
    289 	MIPS kernel modules have been disabled until they work.  This will
    290 	turn up in extra files in the DESTDIR, which should be cleaned.
    291 
    292 20200925:
    293 	GNU MPC and MPFR have been updated.  At least MPFR needs cleaning
    294 	in both the tools and external dirs.
    295 
    296 20200912:
    297 	GCC 9 has arrived for Arm and x86 platforms, and will be coming
    298 	for several more, as will binutils 2.34.  Clean as required.
    299 
    300 20200907:
    301 	GCC 9 is coming, and binutils has been updated for MIPS.  This
    302 	probably requires cleaning the tools/binutils.
    303 
    304 20200811:
    305 	GCC updates may require cleaning the objdir.  This may occur
    306 	due to GCC 7.5 update, GCC 8.4 move to gcc.old, or the upcoming
    307 	GCC 9 upgrade.
    308 
    309 20200614:
    310 	blacklist* has been renamed to blocklist*. postinstall(8)
    311 	should handle the migration.
    312 
    313 20200601:
    314 	Due to a mistake in LIBISPRIVATE handling, .so libraries were
    315 	created in the build directories and need cleaning.
    316 
    317 20200311:
    318 	GCC 8 ports will need cleaning in src/tools/gcc and
    319 	src/external/gpl3/gcc due to GCC 8.4 update.
    320 
    321 20191118:
    322 	More architectures were switched to gcc8:
    323 	    i386, ia64 powerpc64, sparc, sparc64, arm
    324 	The same comments as in 20191022 apply.
    325 
    326 20191112:
    327 	The LLVM update requires a clean rebuild for all architectures using
    328 	LLVM during the tools build phase (i386, amd64, aarch64).
    329 
    330 20191022:
    331 	Ports amd64 and aarch64 switched to GCC 8.3 by default.
    332 	In-place ("expert mode", build.sh -E) builds are not supported
    333 	when going from a GCC 7 userland to GCC 8. Do a regular
    334 	build to a different DESTDIR (or preferably: build.sh -U) at least
    335 	once and install sets, or download comp.{tar.xz,tgz} from the
    336 	daily builds and install that before doing the next in-place build.
    337 
    338 20191001:
    339 	GCC 8.3 was imported.  Builds of src/tools/gcc may fail if
    340 	old builds with GCC 7 output now uses GCC 8.  Clean this
    341 	directory, and also clean src/external/gpl3/gcc.
    342 
    343 20190903:
    344 	Files with names that coincide with existing files' names on
    345 	case-insensitive file systems were inadvertently committed, for
    346 	radeon GPU firmware.  We cannot mark these as obsolete for
    347 	postinstall to fix, so if you updated src since 2019-08-26, and
    348 	ran build.sh distribution or ran build.sh release, you must
    349 	manually delete the following files in your DESTDIR (which is
    350 	usually $OBJDIR/destir.$ARCH), or from / if you have installed
    351 	them:
    352 
    353 		/libdata/firmware/radeon/bonaire_ce.bin
    354 		/libdata/firmware/radeon/bonaire_mc.bin
    355 		/libdata/firmware/radeon/bonaire_me.bin
    356 		/libdata/firmware/radeon/bonaire_mec.bin
    357 		/libdata/firmware/radeon/bonaire_pfp.bin
    358 		/libdata/firmware/radeon/bonaire_rlc.bin
    359 		/libdata/firmware/radeon/bonaire_sdma.bin
    360 		/libdata/firmware/radeon/bonaire_smc.bin
    361 		/libdata/firmware/radeon/bonaire_uvd.bin
    362 		/libdata/firmware/radeon/hainan_ce.bin
    363 		/libdata/firmware/radeon/hainan_mc.bin
    364 		/libdata/firmware/radeon/hainan_me.bin
    365 		/libdata/firmware/radeon/hainan_pfp.bin
    366 		/libdata/firmware/radeon/hainan_rlc.bin
    367 		/libdata/firmware/radeon/hainan_smc.bin
    368 		/libdata/firmware/radeon/hawaii_ce.bin
    369 		/libdata/firmware/radeon/hawaii_mc.bin
    370 		/libdata/firmware/radeon/hawaii_me.bin
    371 		/libdata/firmware/radeon/hawaii_mec.bin
    372 		/libdata/firmware/radeon/hawaii_pfp.bin
    373 		/libdata/firmware/radeon/hawaii_rlc.bin
    374 		/libdata/firmware/radeon/hawaii_sdma.bin
    375 		/libdata/firmware/radeon/hawaii_smc.bin
    376 		/libdata/firmware/radeon/kabini_ce.bin
    377 		/libdata/firmware/radeon/kabini_me.bin
    378 		/libdata/firmware/radeon/kabini_mec.bin
    379 		/libdata/firmware/radeon/kabini_pfp.bin
    380 		/libdata/firmware/radeon/kabini_rlc.bin
    381 		/libdata/firmware/radeon/kabini_sdma.bin
    382 		/libdata/firmware/radeon/kaveri_ce.bin
    383 		/libdata/firmware/radeon/kaveri_me.bin
    384 		/libdata/firmware/radeon/kaveri_mec.bin
    385 		/libdata/firmware/radeon/kaveri_mec2.bin
    386 		/libdata/firmware/radeon/kaveri_pfp.bin
    387 		/libdata/firmware/radeon/kaveri_rlc.bin
    388 		/libdata/firmware/radeon/kaveri_sdma.bin
    389 		/libdata/firmware/radeon/mullins_ce.bin
    390 		/libdata/firmware/radeon/mullins_me.bin
    391 		/libdata/firmware/radeon/mullins_mec.bin
    392 		/libdata/firmware/radeon/mullins_pfp.bin
    393 		/libdata/firmware/radeon/mullins_rlc.bin
    394 		/libdata/firmware/radeon/mullins_sdma.bin
    395 		/libdata/firmware/radeon/oland_ce.bin
    396 		/libdata/firmware/radeon/oland_mc.bin
    397 		/libdata/firmware/radeon/oland_me.bin
    398 		/libdata/firmware/radeon/oland_pfp.bin
    399 		/libdata/firmware/radeon/oland_rlc.bin
    400 		/libdata/firmware/radeon/oland_smc.bin
    401 		/libdata/firmware/radeon/pitcairn_ce.bin
    402 		/libdata/firmware/radeon/pitcairn_mc.bin
    403 		/libdata/firmware/radeon/pitcairn_me.bin
    404 		/libdata/firmware/radeon/pitcairn_pfp.bin
    405 		/libdata/firmware/radeon/pitcairn_rlc.bin
    406 		/libdata/firmware/radeon/pitcairn_smc.bin
    407 		/libdata/firmware/radeon/tahiti_ce.bin
    408 		/libdata/firmware/radeon/tahiti_mc.bin
    409 		/libdata/firmware/radeon/tahiti_me.bin
    410 		/libdata/firmware/radeon/tahiti_pfp.bin
    411 		/libdata/firmware/radeon/tahiti_rlc.bin
    412 		/libdata/firmware/radeon/tahiti_smc.bin
    413 		/libdata/firmware/radeon/verde_ce.bin
    414 		/libdata/firmware/radeon/verde_mc.bin
    415 		/libdata/firmware/radeon/verde_me.bin
    416 		/libdata/firmware/radeon/verde_pfp.bin
    417 		/libdata/firmware/radeon/verde_rlc.bin
    418 		/libdata/firmware/radeon/verde_smc.bin
    419 
    420 	We will re-import these radeon firmware images another way
    421 	later.
    422 
    423 20190727:
    424 	The uefi bootloader has gained tftp support and needs a clean
    425 	build. If you do update builds, manually clean its object
    426 	directory by something like:
    427 	cd sys/arch/i386/stand/efiboot && make clean
    428 
    429 20190723:
    430 	The jemalloc allocator in libc is now built without extended
    431 	debugging (for performance reasons). In update builds make sure
    432 	to rebuild it completely, by removing all affected object files,
    433 	including compat builds, something like:
    434 	cd /usr/obj && find . -type d -name jemalloc|xargs rm -rf
    435 
    436 20190207:
    437 	GCC 7 switched for many ports.  Update builds are likely to fail.
    438 
    439 Hints for a more successful build:
    440 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    441     Use build.sh, but do not use its "expert mode":
    442 	This will automatically build the tools in the
    443 	   correct order, and it will keep the tools and the
    444 	   new build products from interfering with the running
    445 	   system.  This will allow you to ignore most of the
    446 	   other advice in this file.
    447     Build a new kernel first:
    448 	This makes sure that any new system calls or features
    449 	   expected by the new userland will be present.  This
    450 	   helps to avoid critical errors when upgrading.
    451     Use object directories:
    452 	This helps to keep stale object
    453 	   files from polluting the build if a Makefile "forgets"
    454 	   about one.  It also makes it easier to clean up after
    455 	   a build.  It's also necessary if you want to use the
    456 	   same source tree for multiple machines.
    457 	   To use object directories with build.sh:
    458 	    a) invoke build.sh with the "-M" or "-O" options.
    459 	   To use object directories without using build.sh:
    460 	    a) cd /usr/src ; make cleandir
    461 	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
    462 	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
    463 	    d) cd /usr/src ; make build
    464 	   Note that running "make obj" in a directory will create
    465 	   in obj.$MACHINE directory.
    466     Build to a DESTDIR:
    467 	This helps to keep old installed files (especially libraries)
    468 	   from interfering with the new build.
    469 	   To build to a DESTDIR with build.sh, use the "-D" option.
    470 	   To build to a DESTDIR without using build.sh, set the DESTDIR
    471 	   environment variable before running make build.  It should be
    472 	   set to the pathname of an initially empty directory.
    473 	   Problems: if you do not use build.sh, you might need to
    474 		update critical utilities without using DESTDIR since
    475 		nothing is executed from what is installed in DESTDIR.
    476 		(See critical utils, below.)
    477     Build often:
    478 	This keeps critical utilities current enough to not choke
    479 	on any other part of the source tree that depends on up to
    480 	date functionality.  If you use build.sh, you should not have
    481 	this problem.
    482 
    483 What to do if things don't work:
    484 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    485 When things don't work there are usually a few things that commonly
    486 should be done.
    487     1)	make includes
    488 	This should be done automatically by make build.
    489     2)  cd share/mk && make install
    490 	Again, automatically done by make build.
    491 
    492 Failsafe rebuild of a small part of the tree:
    493 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    494 To make sure you rebuild something correctly you want to do
    495 something like the following:
    496     1)  Make sure the includes and .mk files are up to date.
    497     2)  Make sure any program used to build the particular
    498 	utility is up to date.  (yacc, lex, etc...)
    499     3)  cd ...path/to/util...
    500 	make cleandir
    501 	rm ...all obj directories...
    502 	make cleandir			# yes, again
    503 	make obj
    504 	make depend && make
    505 
    506 Failsafe rebuild of the entire tree:
    507 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    508 If you really want to make sure the source tree is clean and
    509 ready for a build try the following.  Note that sourcing /etc/mk.conf
    510 (a make(1) Makefile) in this manner is not right, and will not work
    511 for anyone who uses any make(1) features in /etc/mk.conf.
    512 
    513 ---cut here---
    514 #!/bin/sh
    515 . /etc/mk.conf
    516 
    517 if [ -z $NETBSDSRCDIR ] ; then
    518     NETBSDSRCDIR=/usr/src
    519 fi
    520 if [ \! -d $NETBSDSRCDIR ] ; then
    521     echo Unable to find sources
    522     exit 1
    523 fi
    524 find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
    525 
    526 if [ -z $BSDOBJDIR ] ; then
    527     BSDOBJDIR=/usr/obj
    528 fi
    529 if [ -d $BSDOBJDIR ] ; then
    530     rm -rf $BSDOBJDIR
    531 fi
    532 
    533 cd $NETBSDSRCDIR && make cleandir
    534 
    535 ---cut here---
    536 
    537 Critical utilities:
    538 ^^^^^^^^^^^^^^^^^^^
    539 	usr.bin/make
    540 	usr.bin/yacc
    541 	usr.bin/lex
    542 	usr.bin/xlint
    543 	usr.bin/config
    544 
    545 Other problems and possible solutions:
    546 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    547 Symptom:Complaints involving a Makefile.
    548 Fix:	Rebuild usr.bin/make:
    549 	cd usr.bin/make && make && make install
    550 	Or, a failsafe method if that doesn't work:
    551 	cd usr.bin/make && cc -DMAKE_NATIVE *.c -I. -o make \
    552 	&& install make /usr/bin
    553 
    554 Fix:	Make sure .mk files are up to date.
    555 	cd share/mk && make install
    556 
    557 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
    558 Fix:	Rebuild usr.bin/config
    559 
    560 Symptom:Obsolete intermediate files are used during compilation
    561 Fix:	Try the following sequence of commands in the directory in question.
    562 	make cleandir; rm `make print-objdir`; make cleandir; make obj
    563 	(If you built the tree without "make obj" in the past, obsolete files
    564 	may remain.  The command tries to clean everything up)
    565 
    566 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible
    567 	pointer type
    568 Fix:	Rebuild and install usr.bin/menuc
    569 
    570 Symptom:mklocale not found during build in share/locale/ctype
    571 Fix:	Build and install usr.bin/mklocale
    572 
    573 Symptom:undefined reference to `__assert13' or `__unsetenv13'
    574 Fix:    Rebuild and install lib/libc
    575 
    576 Symptom:usr.bin/config fails to build.
    577 Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
    578 
    579 Symptom:undefined reference to `getprogname' or `setprogname'
    580 Fix:    Rebuild and install lib/libc
    581 
    582 Symptom:Update build fails in src/tools/gcc complaining that a variable
    583 	(e.g. CPPFLAGS) has changed since the previous run.
    584 Fix:    Run "nbmake-${ARCH} clean" in src/tools/gcc or do a clean build.
    585 
    586 Symptom:cvs [update aborted]: cannot open directory /cvsroot/src/...:
    587 	No such file or directory.
    588 Cause:	If a directory is created by mistake, then it is sometimes
    589 	deleted from the CVS repository using administrative commands
    590 	that bypass the normal cvs access controls.  If your cvs working tree
    591 	contains references to a directory that has been deleted on the
    592 	server in this way, then "cvs update" reports this error.
    593 Fix:	Recursively delete the affected directory from your working tree
    594 	and try the update again.
    595