UPDATING revision 1.358
11.358Smartin$NetBSD: UPDATING,v 1.358 2024/09/24 13:59:30 martin Exp $ 21.1Sabs 31.123SjmcThis file (UPDATING) is intended to be a brief reference to recent 41.123Sjmcchanges that might cause problems in the build process, and a guide for 51.123Sjmcwhat to do if something doesn't work. 61.1Sabs 71.123SjmcFor a more detailed description of the recommended way to build NetBSD 81.123Sjmcusing build.sh, see the BUILDING file. 91.123Sjmc 101.123SjmcNote that much of the advice in this UPDATING file was written before 111.123Sjmcbuild.sh existed. Nevertheless, the advice here may be useful for 121.123Sjmcworking around specific problems with build.sh. 131.123Sjmc 141.257SapbSections are marked with "^^^^^". After the section on "Recent changes" 151.257Sapbare several sections containing more general information. 161.257Sapb 171.123SjmcSee also: BUILDING, build.sh, Makefile. 181.1Sabs 191.1SabsRecent changes: 201.1Sabs^^^^^^^^^^^^^^^ 211.230Stls 221.358Smartin20240923: 231.358Smartin Update builds will require cleaning the object directories for 241.358Smartin jemalloc (like: rm -rf "$OBJ/external/bsd/jemalloc*") and the 251.358Smartin libc dependency files (like: "rm $OBJ/lib/libc/stdlib/jemalloc.*"). 261.358Smartin 271.357Schristos20240817: 281.357Schristos Update builds will require cleaning in src/external/historical/nawk/bin 291.357Schristos in order to remove the awk binary since now there is a subdirectory 301.357Schristos called awk. 311.358Smartin 321.355Smartin20240812: 331.355Smartin Update builds will require removing the tools objdir for gdb 341.355Smartin if building with MKCROSSGDB=yes. All architectures use gdb.old 351.355Smartin now. 361.356Sriastrad 371.354Smartin20240630: 381.353Smartin Update builds will require removing the tools objdir for binutils 391.353Smartin (as most architectures should use binutils.old now). 401.353Smartin 411.352Skre20240610: 421.352Skre Update builds are likely to require removing the objdir for 431.352Skre distrib/<arch>/cdroms - or at least references to libarchive 441.352Skre from within there after the recent libarchive update. 451.352Skre 461.350Sriastrad20240504: 471.350Sriastrad Update builds on x86 require making the `cleandir' target in 481.350Sriastrad lib/libm, or deleting the objdir for lib/libm. 491.350Sriastrad 501.349Smaya20240423: 511.349Smaya Update builds with x11 may fail after switching to Mesa 21. 521.349Smaya 531.346Sriastrad20240410: 541.346Sriastrad Update builds may require manually deleting 551.346Sriastrad $DESTDIR/var/run/named (and, potentially, 561.346Sriastrad $DESTDIR/var/run/lwresd) in order to avoid checkflist failure. 571.346Sriastrad 581.347Snia20240409: 591.347Snia 32-bit compatibility libraries were moved into the base32 601.347Snia and debug32 sets. HTML man pages were moved into the manhtml set. 611.347Snia 621.343Sriastrad20230828: 631.343Sriastrad If: 641.343Sriastrad - you updated to current and ran postinstall between 20230826 651.343Sriastrad and 20230828 inclusive, and 661.343Sriastrad - you are not using anything outside the base system to 671.343Sriastrad populate /etc/openssl/certs (e.g., manually adding 681.343Sriastrad certificates or using ca-certificates or mozilla-rootcerts or 691.343Sriastrad mozilla-rootcerts-openssl from pkgsrc), 701.343Sriastrad delete /etc/openssl/certs and rerun postinstall or just 711.343Sriastrad `certctl rehash'. 721.343Sriastrad 731.343Sriastrad Otherwise, certctl(8) will think someone else has left 741.343Sriastrad /etc/openssl/certs in the way and will avoid clobbering it on 751.343Sriastrad upgrade from older NetBSD. 761.343Sriastrad 771.341Slukem20230718: 781.341Slukem build.sh will use mk.conf in the same directory as build.sh instead 791.341Slukem of /etc/mk.conf, unless MAKECONF is already defined in the environment. 801.341Slukem 811.342Smartin20230714: 821.342Smartin Import of gcc 10.5 requires a clean build of at least tools/gcc 831.342Smartin and external/gpl3/gcc* object directories. An update build 841.342Smartin without cleaning will result in obscure failures in rare corner 851.342Smartin cases. 861.342Smartin 871.339Smartin20230604: 881.339Smartin Building native kernels with the installed make(1) instead of 891.339Smartin the $TOOLDIR/bin/nbmake-${arch} wrapper will fail if userland 901.339Smartin has not been updated. Note that this is an unsupported build 911.339Smartin configuration (but usually works if userland is -current enough). 921.338Slukem 931.338Slukem20230523: 941.338Slukem ctfmerge was fixed as macOS host tool. This may require a clean tools 951.338Slukem rebuild to detect the update to tools/compat/configure. 961.338Slukem 971.340Smartin20230515: 981.340Smartin New openssl build requires removal of the crypto/external/bsd/openssl 991.345Sandvar and tests/crypto/libcrypto subdirectories in the ${OBJDIR} hierarchy. 1001.340Smartin Otherwise test results may be wrong due to wrong "golden" output 1011.340Smartin files being installed. 1021.340Smartin 1031.337Smrg20230322: 1041.337Smrg Fixes for moved /lib/libisns* mean that builds will complain about 1051.337Smrg ./usr/lib/libisns* being missing until src/lib/libisns is forced 1061.337Smrg to (re)install the files, including the symlinks. The simplest 1071.337Smrg way is to clean this subdir before building. 1081.337Smrg 1091.336Smartin20230112: 1101.336Smartin New binutils require an updated ld.elf_so. If you are doing 1111.336Smartin (unsupported) in-place self builds (with the -E flag to build.sh), 1121.336Smartin make sure to have installed latest ld.elf_so before you rebuild 1131.336Smartin userland. 1141.336Smartin 1151.335Schs20221116: 1161.335Schs The addition to NetBSD's version of UFS2 of support for extended 1171.335Schs attributes broke backward compatibility with previous releases 1181.335Schs of NetBSD, so UFS2 has been restored to being compatible with 1191.335Schs previous NetBSD releases by disabling extended attributes. 1201.335Schs (Note that ACLs are implemented as extended attributes, so 1211.335Schs this changes disables ACLs as well.) 1221.335Schs 1231.335Schs Support for UFS2 with extended attributes is now available in a new 1241.335Schs UFS variant called UFS2ea. If you have created extended attributes 1251.335Schs in an original UFS2 file system then "fsck -p" will now fail due to 1261.335Schs the unexpected presence of extended attributes and "fsck -y" will 1271.335Schs remove all extended attributes. If you wish to preserve extended 1281.335Schs attributes rather than delete them, there is a utility to convert 1291.335Schs a UFS2 file system to UFS2ea and leave extended attributes in place, 1301.335Schs but this should be used with caution since it will preserve any 1311.335Schs extended attributes that have been corrupted by the backward 1321.335Schs incompatibility too. 1331.335Schs 1341.335Schs If you wish to use a UFS2ea file system as your root file system, 1351.335Schs then you will need to update your boot loader to a version that 1361.335Schs supports UFS2ea. 1371.335Schs 1381.335Schs For more information, see: 1391.335Schs https://wiki.netbsd.org/features/UFS2ea 1401.335Schs 1411.334Smrg20221111: 1421.334Smrg The new libdrm import worsened the conflict issues for the 1431.334Smrg kdump/ktruss ioctl, and i915 now conflicts with base, and has 1441.334Smrg been turned off. This will cause update build issues like: 1451.334Smrg 1461.334Smrg kdump-ioctl.c:12175:143: error: 'DRM_IOCTL_I915_DESTROY_HEAP' 1471.334Smrg undeclared here (not in a function); 1481.334Smrg did you mean 'DRM_IOCTL_MODE_DESTROY_DUMB'? 1491.334Smrg 1501.334Smrg You'll need to clean usr.bin/ktruss, usr.bin/kdump, and rescue. 1511.334Smrg 1521.331Sriastrad20220921: 1531.331Sriastrad Since the kernel version was bumped to 9.99.100, the bootloader 1541.333Sriastrad must be updated on x86 or EFI boot platforms in order to load 1551.333Sriastrad modules from boot.cfg(5) or interactively at the bootloader 1561.333Sriastrad prompt. 1571.333Sriastrad 1581.333Sriastrad The kernel can still load modules at runtime, with modload(8) 1591.333Sriastrad or modules.conf(5), with no bootloader update. This will not 1601.333Sriastrad affect release branches because it only applies to patch 1611.333Sriastrad numbers >=100. 1621.333Sriastrad 1631.333Sriastrad On x86 (i386 or amd64) with BIOS boot, this requires copying a 1641.333Sriastrad new /usr/mdec/boot to /boot. You can build this in the destdir 1651.333Sriastrad by running `$TOOLDIR/bin/nbmake-$ARCH dependall install' in 1661.333Sriastrad sys/arch/i386/stand. 1671.333Sriastrad 1681.333Sriastrad On platforms with EFI boot (including x86 with EFI boot), this 1691.333Sriastrad requires copying a new /usr/mdec/boot*.efi to the EFI/BOOT/ 1701.333Sriastrad directory on the EFI system partition. The boot*.efi file is: 1711.333Sriastrad 1721.333Sriastrad aarch64 bootaa64.efi 1731.333Sriastrad amd64 bootx64.efi 1741.333Sriastrad arm bootarm.efi (32-bit arm) 1751.333Sriastrad i386 bootx32.efi 1761.333Sriastrad 1771.333Sriastrad You can build this in the destdir by running 1781.333Sriastrad `$TOOLDIR/bin/nbmake-$ARCH dependall install' in 1791.333Sriastrad sys/stand/efiboot/boot*. 1801.331Sriastrad 1811.330Slukem20220821: 1821.330Slukem Support for building extsrc/ has been deprecated. 1831.330Slukem EXTSRCSRCDIR and MKEXTSRC have been deprecated. 1841.330Slukem 1851.329Smrg20220714: 1861.329Smrg Updates to xorg-server and associated drivers may cause builds to 1871.329Smrg fail. Cleaning both DESTDIR and the xorg build tree may be needed. 1881.329Smrg 1891.328Smartin20220628: 1901.328Smartin Changes in the build of src/games/robots require a clean build 1911.328Smartin of that program. 1921.328Smartin 1931.324Smartin20211116: 1941.324Smartin Changes in the xorg build require clean obj dirs for external/mit/xorg 1951.325Smartin (or a full clean/non-update build). 1961.324Smartin 1971.323Snia20211112: 1981.323Snia Device tree sources were updated for evbarm. Some device nodes 1991.323Snia (in particular, ld(4) devices on the ROCKPro64) will be renumbered. 2001.323Snia 2011.322Smartin20211014: 2021.323Snia MKPIE default for aarch64 has changed, a clean build is required. 2031.322Smartin 2041.321Schristos20210917: 2051.321Schristos Changed MNT_ACLS to default to POSIX1e ACLs instead of NFSv4 2061.321Schristos ACLs, to be compatible with FreeBSD. If you are using NFSv4 ACLs 2071.321Schristos and have "acls" in /etc/fstab you'll need to change it to "nfs4acls". 2081.321Schristos 2091.319Smrg20210711: 2101.319Smrg Updated GMP sources may require cleaning in tools/gmp and/or in 2111.319Smrg external/lgpl3/gmp/lib, particularly if GCC itself does not build. 2121.319Smrg 2131.318Smrg20210417: 2141.318Smrg GCC 10 was enabled for several platforms. If builds fail in either 2151.351Sgutterid tools/gcc or external/gpl3/gcc, first try cleaning those objects and 2161.318Smrg removing the $DESTDIR/usr/include/g++ subdirectory. 2171.318Smrg 2181.316Smrg20201016: 2191.316Smrg MIPS kernel modules have been disabled until they work. This will 2201.316Smrg turn up in extra files in the DESTDIR, which should be cleaned. 2211.316Smrg 2221.315Smrg20200925: 2231.315Smrg GNU MPC and MPFR have been updated. At least MPFR needs cleaning 2241.315Smrg in both the tools and external dirs. 2251.315Smrg 2261.314Smrg20200912: 2271.314Smrg GCC 9 has arrived for Arm and x86 platforms, and will be coming 2281.314Smrg for several more, as will binutils 2.34. Clean as required. 2291.314Smrg 2301.313Smrg20200907: 2311.313Smrg GCC 9 is coming, and binutils has been updated for MIPS. This 2321.313Smrg probably requires cleaning the tools/binutils. 2331.313Smrg 2341.311Smrg20200811: 2351.312Smrg GCC updates may require cleaning the objdir. This may occur 2361.312Smrg due to GCC 7.5 update, GCC 8.4 move to gcc.old, or the upcoming 2371.312Smrg GCC 9 upgrade. 2381.311Smrg 2391.309Schristos20200614: 2401.310Schristos blacklist* has been renamed to blocklist*. postinstall(8) 2411.332Sgutterid should handle the migration. 2421.309Schristos 2431.308Schristos20200601: 2441.308Schristos Due to a mistake in LIBISPRIVATE handling, .so libraries were 2451.308Schristos created in the build directories and need cleaning. 2461.308Schristos 2471.307Smrg20200311: 2481.307Smrg GCC 8 ports will need cleaning in src/tools/gcc and 2491.307Smrg src/external/gpl3/gcc due to GCC 8.4 update. 2501.307Smrg 2511.306Schristos20191118: 2521.306Schristos More architectures were switched to gcc8: 2531.306Schristos i386, ia64 powerpc64, sparc, sparc64, arm 2541.306Schristos The same comments as in 20191022 apply. 2551.306Schristos 2561.305Smartin20191112: 2571.305Smartin The LLVM update requires a clean rebuild for all architectures using 2581.305Smartin LLVM during the tools build phase (i386, amd64, aarch64). 2591.305Smartin 2601.304Smartin20191022: 2611.304Smartin Ports amd64 and aarch64 switched to GCC 8.3 by default. 2621.304Smartin In-place ("expert mode", build.sh -E) builds are not supported 2631.304Smartin when going from a GCC 7 userland to GCC 8. Do a regular 2641.304Smartin build to a different DESTDIR (or preferably: build.sh -U) at least 2651.306Schristos once and install sets, or download comp.{tar.xz,tgz} from the 2661.304Smartin daily builds and install that before doing the next in-place build. 2671.304Smartin 2681.303Smrg20191001: 2691.303Smrg GCC 8.3 was imported. Builds of src/tools/gcc may fail if 2701.303Smrg old builds with GCC 7 output now uses GCC 8. Clean this 2711.303Smrg directory, and also clean src/external/gpl3/gcc. 2721.303Smrg 2731.302Sriastrad20190903: 2741.306Schristos Files with names that coincide with existing files' names on 2751.302Sriastrad case-insensitive file systems were inadvertently committed, for 2761.302Sriastrad radeon GPU firmware. We cannot mark these as obsolete for 2771.302Sriastrad postinstall to fix, so if you updated src since 2019-08-26, and 2781.302Sriastrad ran build.sh distribution or ran build.sh release, you must 2791.302Sriastrad manually delete the following files in your DESTDIR (which is 2801.302Sriastrad usually $OBJDIR/destir.$ARCH), or from / if you have installed 2811.302Sriastrad them: 2821.302Sriastrad 2831.302Sriastrad /libdata/firmware/radeon/bonaire_ce.bin 2841.302Sriastrad /libdata/firmware/radeon/bonaire_mc.bin 2851.302Sriastrad /libdata/firmware/radeon/bonaire_me.bin 2861.302Sriastrad /libdata/firmware/radeon/bonaire_mec.bin 2871.302Sriastrad /libdata/firmware/radeon/bonaire_pfp.bin 2881.302Sriastrad /libdata/firmware/radeon/bonaire_rlc.bin 2891.302Sriastrad /libdata/firmware/radeon/bonaire_sdma.bin 2901.302Sriastrad /libdata/firmware/radeon/bonaire_smc.bin 2911.302Sriastrad /libdata/firmware/radeon/bonaire_uvd.bin 2921.302Sriastrad /libdata/firmware/radeon/hainan_ce.bin 2931.302Sriastrad /libdata/firmware/radeon/hainan_mc.bin 2941.302Sriastrad /libdata/firmware/radeon/hainan_me.bin 2951.302Sriastrad /libdata/firmware/radeon/hainan_pfp.bin 2961.302Sriastrad /libdata/firmware/radeon/hainan_rlc.bin 2971.302Sriastrad /libdata/firmware/radeon/hainan_smc.bin 2981.302Sriastrad /libdata/firmware/radeon/hawaii_ce.bin 2991.302Sriastrad /libdata/firmware/radeon/hawaii_mc.bin 3001.302Sriastrad /libdata/firmware/radeon/hawaii_me.bin 3011.302Sriastrad /libdata/firmware/radeon/hawaii_mec.bin 3021.302Sriastrad /libdata/firmware/radeon/hawaii_pfp.bin 3031.302Sriastrad /libdata/firmware/radeon/hawaii_rlc.bin 3041.302Sriastrad /libdata/firmware/radeon/hawaii_sdma.bin 3051.302Sriastrad /libdata/firmware/radeon/hawaii_smc.bin 3061.302Sriastrad /libdata/firmware/radeon/kabini_ce.bin 3071.302Sriastrad /libdata/firmware/radeon/kabini_me.bin 3081.302Sriastrad /libdata/firmware/radeon/kabini_mec.bin 3091.302Sriastrad /libdata/firmware/radeon/kabini_pfp.bin 3101.302Sriastrad /libdata/firmware/radeon/kabini_rlc.bin 3111.302Sriastrad /libdata/firmware/radeon/kabini_sdma.bin 3121.302Sriastrad /libdata/firmware/radeon/kaveri_ce.bin 3131.302Sriastrad /libdata/firmware/radeon/kaveri_me.bin 3141.302Sriastrad /libdata/firmware/radeon/kaveri_mec.bin 3151.302Sriastrad /libdata/firmware/radeon/kaveri_mec2.bin 3161.302Sriastrad /libdata/firmware/radeon/kaveri_pfp.bin 3171.302Sriastrad /libdata/firmware/radeon/kaveri_rlc.bin 3181.302Sriastrad /libdata/firmware/radeon/kaveri_sdma.bin 3191.302Sriastrad /libdata/firmware/radeon/mullins_ce.bin 3201.302Sriastrad /libdata/firmware/radeon/mullins_me.bin 3211.302Sriastrad /libdata/firmware/radeon/mullins_mec.bin 3221.302Sriastrad /libdata/firmware/radeon/mullins_pfp.bin 3231.302Sriastrad /libdata/firmware/radeon/mullins_rlc.bin 3241.302Sriastrad /libdata/firmware/radeon/mullins_sdma.bin 3251.302Sriastrad /libdata/firmware/radeon/oland_ce.bin 3261.302Sriastrad /libdata/firmware/radeon/oland_mc.bin 3271.302Sriastrad /libdata/firmware/radeon/oland_me.bin 3281.302Sriastrad /libdata/firmware/radeon/oland_pfp.bin 3291.302Sriastrad /libdata/firmware/radeon/oland_rlc.bin 3301.302Sriastrad /libdata/firmware/radeon/oland_smc.bin 3311.302Sriastrad /libdata/firmware/radeon/pitcairn_ce.bin 3321.302Sriastrad /libdata/firmware/radeon/pitcairn_mc.bin 3331.302Sriastrad /libdata/firmware/radeon/pitcairn_me.bin 3341.302Sriastrad /libdata/firmware/radeon/pitcairn_pfp.bin 3351.302Sriastrad /libdata/firmware/radeon/pitcairn_rlc.bin 3361.302Sriastrad /libdata/firmware/radeon/pitcairn_smc.bin 3371.302Sriastrad /libdata/firmware/radeon/tahiti_ce.bin 3381.302Sriastrad /libdata/firmware/radeon/tahiti_mc.bin 3391.302Sriastrad /libdata/firmware/radeon/tahiti_me.bin 3401.302Sriastrad /libdata/firmware/radeon/tahiti_pfp.bin 3411.302Sriastrad /libdata/firmware/radeon/tahiti_rlc.bin 3421.302Sriastrad /libdata/firmware/radeon/tahiti_smc.bin 3431.302Sriastrad /libdata/firmware/radeon/verde_ce.bin 3441.302Sriastrad /libdata/firmware/radeon/verde_mc.bin 3451.302Sriastrad /libdata/firmware/radeon/verde_me.bin 3461.302Sriastrad /libdata/firmware/radeon/verde_pfp.bin 3471.302Sriastrad /libdata/firmware/radeon/verde_rlc.bin 3481.302Sriastrad /libdata/firmware/radeon/verde_smc.bin 3491.302Sriastrad 3501.302Sriastrad We will re-import these radeon firmware images another way 3511.302Sriastrad later. 3521.302Sriastrad 3531.301Smartin20190727: 3541.301Smartin The uefi bootloader has gained tftp support and needs a clean 3551.301Smartin build. If you do update builds, manually clean its object 3561.301Smartin directory by something like: 3571.301Smartin cd sys/arch/i386/stand/efiboot && make clean 3581.301Smartin 3591.300Smartin20190723: 3601.344Sgutterid The jemalloc allocator in libc is now built without extended 3611.300Smartin debugging (for performance reasons). In update builds make sure 3621.326Sandvar to rebuild it completely, by removing all affected object files, 3631.300Smartin including compat builds, something like: 3641.300Smartin cd /usr/obj && find . -type d -name jemalloc|xargs rm -rf 3651.300Smartin 3661.299Smrg20190207: 3671.299Smrg GCC 7 switched for many ports. Update builds are likely to fail. 3681.299Smrg 3691.1SabsHints for a more successful build: 3701.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3711.123Sjmc Use build.sh, but do not use its "expert mode": 3721.132Sjmmv This will automatically build the tools in the 3731.123Sjmc correct order, and it will keep the tools and the 3741.123Sjmc new build products from interfering with the running 3751.123Sjmc system. This will allow you to ignore most of the 3761.123Sjmc other advice in this file. 3771.2Smrg Build a new kernel first: 3781.2Smrg This makes sure that any new system calls or features 3791.2Smrg expected by the new userland will be present. This 3801.2Smrg helps to avoid critical errors when upgrading. 3811.1Sabs Use object directories: 3821.1Sabs This helps to keep stale object 3831.1Sabs files from polluting the build if a Makefile "forgets" 3841.1Sabs about one. It also makes it easier to clean up after 3851.1Sabs a build. It's also necessary if you want to use the 3861.1Sabs same source tree for multiple machines. 3871.123Sjmc To use object directories with build.sh: 3881.123Sjmc a) invoke build.sh with the "-M" or "-O" options. 3891.123Sjmc To use object directories without using build.sh: 3901.1Sabs a) cd /usr/src ; make cleandir 3911.2Smrg b) Add "OBJMACHINE=yes" to /etc/mk.conf 3921.2Smrg c) Add "MKOBJDIRS=yes" to /etc/mk.conf 3931.1Sabs d) cd /usr/src ; make build 3941.2Smrg Note that running "make obj" in a directory will create 3951.2Smrg in obj.$MACHINE directory. 3961.1Sabs Build to a DESTDIR: 3971.123Sjmc This helps to keep old installed files (especially libraries) 3981.123Sjmc from interfering with the new build. 3991.123Sjmc To build to a DESTDIR with build.sh, use the "-D" option. 4001.123Sjmc To build to a DESTDIR without using build.sh, set the DESTDIR 4011.123Sjmc environment variable before running make build. It should be 4021.123Sjmc set to the pathname of an initially empty directory. 4031.123Sjmc Problems: if you do not use build.sh, you might need to 4041.123Sjmc update critical utilities without using DESTDIR since 4051.123Sjmc nothing is executed from what is installed in DESTDIR. 4061.123Sjmc (See critical utils, below.) 4071.1Sabs Build often: 4081.1Sabs This keeps critical utilities current enough to not choke 4091.1Sabs on any other part of the source tree that depends on up to 4101.123Sjmc date functionality. If you use build.sh, you should not have 4111.123Sjmc this problem. 4121.241Swiz 4131.1SabsWhat to do if things don't work: 4141.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4151.230StlsWhen things don't work there are usually a few things that commonly 4161.1Sabsshould be done. 4171.1Sabs 1) make includes 4181.1Sabs This should be done automatically by make build. 4191.1Sabs 2) cd share/mk && make install 4201.1Sabs Again, automatically done by make build. 4211.1Sabs 4221.1SabsFailsafe rebuild of a small part of the tree: 4231.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4241.1SabsTo make sure you rebuild something correctly you want to do 4251.1Sabssomething like the following: 4261.1Sabs 1) Make sure the includes and .mk files are up to date. 4271.1Sabs 2) Make sure any program used to build the particular 4281.1Sabs utility is up to date. (yacc, lex, etc...) 4291.1Sabs 3) cd ...path/to/util... 4301.1Sabs make cleandir 4311.1Sabs rm ...all obj directories... 4321.1Sabs make cleandir # yes, again 4331.1Sabs make obj 4341.1Sabs make depend && make 4351.1Sabs 4361.1SabsFailsafe rebuild of the entire tree: 4371.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4381.1SabsIf you really want to make sure the source tree is clean and 4391.2Smrgready for a build try the following. Note that sourcing /etc/mk.conf 4401.2Smrg(a make(1) Makefile) in this manner is not right, and will not work 4411.2Smrgfor anyone who uses any make(1) features in /etc/mk.conf. 4421.1Sabs 4431.1Sabs---cut here--- 4441.1Sabs#!/bin/sh 4451.1Sabs. /etc/mk.conf 4461.1Sabs 4471.58Slukemif [ -z $NETBSDSRCDIR ] ; then 4481.58Slukem NETBSDSRCDIR=/usr/src 4491.1Sabsfi 4501.58Slukemif [ \! -d $NETBSDSRCDIR ] ; then 4511.1Sabs echo Unable to find sources 4521.1Sabs exit 1 4531.1Sabsfi 4541.58Slukemfind $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \; 4551.1Sabs 4561.1Sabsif [ -z $BSDOBJDIR ] ; then 4571.1Sabs BSDOBJDIR=/usr/obj 4581.1Sabsfi 4591.1Sabsif [ -d $BSDOBJDIR ] ; then 4601.1Sabs rm -rf $BSDOBJDIR 4611.1Sabsfi 4621.1Sabs 4631.58Slukemcd $NETBSDSRCDIR && make cleandir 4641.1Sabs 4651.1Sabs---cut here--- 4661.1Sabs 4671.1SabsCritical utilities: 4681.1Sabs^^^^^^^^^^^^^^^^^^^ 4691.1Sabs usr.bin/make 4701.1Sabs usr.bin/yacc 4711.1Sabs usr.bin/lex 4721.11Slukem usr.bin/xlint 4731.142Sdrochner usr.bin/config 4741.1Sabs 4751.34SsimonbOther problems and possible solutions: 4761.1Sabs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4771.1SabsSymptom:Complaints involving a Makefile. 4781.17SerhFix: Rebuild usr.bin/make: 4791.17Serh cd usr.bin/make && make && make install 4801.111Ssimonb Or, a failsafe method if that doesn't work: 4811.348Srillig cd usr.bin/make && cc -DMAKE_NATIVE *.c -I. -o make \ 4821.348Srillig && install make /usr/bin 4831.17Serh 4841.1SabsFix: Make sure .mk files are up to date. 4851.1Sabs cd share/mk && make install 4861.2Smrg 4871.2SmrgSymptom:Kernel `config' fails to configure any kernel, including GENERIC. 4881.142SdrochnerFix: Rebuild usr.bin/config 4891.1Sabs 4901.4SitojunSymptom:Obsolete intermediate files are used during compilation 4911.4SitojunFix: Try the following sequence of commands in the directory in question. 4921.4Sitojun make cleandir; rm `make print-objdir`; make cleandir; make obj 4931.4Sitojun (If you built the tree without "make obj" in the past, obsolete files 4941.4Sitojun may remain. The command tries to clean everything up) 4951.5Swiz 4961.207SmbalmerSymptom:.../sysinst/run.c:xx: warning: initialization from incompatible 4971.207Smbalmer pointer type 4981.5SwizFix: Rebuild and install usr.bin/menuc 4991.12Sitojun 5001.12SitojunSymptom:mklocale not found during build in share/locale/ctype 5011.12SitojunFix: Build and install usr.bin/mklocale 5021.13Sdogcow 5031.86SkleinkSymptom:undefined reference to `__assert13' or `__unsetenv13' 5041.13SdogcowFix: Rebuild and install lib/libc 5051.13Sdogcow 5061.142SdrochnerSymptom:usr.bin/config fails to build. 5071.19ScgdFix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile. 5081.13Sdogcow 5091.19ScgdSymptom:undefined reference to `getprogname' or `setprogname' 5101.19ScgdFix: Rebuild and install lib/libc 5111.24Sabs 5121.223SjoergSymptom:Update build fails in src/tools/gcc complaining that a variable 5131.223Sjoerg (e.g. CPPFLAGS) has changed since the previous run. 5141.223SjoergFix: Run "nbmake-${ARCH} clean" in src/tools/gcc or do a clean build. 5151.257Sapb 5161.257SapbSymptom:cvs [update aborted]: cannot open directory /cvsroot/src/...: 5171.257Sapb No such file or directory. 5181.257SapbCause: If a directory is created by mistake, then it is sometimes 5191.257Sapb deleted from the CVS repository using administrative commands 5201.257Sapb that bypass the normal cvs access controls. If your cvs working tree 5211.257Sapb contains references to a directory that has been deleted on the 5221.257Sapb server in this way, then "cvs update" reports this error. 5231.257SapbFix: Recursively delete the affected directory from your working tree 5241.257Sapb and try the update again. 525