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