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