Home | History | Annotate | Line # | Download | only in src
UPDATING revision 1.247
      1 $NetBSD: UPDATING,v 1.247 2013/08/08 20:00:20 spz 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 See also: BUILDING, build.sh, Makefile.
     15 
     16 Recent changes:
     17 ^^^^^^^^^^^^^^^
     18 
     19 20130605:
     20 	The kernel option FAST_IPSEC no longer exists, it's been renamed
     21 	to IPSEC (and the older IPSEC version removed).
     22 
     23 20130605:
     24 	Previous freetype installations eroneously installed private
     25 	header files. If you are building against a non-empty $DESTDIR,
     26 	please remove ${DESTDIR}//usr/X11R7/include/freetype2/freetype/.
     27 
     28 20130531:
     29 	The xdm update may cause build failure due to xdm.man being
     30 	in the obj tree.  Make sure to ensure any like this:
     31 		nbmake: nbmake: don't know how to make xdm.man. Stop
     32 	is fixed by deleting the xdm.man in the obj tree.
     33 
     34 20130530:
     35 	Updates of many xsrc packages will leave old .pc files around.
     36 	Best to clean out the xsrc objdir entirely before rebuilds.
     37 
     38 20130301:
     39 	The removal of netiso requires manual removal of /usr/include/netiso
     40 	prior to the build and make cleandir in /usr/src/usr.bin/{ktruss,kdump}
     41 
     42 20120726:
     43 	The update of OpenSSL requires cleaning both the OpenSSL build
     44 	directory and DESTDIR.  *Even non-update builds require cleaning
     45 	DESTDIR.* Builds done without taking these steps may fail, or in
     46 	some cases may succeed and install broken OpenSSL libraries that
     47 	cause third-party software to link incorrectly and/or crash.
     48 
     49 20120507:
     50 	The database schema for makemandb was changed.  You will
     51 	need to update the database using 'makemandb -f' or wait
     52 	for the next weekly run to fix it.
     53 
     54 20120319:
     55 	sys/conf/Makefile.kern.inc has been modified to adjust the
     56 	size of db_symtab automatically.  You need to update dbsym in
     57 	your $TOOLDIR to build kernels with options SYMTAB_SPACE.  If
     58 	you don't want this behavior, add AUTO_SYMTAB_SPACE=no to your
     59 	mk.conf.
     60 
     61 20120216:
     62 	Default for MKCATPAGES changed to NO.  Update builds will fail
     63 	unless DESTDIR is cleaned manually.  If you built between 20120207
     64 	and 20120216, daily and weekly could have created an unreadable
     65 	/var/db/man.db index for apropos.  Running makemandb -f or
     66 	the next run of weekly will fix it.
     67 
     68 20111227:
     69 	If you built between 20111225 and 20111227 you need to remove
     70 	/usr/lib/libpam.so.4* and /usr/lib/security/*.so.4, since the
     71 	bump has been reverted.
     72 
     73 20111125:
     74 	The "rnd" pseudodevice has been added to sys/conf/std, which
     75 	means it should no longer be explicitly listed in kernel
     76 	configuration files.  The line "pseudo-device rnd" should be
     77 	removed from any custom kernel config files users may have.
     78 
     79 20111119:
     80 	A problem with the datastructures used by the rndctl(8)
     81 	utility (pointers in datastructures in an array, making 32->64
     82 	bit compatibility very painful) has been fixed in a
     83 	non-backwards-compatible way.  If you replace your kernel,
     84 	replace your rndctl executable too.
     85 
     86 20111001:
     87 	the prop_*_send_syscall() functions from proplib(3) have been
     88 	changed and their new version is not backward compatible with the old
     89 	one.  So ensure that all consumers of these functions (currently:
     90 	quota2 code and its tests) are updated together with the new lib.
     91 
     92 20110817:
     93 	sparc has been changed to use GCC 4.5.3, so any objdir or
     94 	DESTDIR for them should be deleted before updating.
     95 
     96 20110806:
     97 	i386 and amd64 have been changed to use GCC 4.5.3, so any
     98 	objdir or DESTDIR for them should be deleted before updating.
     99 
    100 20110805:
    101 	The update to GCC 4.5.3 requires a non-trivial portion of
    102 	the tree to be cleaned.  Best to delete both objdir and
    103 	DESTDIR before running this update.  So far, only the
    104 	sparc64, mips and powerpc platforms have changed.
    105 
    106 20110803:
    107 	The layout of external/public-domain/xz has changed.  To do an
    108 	update build you will have to remove the contents of the OBJDIR
    109 	for external/public-domain/xz/bin by hand as the xz entry there
    110 	is now a directory.
    111 
    112 20110410:
    113 	The configuration of src/tools/gcc has changed.  To do an
    114 	update build you have to clean both tools/binutils and
    115 	tools/gcc by hand.
    116 
    117 20110328:
    118 	Building the Xorg binary was moved into a subdirectory to fix
    119 	ordering issues with "make all".  It may be necessary to remove
    120 	the OBJDIR for external/mit/xorg/server/xorg-server/hw/xfree86
    121 	if your update build fails, as the "Xorg" entry there is now a
    122 	directory.
    123 
    124 20110121:
    125 	Assembler files no longer use -traditional-cpp.  This can break
    126 	the build of individual parts of the tree.  This is handled
    127 	correctly by build.sh.  Manual builds have to update /usr/share/mk
    128 	and re-run config(1) for any kernel configurations as needed.
    129 
    130 20101217:
    131 	The tcpdump(8) program was changed to drop privileges and chroot(2)
    132 	by default.  It may be necessary to manually update passwd(5) and
    133 	group(5) in order to make the program work with existing setups.
    134 
    135 20101125:
    136 	The latest changes to setenv(3) dissallow setting environment
    137 	variables with names that contain '='.  Revision 1.18 of env.c
    138 	assumed that this was allowed.  Installing a new libc with an
    139 	old copy of /usr/bin/env causes env x=1 printenv | grep x= to
    140 	break which affects the autoconf tests for dependency finding,
    141 	so building gcc will end up printing:
    142 	    checking dependency style of gcc... none
    143 	    configure: error: no usable dependency style found
    144 	Fix it by rebuilding and re-installing env.
    145 
    146 20101119:
    147 	Recent Xorg updates in xsrc/external/mit/ may cause various build
    148 	or run-time problems.  Delete your entire DESTDIR and OBJDIR if you
    149 	have any build problems with xsrc, or problems with mismatched
    150 	versions between xorg-server and drivers.
    151 
    152 20100604:
    153 	The update of ATF to 0.9 causes old tests written in shell to fail
    154 	unless they are rebuilt.  If you are building with MKUPDATE=yes,
    155 	you need to clean the src/external/bsd/atf/tests/ and the src/tests/
    156 	trees by hand.
    157 
    158 20100522:
    159 	Recent Xorg updates in xsrc/external/mit/ will cause various build
    160 	problems.  Delete your entire DESTDIR and OBJDIR if you have any
    161 	build problems with xsrc.
    162 
    163 20100522:
    164 	private section of <ctype.h> was splitted, and now mklocale(1)
    165 	include ctype_local.h, so you have to make cleandir in tools/mklocale.
    166 
    167 20100520:
    168 	The location of the xkb compiled descriptions has changed.  Please
    169 	remove usr/X11R7/lib/X11/xkb/compiled from your $DESTDIR.
    170 
    171 20100222:
    172 	The shared objects file extension has been changed from .so to
    173 	.pico, in order to avoid conflicts with shared libraries names
    174 	libXX.so.  All now stale regular .so files can be removed from
    175 	your object directories.
    176 
    177 20100204:
    178 	The termcap database has been removed from the sources,
    179 	but has not been marked obsolete so it is not removed
    180 	from the system when upgrading.
    181 	As such, you will need to remove them from your object
    182 	and destination directories.
    183 
    184 20091101:
    185         After updating, it may be necessary to make the 'cleandir'
    186         target in src/tools/yacc/ and in src/usr.bin/yacc/ before a
    187         'build.sh -u tools' or 'build.sh -u distribution'.  Ditto
    188         src/tools/lex/ and src/usr.bin/lex/.
    189 
    190 20091001:
    191 	On amd64 you must rebuild tools (to get the new binutils)
    192 	before building a kernel, or the build fails on cpufunc.S.
    193 
    194 20091001:
    195 	An error will create a ./usr/X11R7/lib/X11/xkb/compiled/xkb
    196 	symlink, failing the build.  Delete the link, and the subdir
    197 	it is in, and retry your build.
    198 
    199 20090718:
    200 	libc build changed so that strchr() provides the extra entry
    201 	point for index().  Update build of libc.a (and libc_pic.a)
    202 	may fail because the archive contains the unwanted index.o.
    203 	(Similarly for strrchr() and rindex().)
    204 
    205 20090709:
    206 	Native Xorg was upgraded again.  Builds will probably fail again
    207 	without a clean objdir, at least for src/external/mit/xorg.
    208 
    209 20090616:
    210 	Native Xorg was upgraded.  Builds will need a clean objdir for
    211 	src/external/mit/xorg.  Upgrading a system from sets will not
    212 	work properly yet as the /usr/X11R7/lib/X11/xkb/symbols/pc
    213 	subdirectory has been changed into a file, and this needs to
    214 	be manually "rm -r"'ed before installing xbase.tgz.
    215 
    216 20090501:
    217 	Several new functions were added to string.h/libc, and this
    218 	can cause autoconf problems during the tool build for people
    219 	who fail to clean out their tools objects properly.  If you
    220 	note messages about stpcpy, stpncpy or strnlen accompanying a
    221 	failure during the tool build, clean out all your tools
    222 	objects and start again.
    223 
    224 20090325:
    225 	The i386 port was switched to i486 default toolchain.  This requires
    226 	cleaning your src/tools directory and $TOOLDIR and rebuilding them.
    227 
    228 20090126:
    229 	The __posix_fadvise50 system call changed assembly stub type.  You
    230 	need to 'rm -f __posix_fadvise50.*' in the libc build directory
    231 	to avoid using the old assembly stub.
    232 
    233 20090202:
    234 	pkg_install now depends on the pkgdb cache for automatic conflict
    235 	detection.  It is recommented to rebuild the cache with
    236 	``pkg_admin rebuild''.
    237 
    238 20090110:
    239 	time_t and dev_t have been bumped to 64 bit quantities.  To upgrade:
    240 	1. Make sure your kernel has COMPAT_50 in it.  Build and install.
    241 	   This is needed even in the MODULAR kernel because there is
    242 	   conditionally compiled code in rtsock.c.
    243 	2. make sure build.sh completes and the binaries in a chroot work
    244 	   before installing.
    245 	3. If you don't use build.sh and you build directly to root, and
    246 	   your build breaks in the middle, don't despair.  Make sure headers
    247 	   are installed properly, and start building libraries first libc
    248 	   and libutil, install them and then continue building all the
    249 	   libraries in src/lib and src/gnu/lib and install them.  Once
    250 	   the new libraries are installed, you can restart the build.
    251 	4. If you compile packages and you notice link time warnings,
    252 	   rebuild the required packages to update their shared libraries.
    253 	   Any package you rebuild will require rebuilding all the packages
    254 	   that depend on it.
    255 	5. Next time you run pwd_mkdb with the new binary, the file
    256 	   will be upgraded and it will not be backwards compatible.
    257 	6. The utmpx/wtmpx files (/var/run/utmpx and /var/log/wtmpx, see
    258 	   lastlogx(5)) have been versioned, and there is a heuristic
    259 	   for utmp.  You are better off removing the old files after
    260 	   upgrading.  The automated clearing of /var/run during
    261 	   boot, and the automated rotating of files in /var/log by
    262 	   newsyslog(8), may mean that you do not have to remove the
    263 	   files manually.
    264 	7. The optional accounting file (/var/account/acct, see
    265 	   accton(8)) has not been versioned, and will need to be
    266 	   removed.  The automatic rotation of the accounting file by
    267 	   /etc/daily limits the bad consequences of failure to remove
    268 	   the file.
    269 	8. Application software that writes time_t to binary files on
    270 	   disk will break or need attention.  Most notably: if you are
    271 	   using PostgreSQL < 8.4, you need to dump your databases,
    272 	   rebuild PostgreSQL with the new time_t, then restore.
    273 
    274 20081219:
    275 	config(1) has been updated, and one of the files it creates -
    276 	swapnetbsd.o - has changed format.  You need to rebuild config
    277 	(done automatically by build.sh) and then you need to rerun
    278 	config on all kernel configuration files before rebuilding those
    279 	kernels.
    280 
    281 20081205:
    282 	If you build with MKX11=no, you should remove /etc/rc.d/xdm and
    283 	/etc/rc.d/xfs from DESTDIR because those files were moved to the xetc
    284 	set and will appear as extra files for MKX11=no update builds.
    285 
    286 20081122:
    287 	On i386, various kernel options(4) in GENERIC including
    288 	file systems have been disabled and moved into kernel modules.
    289 	Before trying a new GENERIC kernel, you have to prepare the
    290 	following files as well as a new GENERIC kernel:
    291 
    292 	- build and install kernel modules from src/sys/modules
    293 
    294 	- install the latest bootloader, which will load a module
    295 	  for the file system from which the kernel is loaded automatically
    296 
    297 	If you have to load your kernel from a file system which is not of
    298 	the same type as the root file system, you have to load the necessary
    299 	file system module manually on the boot prompt or in the boot.cfg file.
    300 
    301 20080827:
    302 	If you built and installed a libc from sources between
    303 	2008/08/20 and 2008/08/26 you got a broken strtouq(3)
    304 	which results in false errors reported by lint(1).
    305 	Since this breaks the libc build itself, manual help is
    306 	needed -- lint must be disabled temporarily, e.g.:
    307 	  $ (cd lib/libc && make MKLINT=no dependall install)
    308 
    309 20080813:
    310 	MKDEBUG build was broken because the .depend files did not know
    311 	about .go files.  You need to remove all .depend files and rebuild.
    312 
    313 20080802:
    314 	A regression in binary compatibility for pthread_mutex_t has
    315 	been fixed.  Unfortunately, the price is breaking compatibility
    316 	for -current.
    317 
    318 	Threaded programs (using libpthread) and C++ programs (using
    319 	libstdc++) compiled after 20070907 and before 20080802 need to
    320 	be recompiled.
    321 
    322 	One way to find affected pkgsrc packages:
    323 
    324 	  $ grep REQUIRES=/usr/lib/libpthread /var/db/pkg/*/+BUILD_INFO
    325 	  $ grep REQUIRES=/usr/lib/libstdc++ /var/db/pkg/*/+BUILD_INFO
    326 
    327 20080731:
    328 	WAPBL (metadata journaling support) has been added, but at this
    329 	time isn't backwards compatible with pre-WAPBL aware kernels
    330 	and userland (fsck_ffs in particular).  Please make sure you
    331 	don't use a journaled filesystem with an older kernel/userland,
    332 	especially an uncleanly mounted journaled filesystem.  WAPBL
    333 	also requires the super block to be in the UFS2 format.  You
    334 	can use fsck_ffs -c 4 to update the superblock format.
    335 
    336 20080721:
    337 	Assembler warnings are now fatal if $WARNS>0 and $NOGCCERROR
    338 	isn't defined.
    339 
    340 20080531:
    341 	The ioctl number of DRVSUSPENDDEV command on /dev/drvctl changed
    342 	from 125 (conflicted with DRVCTLCOMMAND) to 129.  The drvctl(8)
    343 	utility needs to be rebuilt and reinstalled as older binaries
    344 	won't work correctly.  The following sequence of commands:
    345 
    346 	  $ (cd sys/sys/ && nbmake-$arch includes)
    347 	  $ (cd sbin/drvctl/ && nbmake-$arch clean)
    348 	  $ (cd sbin/drvctl/ && nbmake-$arch all)
    349 
    350 	leaves new drvctl utility in sbin/drvctl build directory.
    351 
    352 20080503:
    353 	The <bsd.lib.mk> variable MKPRIVATELIB was renamed to LIBISPRIVATE.
    354 
    355 20080521:
    356 	For a while, unprivileged UPDATE builds would fail to
    357 	succeed at the checkflist stage, complaining that
    358 	${DESTDIR}/stand/<arch>/ did not exist.  A fix for this
    359 	problem was committed to share/mk/bsd.kmodule.mk, revision 1.9.
    360 	If you already hit this problem, update the .mk file,
    361 	remove ${DESTDIR}/stand/<arch>, and re-run the build.
    362 
    363 20080303:
    364 	Linker warnings are now fatal if $WARNS>0.
    365 
    366 20080126:
    367 	The posix_fadvise system call has been changed from an assembly
    368 	stub, to a c file that calls an assembly stub.  You need to
    369 	'rm -f posix_fadvise.* .depend' in the libc build directory to
    370 	avoid using the old assembly stub.
    371 
    372 20071209:
    373 	The acpiec(4) driver has been split into two attachments.  If you
    374 	get ACPI errors before the attachment, please update your kernel
    375 	configuration file appropriately or see GENERIC for more details.
    376 
    377 20071115:
    378 	The it(4) driver has been renamed to itesio(4) and the old port
    379 	argument specified in the kernel configuration file is not valid
    380 	anymore.  The itesio(4) driver now uses the Super I/O address port
    381 	rather than the EC address port.  Please update your kernel
    382 	configuration file appropriately or see GENERIC for more details.
    383 
    384 20071028:
    385 	The pccons(4) driver has been removed from the NetBSD/shark port.
    386 	You need to update any custom kernel configuration file you have
    387 	to remove any references to pccons (which includes removing the
    388 	now useless XSERVER option) and replace them with the correct
    389 	entries for the wscons driver.  See the GENERIC configuration file
    390 	for more details.
    391 
    392 20070913:
    393 	A latent bug in dhclient/dhcpd that caused it to be unable to
    394 	enumerate interfaces was fixed.  The bug began to cause
    395 	problems after 20070911 when the kernel's SIOCGIFCONF
    396 	implementation was repaired.  From 20070529 to 20070911 racoon
    397 	could not enumerate interfaces.  (These are noted because
    398 	normal kernel/userspace version matching hygiene is not
    399 	sufficient to avoid this problem.)  Ensure that both kernel
    400 	and userland are from after 20070913.
    401 
    402 20070703:
    403 	nbinstall has been renamed ${MACHINE_GNU_ARCH}-install.  It
    404 	calls the target-specific strip program, and the logic to pass
    405 	down STRIP from make has been removed.  This requires a
    406 	re-installation of tools.
    407 
    408 20070422:
    409 	The way OS emulations lookup filenames inside the emulation root
    410 	has been changed.  Rather than modify the pathname (and copy back
    411 	to userspace) namei() and lookup() directly check the emulation
    412 	root.  One side effect is that absolute symlinks inside the emulated
    413 	root file system will be relative to that file system - unless they
    414 	start /../ this is useful when the emulated root is a real install
    415 	that has such links.
    416 	This might affect symlinks that have been added to reference outside
    417 	the emulated root.
    418 
    419 20070412:
    420 	The pckbc driver on sgimips IP32 has been removed.  Use macekbc
    421 	instead.  See the GENERIC32_IP3x kernel configuration for an
    422 	example.
    423 
    424 20070319:
    425         src/lib/libc/Makefile revision 1.129 broke libc and ld.elf_so
    426         on many platforms due to incorrect flags settings.  If you
    427         updated and built after about 20070315, do "nbmake-$arch
    428 	cleandir" in src/lib/libc and src/libexec/ld.elf_so to force a
    429 	rebuild of object files that might have been built
    430 	incorrectly, and ensure that you have at least
    431 	src/lib/libc/Makefile 1.130.
    432 
    433 20070210:
    434         src/sys/sys/{sa.h,savar.h} were removed.
    435           find ${OBJDIR} \( -name .depend -o -name '*.d' \) -print \
    436               | xargs egrep -l '/sa.h|/savar.h' | xargs rm
    437         will allow dependencies on those files to get get rebuilt
    438 
    439 20070209:
    440         The threading model was changed when the newlock2 branch
    441         was merged to NetBSD-current.  If you boot with a new
    442         kernel (version 4.99.10), then you also need a new pthread
    443         library (/usr/lib/libpthread.so.0.7).  If you boot with
    444         an old kernel, then you need the old pthread library
    445         (/usr/lib/libpthread.so.0.6).  Provided you keep the kernel and
    446         the pthread library in sync, old threaded applications should
    447         continue to work with an old or new kernel.  Note that named(8)
    448 	is the only threaded application in the base system.
    449 
    450 20061214:
    451 	Following the move of string_to_flags() and flags_to_string()
    452 	from the bin/ls/ sources to libutil, users doing UPDATE builds
    453 	will need to do a "make cleandir" in
    454 		tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/,
    455 		bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/,
    456 		usr.bin/xinstall/, libexec/ftpd/, rescue/, as well
    457 		as the installation images in distrib/
    458 	in order to excise stale references to the old stat_flags.h header
    459 	file in the ls sources -- stat_flags.h has been removed.
    460 
    461 20061108:
    462 	The configure script used in the src/tools/gcc compiler has been
    463 	changed to indicate that our libc has ssp support built-in and
    464 	does not depend on -lssp and -lssp-nonshared.  You'll need to
    465 	make clean in src/tools/gcc first to rebuild the compiler.
    466 
    467 20061009:
    468 	The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer
    469 	available.  Use net.inet{,6}.tcp{,6}.congctl.selected instead.
    470 
    471 20060814:
    472 	The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been
    473 	withdrawn.  Use vidcvideo and pckbd instead.  See the GENERIC
    474 	kernel configuration for an example.  X servers from the last
    475 	few years should cope.
    476 
    477 20060703:
    478 	MPACPI is no more.  We always configure PCI interrupts using ACPI
    479 	if we have an ACPI kernel.  The option MPACPI_SCANPCI has been renamed
    480 	to ACPI_SCANPCI.  Thanks to work from fvdl.
    481 
    482 20060627:
    483 	socket(2) has changed, and its system call has been versioned.
    484 	For userlands with the old version of socket(2), make sure that
    485 	your kernel has 'options COMPAT_30' set, or else 'bad system call'
    486 	errors will result.
    487 
    488 Hints for a more successful build:
    489 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    490     Use build.sh, but do not use its "expert mode":
    491 	This will automatically build the tools in the
    492 	   correct order, and it will keep the tools and the
    493 	   new build products from interfering with the running
    494 	   system.  This will allow you to ignore most of the
    495 	   other advice in this file.
    496     Build a new kernel first:
    497 	This makes sure that any new system calls or features
    498 	   expected by the new userland will be present.  This
    499 	   helps to avoid critical errors when upgrading.
    500     Use object directories:
    501 	This helps to keep stale object
    502 	   files from polluting the build if a Makefile "forgets"
    503 	   about one.  It also makes it easier to clean up after
    504 	   a build.  It's also necessary if you want to use the
    505 	   same source tree for multiple machines.
    506 	   To use object directories with build.sh:
    507 	    a) invoke build.sh with the "-M" or "-O" options.
    508 	   To use object directories without using build.sh:
    509 	    a) cd /usr/src ; make cleandir
    510 	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
    511 	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
    512 	    d) cd /usr/src ; make build
    513 	   Note that running "make obj" in a directory will create
    514 	   in obj.$MACHINE directory.
    515     Build to a DESTDIR:
    516 	This helps to keep old installed files (especially libraries)
    517 	   from interfering with the new build.
    518 	   To build to a DESTDIR with build.sh, use the "-D" option.
    519 	   To build to a DESTDIR without using build.sh, set the DESTDIR
    520 	   environment variable before running make build.  It should be
    521 	   set to the pathname of an initially empty directory.
    522 	   Problems: if you do not use build.sh, you might need to
    523 		update critical utilities without using DESTDIR since
    524 		nothing is executed from what is installed in DESTDIR.
    525 		(See critical utils, below.)
    526     Build often:
    527 	This keeps critical utilities current enough to not choke
    528 	on any other part of the source tree that depends on up to
    529 	date functionality.  If you use build.sh, you should not have
    530 	this problem.
    531 
    532 What to do if things don't work:
    533 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    534 When things don't work there are usually a few things that commonly
    535 should be done.
    536     1)	make includes
    537 	This should be done automatically by make build.
    538     2)  cd share/mk && make install
    539 	Again, automatically done by make build.
    540 
    541 Failsafe rebuild of a small part of the tree:
    542 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    543 To make sure you rebuild something correctly you want to do
    544 something like the following:
    545     1)  Make sure the includes and .mk files are up to date.
    546     2)  Make sure any program used to build the particular
    547 	utility is up to date.  (yacc, lex, etc...)
    548     3)  cd ...path/to/util...
    549 	make cleandir
    550 	rm ...all obj directories...
    551 	make cleandir			# yes, again
    552 	make obj
    553 	make depend && make
    554 
    555 Failsafe rebuild of the entire tree:
    556 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    557 If you really want to make sure the source tree is clean and
    558 ready for a build try the following.  Note that sourcing /etc/mk.conf
    559 (a make(1) Makefile) in this manner is not right, and will not work
    560 for anyone who uses any make(1) features in /etc/mk.conf.
    561 
    562 ---cut here---
    563 #!/bin/sh
    564 . /etc/mk.conf
    565 
    566 if [ -z $NETBSDSRCDIR ] ; then
    567     NETBSDSRCDIR=/usr/src
    568 fi
    569 if [ \! -d $NETBSDSRCDIR ] ; then
    570     echo Unable to find sources
    571     exit 1
    572 fi
    573 find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
    574 
    575 if [ -z $BSDOBJDIR ] ; then
    576     BSDOBJDIR=/usr/obj
    577 fi
    578 if [ -d $BSDOBJDIR ] ; then
    579     rm -rf $BSDOBJDIR
    580 fi
    581 
    582 cd $NETBSDSRCDIR && make cleandir
    583 
    584 ---cut here---
    585 
    586 Critical utilities:
    587 ^^^^^^^^^^^^^^^^^^^
    588 	usr.bin/compile_et
    589 	usr.bin/make
    590 	usr.bin/yacc
    591 	usr.bin/lex
    592 	usr.bin/xlint
    593 	usr.bin/config
    594 
    595 Other problems and possible solutions:
    596 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    597 Symptom:Complaints involving a Makefile.
    598 Fix:	Rebuild usr.bin/make:
    599 	cd usr.bin/make && make && make install
    600 	Or, a failsafe method if that doesn't work:
    601 	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
    602 
    603 Fix:	Make sure .mk files are up to date.
    604 	cd share/mk && make install
    605 
    606 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
    607 Fix:	Rebuild usr.bin/config
    608 
    609 Symptom:
    610 Fix:	Rebuild usr.bin/yacc
    611 
    612 Symptom:
    613 Fix:	Rebuild usr.bin/lex
    614 
    615 Symptom:
    616 Fix:	rm /usr/lib/libbfd.a
    617 
    618 Symptom:Obsolete intermediate files are used during compilation
    619 Fix:	Try the following sequence of commands in the directory in question.
    620 	make cleandir; rm `make print-objdir`; make cleandir; make obj
    621 	(If you built the tree without "make obj" in the past, obsolete files
    622 	may remain.  The command tries to clean everything up)
    623 
    624 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible
    625 	pointer type
    626 Fix:	Rebuild and install usr.bin/menuc
    627 
    628 Symptom:mklocale not found during build in share/locale/ctype
    629 Fix:	Build and install usr.bin/mklocale
    630 
    631 Symptom:undefined reference to `__assert13' or `__unsetenv13'
    632 Fix:    Rebuild and install lib/libc
    633 
    634 Symptom:usr.bin/config fails to build.
    635 Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
    636 
    637 Symptom:undefined reference to `getprogname' or `setprogname'
    638 Fix:    Rebuild and install lib/libc
    639 
    640 Symptom:lint does not understand the '-X' option
    641 Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
    642 
    643 Symptom:Update build fails in src/tools/gcc complaining that a variable
    644 	(e.g. CPPFLAGS) has changed since the previous run.
    645 Fix:    Run "nbmake-${ARCH} clean" in src/tools/gcc or do a clean build.
    646