Home | History | Annotate | Line # | Download | only in src
UPDATING revision 1.62
      1 $NetBSD: UPDATING,v 1.62 2002/05/18 15:44:18 jdolecek 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 20020515:
     12 	sshd user/group has been added.  Need to hand add this in, or sshd
     13 	will not let you log in (with default, or UsePrivlegeSeparation=yes)
     14 
     15 	Add the following into /etc/group:
     16 
     17 	sshd:*:16:
     18 
     19 	and the following to /etc/master.passwd (via vipw):
     20 
     21 	sshd:*:16:16::0:0:sshd privsep:/var/empty:/sbin/nologin
     22 	
     23 	also /var/chroot/sshd directory needs to be present (digged as a part of
     24 	build process).
     25 
     26 20020426:
     27 	NBUILDJOBS obsoleted in favor of just using -j.
     28 
     29 20020426:
     30 	etc/postinstall added, which performs various checks for 
     31 	configuration file updates and changes, and can fix most of
     32 	the problems identified.
     33 	This should make it much easier to upgrade a system's
     34 	configuration from earlier systems (as far back as NetBSD 1.5).
     35 
     36 20020320:
     37 	<bsd.lib.mk> needs a new install(1) for it's "-a cmd" support.
     38 	build and install at usr.bin/xinstall before the build.
     39 
     40 20020319:
     41 	raw IPv6 socket now makes strict checking for sa_family and sa_len
     42 	on send(2) operation.  be sure to have sbin/rtsol and usr.sbin/rtsold
     43 	newer than November 2001 when you upgrade the kernel.
     44 
     45 20020311:
     46 	ssh configuration files were moved from /etc to /etc/ssh.  Beware
     47 	if you restart your machine from remote.  Note that sshd.conf needs
     48 	to be changed (due to the use of "/etc" inside).
     49 
     50 20020223:
     51 	Users of the VAX port will need to rebuild and install gas
     52 	so it deal with the now present register prefix used in all
     53 	the VAX assembly files.
     54 
     55 20020118:
     56 
     57 	ntpd user/group has been added.  Need to hand add this in or builds
     58 	will break as mtree aborts early.
     59 
     60 	Add the following into /etc/group:
     61 
     62 	ntpd:*:15:
     63 
     64 	and the following to /etc/master.passwd (via vipw):
     65 
     66 	ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
     67 
     68 20011207:
     69 
     70 	If you're attempting to build a snapshot on sparc64 and are getting
     71 	reloc errors from the toolchain groff binary this means your native
     72 	toolchain has some broken C++ bits.
     73 
     74 	To fix:
     75 
     76 	Build a new toolchain (i.e. build.sh -t)
     77 	Use the new toolchain to build and install natively (i.e. /usr/lib)
     78 
     79 	gnu/lib/libgcc
     80 	gnu/lib/libstdc++
     81 
     82 	After this a snapshot will be able to be built.
     83 
     84 20011201:
     85 	In order for a sparc64 build to work you must have a working awk. If
     86 	you've built and installed a system with the new toolchain up to this
     87 	point you do not have a working awk as its ability to do floating
     88 	point is broken. 
     89 
     90 	To build:
     91 
     92 	remake and install gnu/lib/libgcc
     93 	remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
     94 	against the new libgcc.a)
     95 
     96 20011128:
     97 	Kernel config information was changed to use defflag in
     98 	the various "files" files.  Bug fixes to config(8) are
     99 	required in order for this to work properly.  Make sure
    100 	to build and install in usr.sbin/config before attempting
    101 	to build a new kernel.
    102 
    103 20011030:
    104 	libc/locale/wcstod.c now needs new lint(1). Update lint(1)
    105 	before building libc.
    106 
    107 20011029:
    108 	The new document BUILDING.mdoc (view with nroff | more, or
    109 	see pre-generated .txt and .html versions) describes the build
    110 	procedure in great detail.  BUILDING, and the USE_NEW_TOOLCHAIN
    111 	build process, are intended in the long run to replace this
    112 	manual update log.
    113 
    114 	Users building a USE_NEW_TOOLCHAIN system should read the
    115 	BUILDING document for caveats.  Generally, BUILDING supersedes
    116 	UPDATING for these systems, as tool updating is taken care of
    117 	by the new build system.
    118 
    119 20011028:
    120 	src/etc/Makefile now needs install to be able to handle
    121 	symlinks that point to nowhere. A bug in install that
    122 	prevented this was corrected.
    123 
    124 	Solution: update and reinstall usr.bin/xinstall
    125 	Better Solution: Use the new toolchain and it will just work
    126 	for you.
    127 
    128 20011006:
    129 	/etc/mtree/NetBSD.dist has been updated to take advantage of
    130 	absolute path support added to mtree(8). Older mtree(8)s don't
    131 	understand the format.
    132 
    133 	Solution: update and reinstall usr.sbin/mtree
    134 
    135 20011004:
    136 	Crunchgen has been updated to work via reach-over makefiles. Updating
    137 	is suggested before running a snapshot build
    138 
    139 20010915:
    140 	The new "ubcperf" code committed by Chuck Silvers removed
    141 	a header file, uvm/uvm_vnode.h.  There may be stale .depend
    142 	files that still reference this file.
    143 
    144 	Solution: "make cleandir && make dependall" in affected
    145 	directories.
    146 
    147 20010803:
    148 	grep.info is now built from grep.texi using makeinfo.  Since it
    149 	requires makeinfo v4.0, you need to install new texinfo before
    150 	building gnu/usr.bin/grep.  To install new texinfo, please follow
    151 	the instruction described in 20010726 entry.
    152 
    153 20010803:
    154 	(i386 only): i386 kernel now uses new instructions like
    155         `fxsave' which old gas doesn't understand.  To build the
    156 	kernel successfully, you need to build and install new gas
    157 	(gnu/usr.bin/gas.new), or (temporarily) comment out
    158 	"options I686_CPU" from your kernel configuration until you
    159 	rebuilt your userland (and got a new gas).
    160 
    161 20010731:
    162 	Bootloader update on ELF platforms.  DDB in kernels from before
    163 	this will be unable to read symbol tables provided by newer
    164 	bootloaders.
    165 
    166 20010726:
    167 	Texinfo was updated to 4.0.  To avoid failures when trying to
    168 	build the included texinfo files, do:
    169 
    170 	cd src/gnu/usr.bin/texinfo
    171 	make MKINFO=no dependall install
    172 
    173 20010718:
    174 	Enabled correct .init/.fini processing in crt0.  The way this
    175 	was done was to change a -I directive to cc(1), which means
    176 	make(1) will have a stale dependency (it will be checking the
    177 	timestamp on the wrong "dot_init.h").
    178 
    179 	The symptom you will see is that new programs die with SIGSEGV
    180 	if you have a stale dependency.
    181 
    182 	Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
    183 	before starting your build.
    184 
    185 20010628:
    186 	A construct was added to uvm_page.h that uncovered a bug
    187 	in lint(1).  If you get a warning/error about a non-portable
    188 	bitfield, update your lint(1) before proceeding.
    189 
    190 20010226:
    191 	Added named user/group to system. Need to hand add this in or builds
    192 	will break as mtree aborts early.
    193 
    194 	To work around add by hand:
    195 
    196 	named:*:14:
    197 
    198 	to /etc/group and add:
    199 
    200 	named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
    201 
    202 	to master.passwd (use vipw for instance if doing by hand).
    203 
    204 	Now a make build should progress.
    205 
    206 20010219:
    207 	get/setprogname() added. Any hostprogs that may use this will need
    208         to be bootstrapped manually until the host system is current.
    209 
    210         Known problems: sys/arch/macppc/stand/fixcoff
    211 			usr.sbin/config (adding -DMAKE_BOOTSTRAP to
    212 			  CFLAGS and rebuilding should work)
    213 			usr.sbin/mdsetimage - Build a static copy if
    214   		          building a snapshot before fully bootstrapped.
    215 
    216 20010204:
    217 	prepare the code to compile with stricter gcc flags. in
    218 	particular start eliminating redundant declarations. Yacc
    219 	needs to be installed before make build.
    220 
    221 20010114:
    222 	introduce .if commands(target) in make(1). You need to
    223 	bring everything up-to-date first, then without installing
    224 	anything make and install in usr.bin/make, then proceed
    225 	with make build.
    226 
    227 20010101:
    228 	bsd.subdir.mk committed 20001230 had a bug which caused
    229 	afterinstall targets to run too soon; update again.
    230 
    231 20001230:
    232 	New share/mk files needed to support .WAIT in SUBDIR variables.
    233 	If you get make errors, 
    234 		(cd share/mk; make install)
    235 	Also, PRINTOBJDIR has changed and is now used more heavily.
    236 
    237 20001019:
    238 	The `ca' device driver has been replaced by `ld'; although the
    239 	major and minor numbers haven't changed, you should update your /dev
    240 	directory.
    241 
    242 20000929:
    243 	The following make directives are obsoleted.
    244 	MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 
    245 	By default, RSA is built into libcrypto.  IDEA and RC5 will not be
    246 	built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
    247 	additional library libcrypto_{idea,rc5}.
    248 
    249 
    250 Hints for a more successful build:
    251 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    252     Build a new kernel first:
    253 	This makes sure that any new system calls or features
    254 	   expected by the new userland will be present.  This
    255 	   helps to avoid critical errors when upgrading.
    256     Use object directories:
    257 	This helps to keep stale object
    258 	   files from polluting the build if a Makefile "forgets"
    259 	   about one.  It also makes it easier to clean up after
    260 	   a build.  It's also necessary if you want to use the
    261 	   same source tree for multiple machines.
    262 	   To use object directories:
    263 	    a) cd /usr/src ; make cleandir
    264 	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
    265 	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
    266 	    d) cd /usr/src ; make build
    267 	   Note that running "make obj" in a directory will create
    268 	   in obj.$MACHINE directory.
    269     Build to a DESTDIR:
    270 	This helps to keep old
    271 	   installed files (especially libraries) from interfering
    272 	   with the new build.
    273 	   To build to a DESTDIR, set the DESTDIR environment
    274 	   variable before running make build.  It should be set to
    275 	   the pathname of an initially empty directory.
    276 	   Problems: you might need to update critical utilities
    277 		without using DESTDIR since nothing is executed
    278 		from what is installed in DESTDIR.
    279 		(See critical utils, below)
    280     Build often:
    281 	This keeps critical utilities current enough to not choke
    282 	on any other part of the source tree that depends on up to
    283 	date functionality.
    284  
    285 What to do if things don't work:
    286 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    287 When things don't work there is usually a few things that commonly
    288 should be done.
    289     1)	make includes
    290 	This should be done automatically by make build.
    291     2)  cd share/mk && make install
    292 	Again, automatically done by make build.
    293 
    294 Failsafe rebuild of a small part of the tree:
    295 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    296 To make sure you rebuild something correctly you want to do
    297 something like the following:
    298     1)  Make sure the includes and .mk files are up to date.
    299     2)  Make sure any program used to build the particular
    300 	utility is up to date.  (yacc, lex, etc...)
    301     3)  cd ...path/to/util...
    302 	make cleandir
    303 	rm ...all obj directories...
    304 	make cleandir			# yes, again
    305 	make obj
    306 	make depend && make
    307 
    308 Failsafe rebuild of the entire tree:
    309 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    310 If you really want to make sure the source tree is clean and
    311 ready for a build try the following.  Note that sourcing /etc/mk.conf
    312 (a make(1) Makefile) in this manner is not right, and will not work
    313 for anyone who uses any make(1) features in /etc/mk.conf.
    314 
    315 ---cut here---
    316 #!/bin/sh
    317 . /etc/mk.conf
    318 
    319 if [ -z $NETBSDSRCDIR ] ; then
    320     NETBSDSRCDIR=/usr/src
    321 fi
    322 if [ \! -d $NETBSDSRCDIR ] ; then
    323     echo Unable to find sources
    324     exit 1
    325 fi
    326 find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
    327 
    328 if [ -z $BSDOBJDIR ] ; then
    329     BSDOBJDIR=/usr/obj
    330 fi
    331 if [ -d $BSDOBJDIR ] ; then
    332     rm -rf $BSDOBJDIR
    333 fi
    334 
    335 cd $NETBSDSRCDIR && make cleandir
    336 
    337 ---cut here---
    338 
    339 Critical utilities:
    340 ^^^^^^^^^^^^^^^^^^^
    341 	gnu/usr.bin/egcs
    342 	usr.bin/compile_et
    343 	usr.bin/make
    344 	usr.bin/yacc
    345 	usr.bin/lex
    346 	usr.bin/xlint
    347 	usr.sbin/config
    348 
    349 Other problems and possible solutions:
    350 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    351 Symptom:Unreasonable compiler errors.
    352 Fix:	Rebuild gnu/usr.bin/egcs
    353 
    354 Symptom:Complaints involving a Makefile.
    355 Fix:	Rebuild usr.bin/make:
    356 	cd usr.bin/make && make && make install
    357         Or, a failsafe method if that doesn't work:
    358 	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
    359 
    360 Fix:	Make sure .mk files are up to date.
    361 	cd share/mk && make install
    362 
    363 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
    364 Fix:	Rebuild usr.sbin/config
    365 
    366 Symptom:
    367 Fix:	Rebuild usr.bin/yacc
    368 
    369 Symptom:
    370 Fix:	Rebuild usr.bin/lex
    371 
    372 Symptom:
    373 Fix:	rm /usr/lib/libbfd.a
    374 
    375 Symptom:Obsolete intermediate files are used during compilation
    376 Fix:	Try the following sequence of commands in the directory in question.
    377 	make cleandir; rm `make print-objdir`; make cleandir; make obj
    378 	(If you built the tree without "make obj" in the past, obsolete files
    379 	may remain.  The command tries to clean everything up)
    380 
    381 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
    382 Fix:	Rebuild and install usr.bin/menuc
    383 
    384 Symptom:mklocale not found during build in share/locale/ctype
    385 Fix:	Build and install usr.bin/mklocale
    386 
    387 Symptom:undefined reference to `__assert13'
    388 Fix:    Rebuild and install lib/libc
    389 
    390 Symptom:usr.sbin/config fails to build.
    391 Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
    392 
    393 Symptom:undefined reference to `getprogname' or `setprogname'
    394 Fix:    Rebuild and install lib/libc
    395 
    396 Symptom:lint does not understand the '-X' option
    397 Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
    398