UPDATING revision 1.113
1$NetBSD: UPDATING,v 1.113 2004/03/18 11:03:57 dan Exp $ 2 3This file is intended to be a brief introduction to the build 4process and a reference on what to do if something doesn't work. 5 6For a more detailed description see Makefile. 7 8Recent changes: 9^^^^^^^^^^^^^^^ 10 1120040318: 12 A bug in the cgd(4) blowfish code was corrected, without 13 provision of backwards compatibility, after several public 14 notices over several months. Users of cgd with blowfish cipher 15 ONLY must dump their data before updating their kernels, and 16 recreate cgd's and restore data using the new kernel. See 17 (recent message to current-users, URL when mail-index has updated) 18 1920040313: 20 On acorn32, the opms and qms drivers have been withdrawn, and 21 the old wsqms driver is now called qms. Kernel config files 22 will need updating. See the ones in sys/arch/acorn32/conf 23 for examples. 24 2520040125: 26 On acorn32, the beep and sysbeep devices are no longer 27 needed, and will need to be deleted from kernel configuration 28 files. 29 3020040109: 31 Compatibility for old ffs superblock layouts has been 32 added, and the restrictive fsck checks have been reenabled 33 when using those layouts. If you have been using -current 34 since 20030402, you may find that fsck again signals fatal 35 superblock mismatches. To repair, make sure you have 36 an updated fsck_ffs and then you can use fsck_ffs -b 16 -c 4 37 to complete the filesystem upgrade. A message has 38 been added to the kernel which should detect this problem. 39 See the following discussion for more information: 40 http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html 41 4220031203: 43 New binutils builds may fail due to old dependencies. 44 It's necessary to "make cleandir" to ensure that 45 the dependencies will be rebuilt correctly. 46 4720031111: 48 A newer mkdep is needed. Error noting that is 49 cc: Ambiguous abbreviation -- 50 5120031008: 52 /usr/include/sys/disklabel_mbr.h was removed. 53 It's necessary to "make cleandir" to ensure that 54 the dependencies will be rebuilt correctly. 55 5620031007: 57 A sign exension bug was fixed which set all the high bits 58 of our newly expanded ffs fs_flags. This should only 59 affect users who installed or upgraded in September of 2003. 60 A small utility program was posted to tech-kern which 61 should fix this problem, and a warning message was added 62 to the kernel which should discover and warn about it. See 63 http://mail-index.NetBSD.org/tech-kern/2003/10/07/0005.html 64 6520030906: 66 With the addition of siginfo support the old signal trampoline 67 code has been deprecated to COMPAT_16. Make sure that your running 68 kernel has COMPAT_16 enabled before building userland. 69 7020030801: 71 With the new openssl, there is some header and library shuffling. 72 rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \ 73 /usr/lib/libdes* before building. 74 7520030703: 76 Texinfo was updated to 4.6. To avoid failures when trying to 77 build the included texinfo files, do: 78 79 cd src/gnu/usr.bin/texinfo 80 make MKINFO=no dependall install 81 8220030630: 83 Groff was updated to 1.19; it's probably necessary to do 84 cd share/mk && make install 85 cd src/gnu/usr.bin/groff 86 make MKMAN=no dependall install 87 (untested). 88 8920030516: 90 Due to bugs in the export handling code, invalid export lines 91 were accepted before and caused the kernel to panic when 92 mountd got restarted because it freed memory that had already 93 been freed. This has been fixed and the kernel checks 94 export addresses very strictly. If you upgrade your kernel, 95 make sure you also upgrade mountd, because if your export 96 file contains lines with an old inet4 address syntax (i.e. 97 a.b.c or a.b or a), they will get rejected by the new kernel. 98 9920030402: 100 The superblock layout for FFS was changed. If you have 1.6 101 fsck binaries, they will signal a fatal superblock mismatch 102 with the first alternate, because they compare too many 103 fields (even ones that aren't useful). If possible, upgrade 104 your fsck_ffs binary before using a new kernel. 105 None of this signals actual filesystem damage. 106 10720030324: 108 sendmail version 8.12.8 was imported. Since sendmail is 109 now setgid to the smmsp group, and runs in "collection" 110 mode for most common activities, there is a new config 111 file called submit.cf that needs to live in /etc/mail. 112 The generic submit.cf sample in /usr/share/sendmail/cf 113 is named netbsd-msp.cf. Upgrading your regular sendmail 114 configuration file is also strongly advised. 115 116 See the section named "MESSAGE SUBMISSION PROGRAM" in 117 the updated /usr/share/sendmail/README file for more 118 information. 119 12020030117: 121 Texinfo was updated to 4.3. To avoid failures when trying to 122 build the included texinfo files, do: 123 124 cd src/gnu/usr.bin/texinfo 125 make MKINFO=no dependall install 126 12720021223: 128 The METALOG format changed slightly, to remove the leading 129 "${DESTDIR}" from path names. 130 This only affects people building with UNPRIVED. 131 For complete safety, remove the DESTDIR entirely and 132 update tools/mtree, before running make build. 133 13420021219: 135 CVS repository layout was changed. See the following for details 136 if you are using (anonymous) cvs to update your tree. 137 138 http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html 139 14020021219: 141 install(1) had a '-N dbdir' option added, to specify an 142 alternate location to look up users & groups (instead 143 of the host system passwd(5) and group(5) databases). 144 145 The build system was modified to take advantage of 146 this option (using ${NETBSDSRCDIR}/etc), so if you 147 use USETOOLS==no, you may have to rebuild and 148 reinstall usr.bin/xinstall first. 149 15020021130: 151 fparseln(3) moved from libutil to libc. 152 If building to DESTDIR=/, reinstall the includes 153 and rebuild libc: 154 make includes 155 make do-lib-libc 156 If using build.sh, "cd tools/compat && make clean" 157 before rebuilding the tools. 158 15920021126: 160 The mk.conf(5) variable SYS_INCLUDE has been deprecated, 161 including the optional "SYS_INCLUDE=symlinks" support. 162 All header files, including <sys/*.h> are copied into 163 /usr/include. 164 16520021121: 166 The C run-time support files crtbegin.o and crtend.o 167 (and their companions crtbeginS.o and crtendS.o) were 168 split up, with new crti.o and crtn.o files resulting. 169 This means that libtool needs to be rebuilt once the 170 new libraries are installed. The process of rebuilding 171 libtool will cause it to automatically notice the new 172 required files, but it *must* be rebuilt in order to 173 do this. 174 175 An out-of-date libtool will result in shared libraries 176 which lack _init() and _fini() routines, which means that 177 their global contructors/destructors will not be invoked. 178 17920021121: 180 A bug related to how ARM ELF objects were tagged has been 181 corrected. 182 183 NetBSD ARM ELF uses the soft-VFP floating point model by 184 default. However, the assembler lacked support for marking 185 objects as using the VFP floating point format, and the 186 compiler was not properly passing the flag indicating "soft-VFP" 187 to the assembler. 188 189 Unfortunately, this means that the linker will now consider 190 old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be 191 incompatible with new (properly marked) objects. 192 193 The problem will only manifest itself if you attempt to compile 194 a new program using the fixed toolchain, and link that program 195 against old libraries which do not have the proper "softvfp" 196 markings. ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES 197 WILL CONTINUE TO WORK PROPERLY. 198 199 The only work-around for the problem is to recompile all of 200 the libraries on the system. The easiest way to do this for 201 system libraries is to install a binary snapshot; they are 202 generally available on releng.NetBSD.org. Any packages you 203 have installed which supply libraries will have to be recompiled 204 if you wish to link new programs against those libraries. 205 206 If you have questions about this matter, please contact 207 port-arm@NetBSD.org. 208 20920021011: 210 Systrace has been improved to support privilege elevation. 211 Updating the kernel requires the userland part of systrace 212 to be rebuilt. 213 21420021010: 215 The config(8) grammar was changed to allow options to register 216 dependencies on attributes, as well as other options. Users 217 must update and reinstall usr.sbin/config before building a new 218 kernel. 219 22020021009: 221 A new attribute dependency syntax was introduced to config(8), 222 which is now used by the SCSI configuration description. Users 223 must update and reinstall usr.sbin/config before building a new 224 kernel. 225 22620021003: 227 Several changes have been made to the autoconfiguration 228 framework. Users must update and reinstall usr.sbin/config 229 before building a new kernel. 230 23120021001: 232 The i386mp branch has been merged. To compile a kernel, users 233 will need to add the option 'cpu* at mainbus?' to their configuration 234 file. Multiprocessor kernels will need 235 ioapic* at mainbus? apid ? 236 options MULTIPROCESSOR 237 options COM_MPLOCK 238 23920020922: 240 MKDYNAMICROOT=yes enabled by default, which means that 241 certain shared libraries are installed into /lib, the shared 242 linker is installed into /libexec, and all programs in /bin 243 and /sbin are dynamically linked. 244 If you do not use "make build", you should ensure that 245 you have the libraries and shared linker in the new locations, 246 with: 247 make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so 248 24920020917: 250 USE_NEW_TOOLCHAIN has been replaced with: 251 - TOOLCHAIN_MISSING -- set to "yes" on platforms for which 252 there is no working in-tree toolchain (hppa, ns32k, sh5, 253 x86_64). 254 - EXTERNAL_TOOLCHAIN -- if defined by the user, points to the 255 root of an external toolchain (e.g. /usr/local/gnu). This 256 enables the cross-build framework even for TOOLCHAIN_MISSING 257 platforms. 258 25920020906: 260 gehenna-devsw has been merged into the trunk. Need to update and 261 reinstall usr.sbin/config before building the kernel. 262 26320020822: 264 Crunched rescue tools (contents of /bin and /sbin, plus others) 265 are now provided in /rescue. 266 267 To ensure that these are built statically linked (no matter 268 what the setting of LDSTATIC is), use a crunchgen(1) built 269 from sources newer than 20020820 (see the next entry). 270 27120020820: 272 crunchgen(1) changed to ensure that the generated program 273 is statically linked. 274 275 Solution: update and reinstall usr.bin/crunch 276 27720020605: 278 smmsp user/group has been added for sendmail. 279 280 Add the following into /etc/group: 281 282 smmsp:*:17: 283 284 and the following to /etc/master.passwd (via vipw): 285 286 smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin 287 28820020515: 289 sshd user/group has been added. Need to hand add this in, or sshd 290 will not let you log in (with default, or UsePrivlegeSeparation=yes) 291 292 Add the following into /etc/group: 293 294 sshd:*:16: 295 296 and the following to /etc/master.passwd (via vipw): 297 298 sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin 299 300 Also /var/chroot/sshd directory needs to be present (digged as part of 301 the build process). 302 30320020426: 304 NBUILDJOBS obsoleted in favor of just using -j. 305 30620020426: 307 etc/postinstall added, which performs various checks for 308 configuration file updates and changes, and can fix most of 309 the problems identified. 310 This should make it much easier to upgrade a system's 311 configuration from earlier systems (as far back as NetBSD 1.5). 312 31320020320: 314 <bsd.lib.mk> needs a new install(1) for its "-a cmd" support. 315 Build and install at usr.bin/xinstall before the build. 316 31720020319: 318 Raw IPv6 socket now makes strict checking for sa_family and sa_len 319 on send(2) operation. Be sure to have sbin/rtsol and usr.sbin/rtsold 320 newer than November 2001 when you upgrade the kernel. 321 32220020311: 323 ssh configuration files were moved from /etc to /etc/ssh. Beware 324 if you restart your machine from remote. Note that sshd.conf needs 325 to be changed (due to the use of "/etc" inside). 326 32720020223: 328 Users of the VAX port will need to rebuild and install gas 329 so it deal with the now present register prefix used in all 330 the VAX assembly files. 331 33220020118: 333 ntpd user/group has been added. Need to hand add this in or builds 334 will break as mtree aborts early. 335 336 Add the following into /etc/group: 337 338 ntpd:*:15: 339 340 and the following to /etc/master.passwd (via vipw): 341 342 ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin 343 34420011207: 345 If you're attempting to build a snapshot on sparc64 and are getting 346 reloc errors from the toolchain groff binary this means your native 347 toolchain has some broken C++ bits. 348 349 To fix: 350 351 Build a new toolchain (i.e. build.sh -t) 352 Use the new toolchain to build and install natively (i.e. /usr/lib) 353 354 gnu/lib/libgcc 355 gnu/lib/libstdc++ 356 357 After this a snapshot will be able to be built. 358 35920011201: 360 In order for a sparc64 build to work you must have a working awk. If 361 you've built and installed a system with the new toolchain up to this 362 point you do not have a working awk as its ability to do floating 363 point is broken. 364 365 To build: 366 367 remake and install gnu/lib/libgcc 368 remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links 369 against the new libgcc.a) 370 37120011128: 372 Kernel config information was changed to use defflag in 373 the various "files" files. Bug fixes to config(8) are 374 required in order for this to work properly. Make sure 375 to build and install in usr.sbin/config before attempting 376 to build a new kernel. 377 37820011030: 379 libc/locale/wcstod.c now needs new lint(1). Update lint(1) 380 before building libc. 381 38220011029: 383 The new document BUILDING.mdoc (view with nroff | more, or 384 see pre-generated .txt and .html versions) describes the build 385 procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN 386 build process, are intended in the long run to replace this 387 manual update log. 388 389 Users building a USE_NEW_TOOLCHAIN system should read the 390 BUILDING document for caveats. Generally, BUILDING supersedes 391 UPDATING for these systems, as tool updating is taken care of 392 by the new build system. 393 39420011028: 395 src/etc/Makefile now needs install to be able to handle 396 symlinks that point to nowhere. A bug in install that 397 prevented this was corrected. 398 399 Solution: update and reinstall usr.bin/xinstall 400 Better Solution: Use the new toolchain and it will just work 401 for you. 402 40320011006: 404 /etc/mtree/NetBSD.dist has been updated to take advantage of 405 absolute path support added to mtree(8). Older mtree(8)s don't 406 understand the format. 407 408 Solution: update and reinstall usr.sbin/mtree 409 41020011004: 411 Crunchgen has been updated to work via reach-over makefiles. Updating 412 is suggested before running a snapshot build 413 41420010915: 415 The new "ubcperf" code committed by Chuck Silvers removed 416 a header file, uvm/uvm_vnode.h. There may be stale .depend 417 files that still reference this file. 418 419 Solution: "make cleandir && make dependall" in affected 420 directories. 421 42220010803: 423 grep.info is now built from grep.texi using makeinfo. Since it 424 requires makeinfo v4.0, you need to install new texinfo before 425 building gnu/usr.bin/grep. To install new texinfo, please follow 426 the instruction described in 20010726 entry. 427 42820010803: 429 (i386 only): i386 kernel now uses new instructions like 430 `fxsave' which old gas doesn't understand. To build the 431 kernel successfully, you need to build and install a new toolchain, 432 (i.e., build.sh -t) or (temporarily) comment out "options I686_CPU" 433 from your kernel configuration until you rebuild your userland. 434 See 20011029 above and BUILDING file in this directory for more information. 435 [updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled] 436 43720010731: 438 Bootloader update on ELF platforms. DDB in kernels from before 439 this will be unable to read symbol tables provided by newer 440 bootloaders. 441 44220010726: 443 Texinfo was updated to 4.0. To avoid failures when trying to 444 build the included texinfo files, do: 445 446 cd src/gnu/usr.bin/texinfo 447 make MKINFO=no dependall install 448 44920010718: 450 Enabled correct .init/.fini processing in crt0. The way this 451 was done was to change a -I directive to cc(1), which means 452 make(1) will have a stale dependency (it will be checking the 453 timestamp on the wrong "dot_init.h"). 454 455 The symptom you will see is that new programs die with SIGSEGV 456 if you have a stale dependency. 457 458 Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so 459 before starting your build. 460 46120010628: 462 A construct was added to uvm_page.h that uncovered a bug 463 in lint(1). If you get a warning/error about a non-portable 464 bitfield, update your lint(1) before proceeding. 465 46620010226: 467 Added named user/group to system. Need to hand add this in or builds 468 will break as mtree aborts early. 469 470 To work around add by hand: 471 472 named:*:14: 473 474 to /etc/group and add: 475 476 named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin 477 478 to master.passwd (use vipw for instance if doing by hand). 479 480 Now a make build should progress. 481 48220010219: 483 get/setprogname() added. Any hostprogs that may use this will need 484 to be bootstrapped manually until the host system is current. 485 486 Known problems: sys/arch/macppc/stand/fixcoff 487 usr.sbin/config (adding -DMAKE_BOOTSTRAP to 488 CFLAGS and rebuilding should work) 489 usr.sbin/mdsetimage - Build a static copy if 490 building a snapshot before fully bootstrapped. 491 49220010204: 493 prepare the code to compile with stricter gcc flags. in 494 particular start eliminating redundant declarations. Yacc 495 needs to be installed before make build. 496 49720010114: 498 introduce .if commands(target) in make(1). You need to 499 bring everything up-to-date first, then without installing 500 anything make and install in usr.bin/make, then proceed 501 with make build. 502 50320010101: 504 bsd.subdir.mk committed 20001230 had a bug which caused 505 afterinstall targets to run too soon; update again. 506 50720001230: 508 New share/mk files needed to support .WAIT in SUBDIR variables. 509 If you get make errors, 510 (cd share/mk; make install) 511 Also, PRINTOBJDIR has changed and is now used more heavily. 512 51320001019: 514 The `ca' device driver has been replaced by `ld'; although the 515 major and minor numbers haven't changed, you should update your /dev 516 directory. 517 51820000929: 519 The following make directives are obsoleted. 520 MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 521 By default, RSA is built into libcrypto. IDEA and RC5 will not be 522 built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build 523 additional library libcrypto_{idea,rc5}. 524 525 526Hints for a more successful build: 527^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 528 Build a new kernel first: 529 This makes sure that any new system calls or features 530 expected by the new userland will be present. This 531 helps to avoid critical errors when upgrading. 532 Use object directories: 533 This helps to keep stale object 534 files from polluting the build if a Makefile "forgets" 535 about one. It also makes it easier to clean up after 536 a build. It's also necessary if you want to use the 537 same source tree for multiple machines. 538 To use object directories: 539 a) cd /usr/src ; make cleandir 540 b) Add "OBJMACHINE=yes" to /etc/mk.conf 541 c) Add "MKOBJDIRS=yes" to /etc/mk.conf 542 d) cd /usr/src ; make build 543 Note that running "make obj" in a directory will create 544 in obj.$MACHINE directory. 545 Build to a DESTDIR: 546 This helps to keep old 547 installed files (especially libraries) from interfering 548 with the new build. 549 To build to a DESTDIR, set the DESTDIR environment 550 variable before running make build. It should be set to 551 the pathname of an initially empty directory. 552 Problems: you might need to update critical utilities 553 without using DESTDIR since nothing is executed 554 from what is installed in DESTDIR. 555 (See critical utils, below) 556 Build often: 557 This keeps critical utilities current enough to not choke 558 on any other part of the source tree that depends on up to 559 date functionality. 560 561What to do if things don't work: 562^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 563When things don't work there is usually a few things that commonly 564should be done. 565 1) make includes 566 This should be done automatically by make build. 567 2) cd share/mk && make install 568 Again, automatically done by make build. 569 570Failsafe rebuild of a small part of the tree: 571^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 572To make sure you rebuild something correctly you want to do 573something like the following: 574 1) Make sure the includes and .mk files are up to date. 575 2) Make sure any program used to build the particular 576 utility is up to date. (yacc, lex, etc...) 577 3) cd ...path/to/util... 578 make cleandir 579 rm ...all obj directories... 580 make cleandir # yes, again 581 make obj 582 make depend && make 583 584Failsafe rebuild of the entire tree: 585^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 586If you really want to make sure the source tree is clean and 587ready for a build try the following. Note that sourcing /etc/mk.conf 588(a make(1) Makefile) in this manner is not right, and will not work 589for anyone who uses any make(1) features in /etc/mk.conf. 590 591---cut here--- 592#!/bin/sh 593. /etc/mk.conf 594 595if [ -z $NETBSDSRCDIR ] ; then 596 NETBSDSRCDIR=/usr/src 597fi 598if [ \! -d $NETBSDSRCDIR ] ; then 599 echo Unable to find sources 600 exit 1 601fi 602find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \; 603 604if [ -z $BSDOBJDIR ] ; then 605 BSDOBJDIR=/usr/obj 606fi 607if [ -d $BSDOBJDIR ] ; then 608 rm -rf $BSDOBJDIR 609fi 610 611cd $NETBSDSRCDIR && make cleandir 612 613---cut here--- 614 615Critical utilities: 616^^^^^^^^^^^^^^^^^^^ 617 gnu/usr.bin/egcs 618 usr.bin/compile_et 619 usr.bin/make 620 usr.bin/yacc 621 usr.bin/lex 622 usr.bin/xlint 623 usr.sbin/config 624 625Other problems and possible solutions: 626^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 627Symptom:Unreasonable compiler errors. 628Fix: Rebuild gnu/usr.bin/egcs 629 630Symptom:Complaints involving a Makefile. 631Fix: Rebuild usr.bin/make: 632 cd usr.bin/make && make && make install 633 Or, a failsafe method if that doesn't work: 634 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin 635 636Fix: Make sure .mk files are up to date. 637 cd share/mk && make install 638 639Symptom:Kernel `config' fails to configure any kernel, including GENERIC. 640Fix: Rebuild usr.sbin/config 641 642Symptom: 643Fix: Rebuild usr.bin/yacc 644 645Symptom: 646Fix: Rebuild usr.bin/lex 647 648Symptom: 649Fix: rm /usr/lib/libbfd.a 650 651Symptom:Obsolete intermediate files are used during compilation 652Fix: Try the following sequence of commands in the directory in question. 653 make cleandir; rm `make print-objdir`; make cleandir; make obj 654 (If you built the tree without "make obj" in the past, obsolete files 655 may remain. The command tries to clean everything up) 656 657Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type 658Fix: Rebuild and install usr.bin/menuc 659 660Symptom:mklocale not found during build in share/locale/ctype 661Fix: Build and install usr.bin/mklocale 662 663Symptom:undefined reference to `__assert13' or `__unsetenv13' 664Fix: Rebuild and install lib/libc 665 666Symptom:usr.sbin/config fails to build. 667Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile. 668 669Symptom:undefined reference to `getprogname' or `setprogname' 670Fix: Rebuild and install lib/libc 671 672Symptom:lint does not understand the '-X' option 673Fix: May need to build & install libs with NOLINT=1 before rebuilding lint 674