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