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