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