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