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