UPDATING revision 1.104 1 $NetBSD: UPDATING,v 1.104 2004/01/12 16:19:19 dbj Exp $
2
3 This file is intended to be a brief introduction to the build
4 process and a reference on what to do if something doesn't work.
5
6 For a more detailed description see Makefile.
7
8 Recent changes:
9 ^^^^^^^^^^^^^^^
10
11 20040109:
12 Compatibility for old ffs superblock layouts has been
13 added, and the restrictive fsck checks have been reenabled
14 when using those layouts. If you have been using -current
15 since 20030402, you may find that fsck again signals fatal
16 superblock mismatches. To work around, you can use
17 fsck_ffs -b 32 -c 4 to restore an alternate superblock
18 and complete the filesystem upgrade.
19
20 20031203:
21 New binutils builds may fail due to old dependencies.
22 It's necessary to "make cleandir" to ensure that
23 the dependencies will be rebuilt correctly.
24
25 20031111:
26 A newer mkdep is needed. Error noting that is
27 cc: Ambiguous abbreviation --
28
29 20031008:
30 /usr/include/sys/disklabel_mbr.h was removed.
31 It's necessary to "make cleandir" to ensure that
32 the dependencies will be rebuilt correctly.
33
34 20030906:
35 With the addition of siginfo support the old signal trampoline
36 code has been deprecated to COMPAT_16. Make sure that your running
37 kernel has COMPAT_16 enabled before building userland.
38
39 20030801:
40 With the new openssl, there is some header and library shuffling.
41 rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \
42 /usr/lib/libdes* before building.
43
44 20030703:
45 Texinfo was updated to 4.6. To avoid failures when trying to
46 build the included texinfo files, do:
47
48 cd src/gnu/usr.bin/texinfo
49 make MKINFO=no dependall install
50
51 20030630:
52 Groff was updated to 1.19; it's probably necessary to do
53 cd share/mk && make install
54 cd src/gnu/usr.bin/groff
55 make MKMAN=no dependall install
56 (untested).
57
58 20030516:
59 Due to bugs in the export handling code, invalid export lines
60 were accepted before and caused the kernel to panic when
61 mountd got restarted because it freed memory that had already
62 been freed. This has been fixed and the kernel checks
63 export addresses very strictly. If you upgrade your kernel,
64 make sure you also upgrade mountd, because if your export
65 file contains lines with an old inet4 address syntax (i.e.
66 a.b.c or a.b or a), they will get rejected by the new kernel.
67
68 20030402:
69 The superblock layout for FFS was changed. If you have 1.6
70 fsck binaries, they will signal a fatal superblock mismatch
71 with the first alternate, because they compare too many
72 fields (even ones that aren't useful). If possible, upgrade
73 your fsck_ffs binary before using a new kernel.
74 None of this signals actual filesystem damage.
75
76 20030324:
77 sendmail version 8.12.8 was imported. Since sendmail is
78 now setgid to the smmsp group, and runs in "collection"
79 mode for most common activities, there is a new config
80 file called submit.cf that needs to live in /etc/mail.
81 The generic submit.cf sample in /usr/share/sendmail/cf
82 is named netbsd-msp.cf. Upgrading your regular sendmail
83 configuration file is also strongly advised.
84
85 See the section named "MESSAGE SUBMISSION PROGRAM" in
86 the updated /usr/share/sendmail/README file for more
87 information.
88
89 20030117:
90 Texinfo was updated to 4.3. To avoid failures when trying to
91 build the included texinfo files, do:
92
93 cd src/gnu/usr.bin/texinfo
94 make MKINFO=no dependall install
95
96 20021223:
97 The METALOG format changed slightly, to remove the leading
98 "${DESTDIR}" from path names.
99 This only affects people building with UNPRIVED.
100 For complete safety, remove the DESTDIR entirely and
101 update tools/mtree, before running make build.
102
103 20021219:
104 CVS repository layout was changed. See the following for details
105 if you are using (anonymous) cvs to update your tree.
106
107 http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html
108
109 20021219:
110 install(1) had a '-N dbdir' option added, to specify an
111 alternate location to look up users & groups (instead
112 of the host system passwd(5) and group(5) databases).
113
114 The build system was modified to take advantage of
115 this option (using ${NETBSDSRCDIR}/etc), so if you
116 use USETOOLS==no, you may have to rebuild and
117 reinstall usr.bin/xinstall first.
118
119 20021130:
120 fparseln(3) moved from libutil to libc.
121 If building to DESTDIR=/, reinstall the includes
122 and rebuild libc:
123 make includes
124 make do-lib-libc
125 If using build.sh, "cd tools/compat && make clean"
126 before rebuilding the tools.
127
128 20021126:
129 The mk.conf(5) variable SYS_INCLUDE has been deprecated,
130 including the optional "SYS_INCLUDE=symlinks" support.
131 All header files, including <sys/*.h> are copied into
132 /usr/include.
133
134 20021121:
135 The C run-time support files crtbegin.o and crtend.o
136 (and their companions crtbeginS.o and crtendS.o) were
137 split up, with new crti.o and crtn.o files resulting.
138 This means that libtool needs to be rebuilt once the
139 new libraries are installed. The process of rebuilding
140 libtool will cause it to automatically notice the new
141 required files, but it *must* be rebuilt in order to
142 do this.
143
144 An out-of-date libtool will result in shared libraries
145 which lack _init() and _fini() routines, which means that
146 their global contructors/destructors will not be invoked.
147
148 20021121:
149 A bug related to how ARM ELF objects were tagged has been
150 corrected.
151
152 NetBSD ARM ELF uses the soft-VFP floating point model by
153 default. However, the assembler lacked support for marking
154 objects as using the VFP floating point format, and the
155 compiler was not properly passing the flag indicating "soft-VFP"
156 to the assembler.
157
158 Unfortunately, this means that the linker will now consider
159 old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be
160 incompatible with new (properly marked) objects.
161
162 The problem will only manifest itself if you attempt to compile
163 a new program using the fixed toolchain, and link that program
164 against old libraries which do not have the proper "softvfp"
165 markings. ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES
166 WILL CONTINUE TO WORK PROPERLY.
167
168 The only work-around for the problem is to recompile all of
169 the libraries on the system. The easiest way to do this for
170 system libraries is to install a binary snapshot; they are
171 generally available on releng.NetBSD.org. Any packages you
172 have installed which supply libraries will have to be recompiled
173 if you wish to link new programs against those libraries.
174
175 If you have questions about this matter, please contact
176 port-arm (a] NetBSD.org.
177
178 20021011:
179 Systrace has been improved to support privilege elevation.
180 Updating the kernel requires the userland part of systrace
181 to be rebuilt.
182
183 20021010:
184 The config(8) grammar was changed to allow options to register
185 dependencies on attributes, as well as other options. Users
186 must update and reinstall usr.sbin/config before building a new
187 kernel.
188
189 20021009:
190 A new attribute dependency syntax was introduced to config(8),
191 which is now used by the SCSI configuration description. Users
192 must update and reinstall usr.sbin/config before building a new
193 kernel.
194
195 20021003:
196 Several changes have been made to the autoconfiguration
197 framework. Users must update and reinstall usr.sbin/config
198 before building a new kernel.
199
200 20021001:
201 The i386mp branch has been merged. To compile a kernel, users
202 will need to add the option 'cpu* at mainbus?' to their configuration
203 file. Multiprocessor kernels will need
204 ioapic* at mainbus? apid ?
205 options MULTIPROCESSOR
206 options COM_MPLOCK
207
208 20020922:
209 MKDYNAMICROOT=yes enabled by default, which means that
210 certain shared libraries are installed into /lib, the shared
211 linker is installed into /libexec, and all programs in /bin
212 and /sbin are dynamically linked.
213 If you do not use "make build", you should ensure that
214 you have the libraries and shared linker in the new locations,
215 with:
216 make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so
217
218 20020917:
219 USE_NEW_TOOLCHAIN has been replaced with:
220 - TOOLCHAIN_MISSING -- set to "yes" on platforms for which
221 there is no working in-tree toolchain (hppa, ns32k, sh5,
222 x86_64).
223 - EXTERNAL_TOOLCHAIN -- if defined by the user, points to the
224 root of an external toolchain (e.g. /usr/local/gnu). This
225 enables the cross-build framework even for TOOLCHAIN_MISSING
226 platforms.
227
228 20020906:
229 gehenna-devsw has been merged into the trunk. Need to update and
230 reinstall usr.sbin/config before building the kernel.
231
232 20020822:
233 Crunched rescue tools (contents of /bin and /sbin, plus others)
234 are now provided in /rescue.
235
236 To ensure that these are built statically linked (no matter
237 what the setting of LDSTATIC is), use a crunchgen(1) built
238 from sources newer than 20020820 (see the next entry).
239
240 20020820:
241 crunchgen(1) changed to ensure that the generated program
242 is statically linked.
243
244 Solution: update and reinstall usr.bin/crunch
245
246 20020605:
247 smmsp user/group has been added for sendmail.
248
249 Add the following into /etc/group:
250
251 smmsp:*:17:
252
253 and the following to /etc/master.passwd (via vipw):
254
255 smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin
256
257 20020515:
258 sshd user/group has been added. Need to hand add this in, or sshd
259 will not let you log in (with default, or UsePrivlegeSeparation=yes)
260
261 Add the following into /etc/group:
262
263 sshd:*:16:
264
265 and the following to /etc/master.passwd (via vipw):
266
267 sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin
268
269 Also /var/chroot/sshd directory needs to be present (digged as part of
270 the build process).
271
272 20020426:
273 NBUILDJOBS obsoleted in favor of just using -j.
274
275 20020426:
276 etc/postinstall added, which performs various checks for
277 configuration file updates and changes, and can fix most of
278 the problems identified.
279 This should make it much easier to upgrade a system's
280 configuration from earlier systems (as far back as NetBSD 1.5).
281
282 20020320:
283 <bsd.lib.mk> needs a new install(1) for its "-a cmd" support.
284 Build and install at usr.bin/xinstall before the build.
285
286 20020319:
287 Raw IPv6 socket now makes strict checking for sa_family and sa_len
288 on send(2) operation. Be sure to have sbin/rtsol and usr.sbin/rtsold
289 newer than November 2001 when you upgrade the kernel.
290
291 20020311:
292 ssh configuration files were moved from /etc to /etc/ssh. Beware
293 if you restart your machine from remote. Note that sshd.conf needs
294 to be changed (due to the use of "/etc" inside).
295
296 20020223:
297 Users of the VAX port will need to rebuild and install gas
298 so it deal with the now present register prefix used in all
299 the VAX assembly files.
300
301 20020118:
302 ntpd user/group has been added. Need to hand add this in or builds
303 will break as mtree aborts early.
304
305 Add the following into /etc/group:
306
307 ntpd:*:15:
308
309 and the following to /etc/master.passwd (via vipw):
310
311 ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
312
313 20011207:
314 If you're attempting to build a snapshot on sparc64 and are getting
315 reloc errors from the toolchain groff binary this means your native
316 toolchain has some broken C++ bits.
317
318 To fix:
319
320 Build a new toolchain (i.e. build.sh -t)
321 Use the new toolchain to build and install natively (i.e. /usr/lib)
322
323 gnu/lib/libgcc
324 gnu/lib/libstdc++
325
326 After this a snapshot will be able to be built.
327
328 20011201:
329 In order for a sparc64 build to work you must have a working awk. If
330 you've built and installed a system with the new toolchain up to this
331 point you do not have a working awk as its ability to do floating
332 point is broken.
333
334 To build:
335
336 remake and install gnu/lib/libgcc
337 remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
338 against the new libgcc.a)
339
340 20011128:
341 Kernel config information was changed to use defflag in
342 the various "files" files. Bug fixes to config(8) are
343 required in order for this to work properly. Make sure
344 to build and install in usr.sbin/config before attempting
345 to build a new kernel.
346
347 20011030:
348 libc/locale/wcstod.c now needs new lint(1). Update lint(1)
349 before building libc.
350
351 20011029:
352 The new document BUILDING.mdoc (view with nroff | more, or
353 see pre-generated .txt and .html versions) describes the build
354 procedure in great detail. BUILDING, and the USE_NEW_TOOLCHAIN
355 build process, are intended in the long run to replace this
356 manual update log.
357
358 Users building a USE_NEW_TOOLCHAIN system should read the
359 BUILDING document for caveats. Generally, BUILDING supersedes
360 UPDATING for these systems, as tool updating is taken care of
361 by the new build system.
362
363 20011028:
364 src/etc/Makefile now needs install to be able to handle
365 symlinks that point to nowhere. A bug in install that
366 prevented this was corrected.
367
368 Solution: update and reinstall usr.bin/xinstall
369 Better Solution: Use the new toolchain and it will just work
370 for you.
371
372 20011006:
373 /etc/mtree/NetBSD.dist has been updated to take advantage of
374 absolute path support added to mtree(8). Older mtree(8)s don't
375 understand the format.
376
377 Solution: update and reinstall usr.sbin/mtree
378
379 20011004:
380 Crunchgen has been updated to work via reach-over makefiles. Updating
381 is suggested before running a snapshot build
382
383 20010915:
384 The new "ubcperf" code committed by Chuck Silvers removed
385 a header file, uvm/uvm_vnode.h. There may be stale .depend
386 files that still reference this file.
387
388 Solution: "make cleandir && make dependall" in affected
389 directories.
390
391 20010803:
392 grep.info is now built from grep.texi using makeinfo. Since it
393 requires makeinfo v4.0, you need to install new texinfo before
394 building gnu/usr.bin/grep. To install new texinfo, please follow
395 the instruction described in 20010726 entry.
396
397 20010803:
398 (i386 only): i386 kernel now uses new instructions like
399 `fxsave' which old gas doesn't understand. To build the
400 kernel successfully, you need to build and install a new toolchain,
401 (i.e., build.sh -t) or (temporarily) comment out "options I686_CPU"
402 from your kernel configuration until you rebuild your userland.
403 See 20011029 above and BUILDING file in this directory for more information.
404 [updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled]
405
406 20010731:
407 Bootloader update on ELF platforms. DDB in kernels from before
408 this will be unable to read symbol tables provided by newer
409 bootloaders.
410
411 20010726:
412 Texinfo was updated to 4.0. To avoid failures when trying to
413 build the included texinfo files, do:
414
415 cd src/gnu/usr.bin/texinfo
416 make MKINFO=no dependall install
417
418 20010718:
419 Enabled correct .init/.fini processing in crt0. The way this
420 was done was to change a -I directive to cc(1), which means
421 make(1) will have a stale dependency (it will be checking the
422 timestamp on the wrong "dot_init.h").
423
424 The symptom you will see is that new programs die with SIGSEGV
425 if you have a stale dependency.
426
427 Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
428 before starting your build.
429
430 20010628:
431 A construct was added to uvm_page.h that uncovered a bug
432 in lint(1). If you get a warning/error about a non-portable
433 bitfield, update your lint(1) before proceeding.
434
435 20010226:
436 Added named user/group to system. Need to hand add this in or builds
437 will break as mtree aborts early.
438
439 To work around add by hand:
440
441 named:*:14:
442
443 to /etc/group and add:
444
445 named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
446
447 to master.passwd (use vipw for instance if doing by hand).
448
449 Now a make build should progress.
450
451 20010219:
452 get/setprogname() added. Any hostprogs that may use this will need
453 to be bootstrapped manually until the host system is current.
454
455 Known problems: sys/arch/macppc/stand/fixcoff
456 usr.sbin/config (adding -DMAKE_BOOTSTRAP to
457 CFLAGS and rebuilding should work)
458 usr.sbin/mdsetimage - Build a static copy if
459 building a snapshot before fully bootstrapped.
460
461 20010204:
462 prepare the code to compile with stricter gcc flags. in
463 particular start eliminating redundant declarations. Yacc
464 needs to be installed before make build.
465
466 20010114:
467 introduce .if commands(target) in make(1). You need to
468 bring everything up-to-date first, then without installing
469 anything make and install in usr.bin/make, then proceed
470 with make build.
471
472 20010101:
473 bsd.subdir.mk committed 20001230 had a bug which caused
474 afterinstall targets to run too soon; update again.
475
476 20001230:
477 New share/mk files needed to support .WAIT in SUBDIR variables.
478 If you get make errors,
479 (cd share/mk; make install)
480 Also, PRINTOBJDIR has changed and is now used more heavily.
481
482 20001019:
483 The `ca' device driver has been replaced by `ld'; although the
484 major and minor numbers haven't changed, you should update your /dev
485 directory.
486
487 20000929:
488 The following make directives are obsoleted.
489 MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
490 By default, RSA is built into libcrypto. IDEA and RC5 will not be
491 built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build
492 additional library libcrypto_{idea,rc5}.
493
494
495 Hints for a more successful build:
496 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
497 Build a new kernel first:
498 This makes sure that any new system calls or features
499 expected by the new userland will be present. This
500 helps to avoid critical errors when upgrading.
501 Use object directories:
502 This helps to keep stale object
503 files from polluting the build if a Makefile "forgets"
504 about one. It also makes it easier to clean up after
505 a build. It's also necessary if you want to use the
506 same source tree for multiple machines.
507 To use object directories:
508 a) cd /usr/src ; make cleandir
509 b) Add "OBJMACHINE=yes" to /etc/mk.conf
510 c) Add "MKOBJDIRS=yes" to /etc/mk.conf
511 d) cd /usr/src ; make build
512 Note that running "make obj" in a directory will create
513 in obj.$MACHINE directory.
514 Build to a DESTDIR:
515 This helps to keep old
516 installed files (especially libraries) from interfering
517 with the new build.
518 To build to a DESTDIR, set the DESTDIR environment
519 variable before running make build. It should be set to
520 the pathname of an initially empty directory.
521 Problems: you might need to update critical utilities
522 without using DESTDIR since nothing is executed
523 from what is installed in DESTDIR.
524 (See critical utils, below)
525 Build often:
526 This keeps critical utilities current enough to not choke
527 on any other part of the source tree that depends on up to
528 date functionality.
529
530 What to do if things don't work:
531 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
532 When things don't work there is usually a few things that commonly
533 should be done.
534 1) make includes
535 This should be done automatically by make build.
536 2) cd share/mk && make install
537 Again, automatically done by make build.
538
539 Failsafe rebuild of a small part of the tree:
540 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
541 To make sure you rebuild something correctly you want to do
542 something like the following:
543 1) Make sure the includes and .mk files are up to date.
544 2) Make sure any program used to build the particular
545 utility is up to date. (yacc, lex, etc...)
546 3) cd ...path/to/util...
547 make cleandir
548 rm ...all obj directories...
549 make cleandir # yes, again
550 make obj
551 make depend && make
552
553 Failsafe rebuild of the entire tree:
554 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
555 If you really want to make sure the source tree is clean and
556 ready for a build try the following. Note that sourcing /etc/mk.conf
557 (a make(1) Makefile) in this manner is not right, and will not work
558 for anyone who uses any make(1) features in /etc/mk.conf.
559
560 ---cut here---
561 #!/bin/sh
562 . /etc/mk.conf
563
564 if [ -z $NETBSDSRCDIR ] ; then
565 NETBSDSRCDIR=/usr/src
566 fi
567 if [ \! -d $NETBSDSRCDIR ] ; then
568 echo Unable to find sources
569 exit 1
570 fi
571 find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
572
573 if [ -z $BSDOBJDIR ] ; then
574 BSDOBJDIR=/usr/obj
575 fi
576 if [ -d $BSDOBJDIR ] ; then
577 rm -rf $BSDOBJDIR
578 fi
579
580 cd $NETBSDSRCDIR && make cleandir
581
582 ---cut here---
583
584 Critical utilities:
585 ^^^^^^^^^^^^^^^^^^^
586 gnu/usr.bin/egcs
587 usr.bin/compile_et
588 usr.bin/make
589 usr.bin/yacc
590 usr.bin/lex
591 usr.bin/xlint
592 usr.sbin/config
593
594 Other problems and possible solutions:
595 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
596 Symptom:Unreasonable compiler errors.
597 Fix: Rebuild gnu/usr.bin/egcs
598
599 Symptom:Complaints involving a Makefile.
600 Fix: Rebuild usr.bin/make:
601 cd usr.bin/make && make && make install
602 Or, a failsafe method if that doesn't work:
603 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
604
605 Fix: Make sure .mk files are up to date.
606 cd share/mk && make install
607
608 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
609 Fix: Rebuild usr.sbin/config
610
611 Symptom:
612 Fix: Rebuild usr.bin/yacc
613
614 Symptom:
615 Fix: Rebuild usr.bin/lex
616
617 Symptom:
618 Fix: rm /usr/lib/libbfd.a
619
620 Symptom:Obsolete intermediate files are used during compilation
621 Fix: Try the following sequence of commands in the directory in question.
622 make cleandir; rm `make print-objdir`; make cleandir; make obj
623 (If you built the tree without "make obj" in the past, obsolete files
624 may remain. The command tries to clean everything up)
625
626 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
627 Fix: Rebuild and install usr.bin/menuc
628
629 Symptom:mklocale not found during build in share/locale/ctype
630 Fix: Build and install usr.bin/mklocale
631
632 Symptom:undefined reference to `__assert13' or `__unsetenv13'
633 Fix: Rebuild and install lib/libc
634
635 Symptom:usr.sbin/config fails to build.
636 Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
637
638 Symptom:undefined reference to `getprogname' or `setprogname'
639 Fix: Rebuild and install lib/libc
640
641 Symptom:lint does not understand the '-X' option
642 Fix: May need to build & install libs with NOLINT=1 before rebuilding lint
643