UPDATING revision 1.154
1$NetBSD: UPDATING,v 1.154 2006/12/14 20:15:32 he 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 14See also: BUILDING, build.sh, Makefile. 15 16Recent changes: 17^^^^^^^^^^^^^^^ 18 1920061214: 20 Following the move of string_to_flags() and flags_to_string() 21 from the bin/ls/ sources to libutil, users doing UPDATE builds 22 will need to do a "make cleandir" in 23 tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/, 24 bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/, 25 usr.bin/xinstall/, and libexec/ftpd/ 26 in order to excise stale references to the old stat_flags.h header 27 file in the ls sources -- stat_flags.h has been removed. 28 2920061108: 30 The configure script used in the src/tools/gcc compiler has been 31 changed to indicate that our libc has ssp support built-in and 32 does not depend on -lssp and -lssp-nonshared. You'll need to 33 make clean in src/tools/gcc first to rebuild the compiler. 34 3520061009: 36 The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer 37 available. Use net.inet{,6}.tcp{,6}.congctl.selected instead. 38 3920060814: 40 The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been 41 withdrawn. Use vidcvideo and pckbd instead. See the GENERIC 42 kernel configuration for an example. X servers from the last 43 few years should cope. 44 4520060703: 46 MPACPI is no more. We always configure PCI interrupts using ACPI 47 if we have an ACPI kernel. The option MPACPI_SCANPCI has been renamed 48 to ACPI_SCANPCI. Thanks to work from fvdl. 49 5020060627: 51 socket(2) has changed, and its system call has been versioned. 52 For userlands with the old version of socket(2), make sure that 53 your kernel has 'options COMPAT_30' set, or else 'bad system call' 54 errors will result. 55 5620060526: 57 The kernel linker scripts for i386 and xen 58 (sys/arch/i386/conf/kern.ldscript*) were changed to set the 59 load address correctly, for the benefit of MULTIBOOT boot loaders 60 (like Grub). If you use a linker (ld) older than from 2006/04/17, it 61 will be unable to link the kernel because of a bug and ld will fail 62 with an error like: 63 ../../../../arch/i386/conf/kern.ldscript:45 \ 64 non constant expression for load base 65 You need to update at least src/gnu/dist/binutils/ld and recompile 66 and install the linker. If using the build.sh script, the easiest 67 way is with a "build.sh tools" command, with any other options 68 that you use normally. When using build.sh, the linker binary is 69 installed as ${TOOLDIR}/bin/i386--netbsdelf-ld. 70 7120060131: 72 the protocol between the sparc64 bootloader (ofwboot) and 73 the kernel was changed. Before installing a new kernel, 74 you need to update ofwboot. After a full build, just copy 75 /usr/mdec/ofwboot to /, or do a rebuild of 76 src/sys/arch/sparc/stand/ofwboot and install the result to /. 77 7820050917: 79 arch/*/conf/std.* was changed to include conf/std, which 80 contains MI options previously enabled by default. 81 If you have kernel config files which doesn't include 82 arch/*/conf/std.*, you need to edit them to include conf/std 83 to get the previous configuration. 84 8520050830: 86 named.conf was moved from /etc/namedb to /etc. 87 postinstall(8) migrates this during interactive use. 88 Users of MKUPDATE=yes will need to manually rectify 89 this in their DESTDIR. 90 9120050825: 92 Some data structures in sys/device.h, related to interface 93 attributes and locator names, were changed. config(1) was 94 modified to emit the new data structures. 95 Thus usr.bin/config must be updated (and run on the kernel 96 configuration file) before a new kernel can be built. 97 9820050531: 99 genassym.sh(8) was moved to genassym(1). You need to either build 100 tools first or install the version of genassym from /usr/bin before 101 you can build a kernel again. 102 10320050520: 104 Because a kernfs bug which xentools relies on was fixed, 105 xentools up to xentools20-2.0.3nb4 won't work with new kernel. 106 10720050417: 108 postinstall(8) was moved from /etc to /usr/sbin and made part 109 of the "base" set, to make it easier to invoke after an 110 upgrade. 111 11220050325: 113 pcppi(4) was separated in two devices, adding attimer(4). Be sure 114 to add a config line for an attimer(4) device in your kernel 115 configuration, or you won't be able to set the pitch of the beep 116 with wsconsctl. Depending on the default value for the pitch, you 117 might even not hear any more beep. Also, it is advised to attach both 118 devices the same way (i.e., both on isa or both on acpi) or the 119 pcppi(4) device may fail to find the attimer(4) one. 120 12120050211: 122 Fixes to tools/Makefile.gnuhost may cause UPDATE=1 builds in 123 some of the cross tools to fail if they use configure. Some configure's 124 cache the environment passed in and notice the new environment is 125 different and abort. Doing a clean in tools/ should be enough to 126 make a build continue. 127 12820050109: 129 Since su is using pam by default now, make sure that you have 130 /etc/pam.d populated (postinstall will do that automatically 131 for you). Otherwise su will fail open (i.e. will not require 132 a password). 133 13420041229: 135 Make had a path resolution bug that manifested itself as not 136 being able to install openpam.3. This bug has been fixed, but 137 you might need to rebuild make manually first to get through 138 the build. 139 14020041201: 141 Userland programs have been changed to use /dev/bpf instead of 142 /dev/bpfX. You need to create that device by installing a new 143 MAKEDEV and running it, or mv /dev/bpf0 /dev/bpf && rm /dev/bpf[0-9]* 144 14520041006: 146 147 A bug was introduced into /bin/sh (var.c rev 1.35) which causes 148 variables to not export correctly to subshells in all cases. This 149 will cause builds to break if that version of /bin/sh is installed 150 on the system. The proper version of /bin/sh can be verified with: 151 152 ident /bin/sh | grep var 153 154 Any /bin/sh w. version 1.35 will not work and needs to be updated 155 before attempting a build. 156 15720041001: 158 The ipfilter kernel sources moved from sys/netinet to 159 dist/sys/ipf/netinet. Due to the move some Makefile 160 dependencies are now dangling requiring a make cleandir 161 before they work again (kdump, ktruss, rescue, ipf, and 162 ftp-proxy are the victims). 163 16420040715: 165 The rc.d/sendmail script now uses a heuristic to determine 166 if sendmail should be started at boot time. It checks the 167 contents of /etc/mailer.conf, /etc/mail/submit.cf, and the 168 owner and mode of the sendmail binary to see if any changes 169 to the mail infrastructure have been made. If no changes 170 are detected, it will start an SMTP listener. 171 172 Setting sendmail=NO in /etc/rc.conf will override this. 173 174 If you are only using sendmail by default and only for 175 local delivery, it is important that you also update your 176 sendmail.cf so that the SMTP listener only listens on the 177 loopback interface. 178 17920040715: 180 The method by which athhal-elf.o gets pulled into i386 181 kernel builds has been changed again. The latest version 182 of bsd.files.mk is no longer required. 183 18420040621: 185 Due to the recent rototill of tools/compat it's crucial one starts 186 from a clean objdir under tools/*. 187 188 This is mostly due to generated files (yacc and lex sources) needing 189 to be generated with new rules from bsd.hostprog.mk. 190 191 The safest course is to rm -rf all objects under tools before building. 192 19320040516: 194 The end-user modifiable X11 configuration has been moved 195 from /usr/X11R6/lib/X11/<dir> to /etc/X11/<dir>. 196 Ensure that src and xsrc is up to date, and run 197 "make cleandir" in src/x11 before your next build. 198 199 postinstall currently doesn't migrate the files from 200 /usr/X11R6/lib/X11/* to /etc/X11/* although it does 201 detect that this needs to occur, so you'll have to 202 manually move these files yourself. 203 20420040426: 205 Support for the original dynamic sysctl node structure has 206 been removed in favor of the newer layout. This affects 207 consumers of the create and delete interface, as well as 208 the dynamic discovery mechanism. This is believed only to 209 be the sysctl(8) binary itself, at this point in time, so 210 the only effect of this should be that a sysctl binary 211 built from sources dated between 2003/12/04 and 2004/03/24 212 will not work on a kernel built from sources dated after 213 2004/04/25. If you need a new sysctl binary but build.sh 214 does not work, make sure that your revision of 215 src/sys/sys/sysctl.h is 1.112 (or later), and then the 216 do the following: 217 218 cd /usr/src (or wherever your source tree is) 219 make USETOOLS=no includes 220 cd lib/libc 221 make USETOOLS=no dependall install 222 cd ../../sbin/sysctl 223 make USETOOLS=no dependall install 224 225 If you are using older sysctl binary, GNU autoconf would fail to 226 identify your machine architecture, and tries to build binary for 227 "unknown-unknown-netbsd20F" or something like that. if that happens, 228 make sure to follow the above steps. 229 23020040425: 231 The ffs superblock issues listed below under 20040109 and 20030402 232 are now automatically addressed by the /etc/rc.d/fixsb script or by 233 sysinst when it checks a a filesystem. The manual fsck_ffs -b16 -c4 234 invocation mentioned below will continue to work and is now 235 automated by those scripts. Note that under certain circumstances, 236 affected filesystems upgraded to a -current kernel first before 237 upgrading their userland with the fixsb and fsck_ffs fixes may 238 encounter a 'freeing free inode' panic when writing to the affected 239 filesystem, so it is a good idea to repair the filesystem as soon as 240 possible. For more details on the fixsb script, see pr install/25138. 241 24220040418: 243 statfs(2) and friends have been replaced with statvfs(2). Before 244 installing a newly build userland make sure that you are running 245 a newly built kernel with COMPAT_20 set. In addition your libc 246 build might not work (undefined SYS_statfs symbol) because make 247 clean does not know how to remove files it does not know about 248 anymore. Manually remove all generated .S sources and objects 249 from the libc build directory. 250 25120040326: 252 The method by which athhal-elf.o gets pulled into i386 kernel builds 253 has been changed. The file is now stored as a uuencoded file in CVS 254 and the generated Makefile will use the new .uue rules from bsd.file.mk 255 to build it. 256 257 This means you must have the latest bsd.files.mk installed when 258 building a kernel without USETOOLS=yes. 259 26020040318: 261 A bug in the cgd(4) blowfish code was corrected, without 262 provision of backwards compatibility, after several public 263 notices over several months. Users of cgd with blowfish cipher 264 ONLY must dump their data before updating their kernels, and 265 recreate cgd's and restore data using the new kernel. See 266 (recent message to current-users, URL when mail-index has updated) 267 26820040313: 269 On acorn32, the opms and qms drivers have been withdrawn, and 270 the old wsqms driver is now called qms. Kernel config files 271 will need updating. See the ones in sys/arch/acorn32/conf 272 for examples. 273 27420040125: 275 On acorn32, the beep and sysbeep devices are no longer 276 needed, and will need to be deleted from kernel configuration 277 files. 278 27920040109: 280 Compatibility for old ffs superblock layouts has been 281 added, and the restrictive fsck checks have been reenabled 282 when using those layouts. If you have been using -current 283 since 20030402, you may find that fsck again signals fatal 284 superblock mismatches. To repair, make sure you have 285 an updated fsck_ffs and then you can use fsck_ffs -b 16 -c 4 286 to complete the filesystem upgrade. A message has 287 been added to the kernel which should detect this problem. 288 See the following discussion for more information: 289 http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html 290 29120031203: 292 New binutils builds may fail due to old dependencies. 293 It's necessary to "make cleandir" to ensure that 294 the dependencies will be rebuilt correctly. 295 29620031111: 297 A newer mkdep is needed. Error noting that is 298 cc: Ambiguous abbreviation -- 299 30020031008: 301 /usr/include/sys/disklabel_mbr.h was removed. 302 It's necessary to "make cleandir" to ensure that 303 the dependencies will be rebuilt correctly. 304 30520031007: 306 A sign extension bug was fixed which set all the high bits 307 of our newly expanded ffs fs_flags. This should only 308 affect users who installed or upgraded in September of 2003. 309 A small utility program was posted to tech-kern which 310 should fix this problem, and a warning message was added 311 to the kernel which should discover and warn about it. See 312 http://mail-index.NetBSD.org/tech-kern/2003/10/07/0005.html 313 31420030906: 315 With the addition of siginfo support the old signal trampoline 316 code has been deprecated to COMPAT_16. Make sure that your running 317 kernel has COMPAT_16 enabled before building userland. 318 31920030801: 320 With the new openssl, there is some header and library shuffling. 321 rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \ 322 /usr/lib/libdes* before building. 323 32420030703: 325 Texinfo was updated to 4.6. To avoid failures when trying to 326 build the included texinfo files, do: 327 328 cd src/gnu/usr.bin/texinfo 329 make MKINFO=no dependall install 330 33120030630: 332 Groff was updated to 1.19; it's probably necessary to do 333 cd share/mk && make install 334 cd src/gnu/usr.bin/groff 335 make MKMAN=no dependall install 336 (untested). 337 33820030516: 339 Due to bugs in the export handling code, invalid export lines 340 were accepted before and caused the kernel to panic when 341 mountd got restarted because it freed memory that had already 342 been freed. This has been fixed and the kernel checks 343 export addresses very strictly. If you upgrade your kernel, 344 make sure you also upgrade mountd, because if your export 345 file contains lines with an old inet4 address syntax (i.e. 346 a.b.c or a.b or a), they will get rejected by the new kernel. 347 34820030402: 349 The superblock layout for FFS was changed. If you have 1.6 350 fsck binaries, they will signal a fatal superblock mismatch 351 with the first alternate, because they compare too many 352 fields (even ones that aren't useful). If possible, upgrade 353 your fsck_ffs binary before using a new kernel. 354 None of this signals actual filesystem damage. 355 35620030324: 357 sendmail version 8.12.8 was imported. Since sendmail is 358 now setgid to the smmsp group, and runs in "collection" 359 mode for most common activities, there is a new config 360 file called submit.cf that needs to live in /etc/mail. 361 The generic submit.cf sample in /usr/share/sendmail/cf 362 is named netbsd-msp.cf. Upgrading your regular sendmail 363 configuration file is also strongly advised. 364 365 See the section named "MESSAGE SUBMISSION PROGRAM" in 366 the updated /usr/share/sendmail/README file for more 367 information. 368 36920030117: 370 Texinfo was updated to 4.3. To avoid failures when trying to 371 build the included texinfo files, do: 372 373 cd src/gnu/usr.bin/texinfo 374 make MKINFO=no dependall install 375 37620021223: 377 The METALOG format changed slightly, to remove the leading 378 "${DESTDIR}" from path names. 379 This only affects people building with UNPRIVED. 380 For complete safety, remove the DESTDIR entirely and 381 update tools/mtree, before running make build. 382 38320021219: 384 CVS repository layout was changed. See the following for details 385 if you are using (anonymous) cvs to update your tree. 386 387 http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html 388 38920021219: 390 install(1) had a '-N dbdir' option added, to specify an 391 alternate location to look up users & groups (instead 392 of the host system passwd(5) and group(5) databases). 393 394 The build system was modified to take advantage of 395 this option (using ${NETBSDSRCDIR}/etc), so if you 396 use USETOOLS==no, you may have to rebuild and 397 reinstall usr.bin/xinstall first. 398 39920021130: 400 fparseln(3) moved from libutil to libc. 401 If building to DESTDIR=/, reinstall the includes 402 and rebuild libc: 403 make includes 404 make do-lib-libc 405 If using build.sh, "cd tools/compat && make clean" 406 before rebuilding the tools. 407 40820021126: 409 The mk.conf(5) variable SYS_INCLUDE has been deprecated, 410 including the optional "SYS_INCLUDE=symlinks" support. 411 All header files, including <sys/*.h> are copied into 412 /usr/include. 413 41420021121: 415 The C run-time support files crtbegin.o and crtend.o 416 (and their companions crtbeginS.o and crtendS.o) were 417 split up, with new crti.o and crtn.o files resulting. 418 This means that libtool needs to be rebuilt once the 419 new libraries are installed. The process of rebuilding 420 libtool will cause it to automatically notice the new 421 required files, but it *must* be rebuilt in order to 422 do this. 423 424 An out-of-date libtool will result in shared libraries 425 which lack _init() and _fini() routines, which means that 426 their global constructors/destructors will not be invoked. 427 42820021121: 429 A bug related to how ARM ELF objects were tagged has been 430 corrected. 431 432 NetBSD ARM ELF uses the soft-VFP floating point model by 433 default. However, the assembler lacked support for marking 434 objects as using the VFP floating point format, and the 435 compiler was not properly passing the flag indicating "soft-VFP" 436 to the assembler. 437 438 Unfortunately, this means that the linker will now consider 439 old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be 440 incompatible with new (properly marked) objects. 441 442 The problem will only manifest itself if you attempt to compile 443 a new program using the fixed toolchain, and link that program 444 against old libraries which do not have the proper "softvfp" 445 markings. ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES 446 WILL CONTINUE TO WORK PROPERLY. 447 448 The only work-around for the problem is to recompile all of 449 the libraries on the system. The easiest way to do this for 450 system libraries is to install a binary snapshot; they are 451 generally available on releng.NetBSD.org. Any packages you 452 have installed which supply libraries will have to be recompiled 453 if you wish to link new programs against those libraries. 454 455 If you have questions about this matter, please contact 456 port-arm@NetBSD.org. 457 45820021011: 459 Systrace has been improved to support privilege elevation. 460 Updating the kernel requires the userland part of systrace 461 to be rebuilt. 462 46320021010: 464 The config(8) grammar was changed to allow options to register 465 dependencies on attributes, as well as other options. Users 466 must update and reinstall usr.sbin/config before building a new 467 kernel. 468 46920021009: 470 A new attribute dependency syntax was introduced to config(8), 471 which is now used by the SCSI configuration description. Users 472 must update and reinstall usr.sbin/config before building a new 473 kernel. 474 47520021003: 476 Several changes have been made to the autoconfiguration 477 framework. Users must update and reinstall usr.sbin/config 478 before building a new kernel. 479 48020021001: 481 The i386mp branch has been merged. To compile a kernel, users 482 will need to add the option 'cpu* at mainbus?' to their configuration 483 file. Multiprocessor kernels will need 484 ioapic* at mainbus? apid ? 485 options MULTIPROCESSOR 486 options COM_MPLOCK 487 48820020922: 489 MKDYNAMICROOT=yes enabled by default, which means that 490 certain shared libraries are installed into /lib, the shared 491 linker is installed into /libexec, and all programs in /bin 492 and /sbin are dynamically linked. 493 If you do not use "make build", you should ensure that 494 you have the libraries and shared linker in the new locations, 495 with: 496 make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so 497 49820020917: 499 USE_NEW_TOOLCHAIN has been replaced with: 500 - TOOLCHAIN_MISSING -- set to "yes" on platforms for which 501 there is no working in-tree toolchain (hppa, ns32k, sh5, 502 x86_64). 503 - EXTERNAL_TOOLCHAIN -- if defined by the user, points to the 504 root of an external toolchain (e.g. /usr/local/gnu). This 505 enables the cross-build framework even for TOOLCHAIN_MISSING 506 platforms. 507 50820020906: 509 gehenna-devsw has been merged into the trunk. Need to update and 510 reinstall usr.sbin/config before building the kernel. 511 51220020822: 513 Crunched rescue tools (contents of /bin and /sbin, plus others) 514 are now provided in /rescue. 515 516 To ensure that these are built statically linked (no matter 517 what the setting of LDSTATIC is), use a crunchgen(1) built 518 from sources newer than 20020820 (see the next entry). 519 52020020820: 521 crunchgen(1) changed to ensure that the generated program 522 is statically linked. 523 524 Solution: update and reinstall usr.bin/crunch 525 52620020605: 527 smmsp user/group has been added for sendmail. 528 529 Add the following into /etc/group: 530 531 smmsp:*:17: 532 533 and the following to /etc/master.passwd (via vipw): 534 535 smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin 536 53720020515: 538 sshd user/group has been added. Need to hand add this in, or sshd 539 will not let you log in (with default, or UsePrivilegeSeparation=yes) 540 541 Add the following into /etc/group: 542 543 sshd:*:16: 544 545 and the following to /etc/master.passwd (via vipw): 546 547 sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin 548 549 Also /var/chroot/sshd directory needs to be present (digged as part of 550 the build process). 551 55220020426: 553 NBUILDJOBS obsoleted in favor of just using -j. 554 55520020426: 556 etc/postinstall added, which performs various checks for 557 configuration file updates and changes, and can fix most of 558 the problems identified. 559 This should make it much easier to upgrade a system's 560 configuration from earlier systems (as far back as NetBSD 1.5). 561 56220020320: 563 <bsd.lib.mk> needs a new install(1) for its "-a cmd" support. 564 Build and install at usr.bin/xinstall before the build. 565 56620020319: 567 Raw IPv6 socket now makes strict checking for sa_family and sa_len 568 on send(2) operation. Be sure to have sbin/rtsol and usr.sbin/rtsold 569 newer than November 2001 when you upgrade the kernel. 570 57120020311: 572 ssh configuration files were moved from /etc to /etc/ssh. Beware 573 if you restart your machine from remote. Note that sshd.conf needs 574 to be changed (due to the use of "/etc" inside). 575 57620020223: 577 Users of the VAX port will need to rebuild and install gas 578 so it deal with the now present register prefix used in all 579 the VAX assembly files. 580 58120020118: 582 ntpd user/group has been added. Need to hand add this in or builds 583 will break as mtree aborts early. 584 585 Add the following into /etc/group: 586 587 ntpd:*:15: 588 589 and the following to /etc/master.passwd (via vipw): 590 591 ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin 592 59320011207: 594 If you're attempting to build a snapshot on sparc64 and are getting 595 reloc errors from the toolchain groff binary this means your native 596 toolchain has some broken C++ bits. 597 598 To fix: 599 600 Build a new toolchain (i.e. build.sh -t) 601 Use the new toolchain to build and install natively (i.e. /usr/lib) 602 603 gnu/lib/libgcc 604 gnu/lib/libstdc++ 605 606 After this a snapshot will be able to be built. 607 60820011201: 609 In order for a sparc64 build to work you must have a working awk. If 610 you've built and installed a system with the new toolchain up to this 611 point you do not have a working awk as its ability to do floating 612 point is broken. 613 614 To build: 615 616 remake and install gnu/lib/libgcc 617 remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links 618 against the new libgcc.a) 619 62020011128: 621 Kernel config information was changed to use defflag in 622 the various "files" files. Bug fixes to config(8) are 623 required in order for this to work properly. Make sure 624 to build and install in usr.sbin/config before attempting 625 to build a new kernel. 626 62720011030: 628 libc/locale/wcstod.c now needs new lint(1). Update lint(1) 629 before building libc. 630 63120011029: 632 The new document BUILDING.mdoc (view with nroff | more, or 633 see pre-generated .txt and .html versions) describes the build 634 procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN 635 build process, are intended in the long run to replace this 636 manual update log. 637 638 Users building a USE_NEW_TOOLCHAIN system should read the 639 BUILDING document for caveats. Generally, BUILDING supersedes 640 UPDATING for these systems, as tool updating is taken care of 641 by the new build system. 642 64320011028: 644 src/etc/Makefile now needs install to be able to handle 645 symlinks that point to nowhere. A bug in install that 646 prevented this was corrected. 647 648 Solution: update and reinstall usr.bin/xinstall 649 Better Solution: Use the new toolchain and it will just work 650 for you. 651 65220011006: 653 /etc/mtree/NetBSD.dist has been updated to take advantage of 654 absolute path support added to mtree(8). Older mtree(8)s don't 655 understand the format. 656 657 Solution: update and reinstall usr.sbin/mtree 658 65920011004: 660 Crunchgen has been updated to work via reach-over makefiles. Updating 661 is suggested before running a snapshot build 662 66320010915: 664 The new "ubcperf" code committed by Chuck Silvers removed 665 a header file, uvm/uvm_vnode.h. There may be stale .depend 666 files that still reference this file. 667 668 Solution: "make cleandir && make dependall" in affected 669 directories. 670 67120010803: 672 grep.info is now built from grep.texi using makeinfo. Since it 673 requires makeinfo v4.0, you need to install new texinfo before 674 building gnu/usr.bin/grep. To install new texinfo, please follow 675 the instruction described in 20010726 entry. 676 67720010803: 678 (i386 only): i386 kernel now uses new instructions like 679 `fxsave' which old gas doesn't understand. To build the 680 kernel successfully, you need to build and install a new toolchain, 681 (i.e., build.sh -t) or (temporarily) comment out "options I686_CPU" 682 from your kernel configuration until you rebuild your userland. 683 See 20011029 above and BUILDING file in this directory for more information. 684 [updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled] 685 68620010731: 687 Bootloader update on ELF platforms. DDB in kernels from before 688 this will be unable to read symbol tables provided by newer 689 bootloaders. 690 69120010726: 692 Texinfo was updated to 4.0. To avoid failures when trying to 693 build the included texinfo files, do: 694 695 cd src/gnu/usr.bin/texinfo 696 make MKINFO=no dependall install 697 69820010718: 699 Enabled correct .init/.fini processing in crt0. The way this 700 was done was to change a -I directive to cc(1), which means 701 make(1) will have a stale dependency (it will be checking the 702 timestamp on the wrong "dot_init.h"). 703 704 The symptom you will see is that new programs die with SIGSEGV 705 if you have a stale dependency. 706 707 Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so 708 before starting your build. 709 71020010628: 711 A construct was added to uvm_page.h that uncovered a bug 712 in lint(1). If you get a warning/error about a non-portable 713 bitfield, update your lint(1) before proceeding. 714 71520010226: 716 Added named user/group to system. Need to hand add this in or builds 717 will break as mtree aborts early. 718 719 To work around add by hand: 720 721 named:*:14: 722 723 to /etc/group and add: 724 725 named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin 726 727 to master.passwd (use vipw for instance if doing by hand). 728 729 Now a make build should progress. 730 73120010219: 732 get/setprogname() added. Any hostprogs that may use this will need 733 to be bootstrapped manually until the host system is current. 734 735 Known problems: sys/arch/macppc/stand/fixcoff 736 usr.sbin/config (adding -DMAKE_BOOTSTRAP to 737 CFLAGS and rebuilding should work) 738 usr.sbin/mdsetimage - Build a static copy if 739 building a snapshot before fully bootstrapped. 740 74120010204: 742 prepare the code to compile with stricter gcc flags. in 743 particular start eliminating redundant declarations. Yacc 744 needs to be installed before make build. 745 74620010114: 747 introduce .if commands(target) in make(1). You need to 748 bring everything up-to-date first, then without installing 749 anything make and install in usr.bin/make, then proceed 750 with make build. 751 75220010101: 753 bsd.subdir.mk committed 20001230 had a bug which caused 754 afterinstall targets to run too soon; update again. 755 75620001230: 757 New share/mk files needed to support .WAIT in SUBDIR variables. 758 If you get make errors, 759 (cd share/mk; make install) 760 Also, PRINTOBJDIR has changed and is now used more heavily. 761 76220001019: 763 The `ca' device driver has been replaced by `ld'; although the 764 major and minor numbers haven't changed, you should update your /dev 765 directory. 766 76720000929: 768 The following make directives are obsoleted. 769 MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 770 By default, RSA is built into libcrypto. IDEA and RC5 will not be 771 built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build 772 additional library libcrypto_{idea,rc5}. 773 774 775Hints for a more successful build: 776^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 777 Use build.sh, but do not use its "expert mode": 778 This will automatically build the tools in the 779 correct order, and it will keep the tools and the 780 new build products from interfering with the running 781 system. This will allow you to ignore most of the 782 other advice in this file. 783 Build a new kernel first: 784 This makes sure that any new system calls or features 785 expected by the new userland will be present. This 786 helps to avoid critical errors when upgrading. 787 Use object directories: 788 This helps to keep stale object 789 files from polluting the build if a Makefile "forgets" 790 about one. It also makes it easier to clean up after 791 a build. It's also necessary if you want to use the 792 same source tree for multiple machines. 793 To use object directories with build.sh: 794 a) invoke build.sh with the "-M" or "-O" options. 795 To use object directories without using build.sh: 796 a) cd /usr/src ; make cleandir 797 b) Add "OBJMACHINE=yes" to /etc/mk.conf 798 c) Add "MKOBJDIRS=yes" to /etc/mk.conf 799 d) cd /usr/src ; make build 800 Note that running "make obj" in a directory will create 801 in obj.$MACHINE directory. 802 Build to a DESTDIR: 803 This helps to keep old installed files (especially libraries) 804 from interfering with the new build. 805 To build to a DESTDIR with build.sh, use the "-D" option. 806 To build to a DESTDIR without using build.sh, set the DESTDIR 807 environment variable before running make build. It should be 808 set to the pathname of an initially empty directory. 809 Problems: if you do not use build.sh, you might need to 810 update critical utilities without using DESTDIR since 811 nothing is executed from what is installed in DESTDIR. 812 (See critical utils, below.) 813 Build often: 814 This keeps critical utilities current enough to not choke 815 on any other part of the source tree that depends on up to 816 date functionality. If you use build.sh, you should not have 817 this problem. 818 819What to do if things don't work: 820^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 821When things don't work there is usually a few things that commonly 822should be done. 823 1) make includes 824 This should be done automatically by make build. 825 2) cd share/mk && make install 826 Again, automatically done by make build. 827 828Failsafe rebuild of a small part of the tree: 829^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 830To make sure you rebuild something correctly you want to do 831something like the following: 832 1) Make sure the includes and .mk files are up to date. 833 2) Make sure any program used to build the particular 834 utility is up to date. (yacc, lex, etc...) 835 3) cd ...path/to/util... 836 make cleandir 837 rm ...all obj directories... 838 make cleandir # yes, again 839 make obj 840 make depend && make 841 842Failsafe rebuild of the entire tree: 843^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 844If you really want to make sure the source tree is clean and 845ready for a build try the following. Note that sourcing /etc/mk.conf 846(a make(1) Makefile) in this manner is not right, and will not work 847for anyone who uses any make(1) features in /etc/mk.conf. 848 849---cut here--- 850#!/bin/sh 851. /etc/mk.conf 852 853if [ -z $NETBSDSRCDIR ] ; then 854 NETBSDSRCDIR=/usr/src 855fi 856if [ \! -d $NETBSDSRCDIR ] ; then 857 echo Unable to find sources 858 exit 1 859fi 860find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \; 861 862if [ -z $BSDOBJDIR ] ; then 863 BSDOBJDIR=/usr/obj 864fi 865if [ -d $BSDOBJDIR ] ; then 866 rm -rf $BSDOBJDIR 867fi 868 869cd $NETBSDSRCDIR && make cleandir 870 871---cut here--- 872 873Critical utilities: 874^^^^^^^^^^^^^^^^^^^ 875 usr.bin/compile_et 876 usr.bin/make 877 usr.bin/yacc 878 usr.bin/lex 879 usr.bin/xlint 880 usr.bin/config 881 882Other problems and possible solutions: 883^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 884Symptom:Complaints involving a Makefile. 885Fix: Rebuild usr.bin/make: 886 cd usr.bin/make && make && make install 887 Or, a failsafe method if that doesn't work: 888 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin 889 890Fix: Make sure .mk files are up to date. 891 cd share/mk && make install 892 893Symptom:Kernel `config' fails to configure any kernel, including GENERIC. 894Fix: Rebuild usr.bin/config 895 896Symptom: 897Fix: Rebuild usr.bin/yacc 898 899Symptom: 900Fix: Rebuild usr.bin/lex 901 902Symptom: 903Fix: rm /usr/lib/libbfd.a 904 905Symptom:Obsolete intermediate files are used during compilation 906Fix: Try the following sequence of commands in the directory in question. 907 make cleandir; rm `make print-objdir`; make cleandir; make obj 908 (If you built the tree without "make obj" in the past, obsolete files 909 may remain. The command tries to clean everything up) 910 911Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type 912Fix: Rebuild and install usr.bin/menuc 913 914Symptom:mklocale not found during build in share/locale/ctype 915Fix: Build and install usr.bin/mklocale 916 917Symptom:undefined reference to `__assert13' or `__unsetenv13' 918Fix: Rebuild and install lib/libc 919 920Symptom:usr.bin/config fails to build. 921Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile. 922 923Symptom:undefined reference to `getprogname' or `setprogname' 924Fix: Rebuild and install lib/libc 925 926Symptom:lint does not understand the '-X' option 927Fix: May need to build & install libs with NOLINT=1 before rebuilding lint 928