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