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