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