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