UPDATING revision 1.338 1 $NetBSD: UPDATING,v 1.338 2023/05/23 20:26:52 lukem 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 Sections are marked with "^^^^^". After the section on "Recent changes"
15 are several sections containing more general information.
16
17 See also: BUILDING, build.sh, Makefile.
18
19 Recent changes:
20 ^^^^^^^^^^^^^^^
21
22
23 20230523:
24 ctfmerge was fixed as macOS host tool. This may require a clean tools
25 rebuild to detect the update to tools/compat/configure.
26
27 20230322:
28 Fixes for moved /lib/libisns* mean that builds will complain about
29 ./usr/lib/libisns* being missing until src/lib/libisns is forced
30 to (re)install the files, including the symlinks. The simplest
31 way is to clean this subdir before building.
32
33 20230112:
34 New binutils require an updated ld.elf_so. If you are doing
35 (unsupported) in-place self builds (with the -E flag to build.sh),
36 make sure to have installed latest ld.elf_so before you rebuild
37 userland.
38
39 20221116:
40 The addition to NetBSD's version of UFS2 of support for extended
41 attributes broke backward compatibility with previous releases
42 of NetBSD, so UFS2 has been restored to being compatible with
43 previous NetBSD releases by disabling extended attributes.
44 (Note that ACLs are implemented as extended attributes, so
45 this changes disables ACLs as well.)
46
47 Support for UFS2 with extended attributes is now available in a new
48 UFS variant called UFS2ea. If you have created extended attributes
49 in an original UFS2 file system then "fsck -p" will now fail due to
50 the unexpected presence of extended attributes and "fsck -y" will
51 remove all extended attributes. If you wish to preserve extended
52 attributes rather than delete them, there is a utility to convert
53 a UFS2 file system to UFS2ea and leave extended attributes in place,
54 but this should be used with caution since it will preserve any
55 extended attributes that have been corrupted by the backward
56 incompatibility too.
57
58 If you wish to use a UFS2ea file system as your root file system,
59 then you will need to update your boot loader to a version that
60 supports UFS2ea.
61
62 For more information, see:
63 https://wiki.netbsd.org/features/UFS2ea
64
65 20221111:
66 The new libdrm import worsened the conflict issues for the
67 kdump/ktruss ioctl, and i915 now conflicts with base, and has
68 been turned off. This will cause update build issues like:
69
70 kdump-ioctl.c:12175:143: error: 'DRM_IOCTL_I915_DESTROY_HEAP'
71 undeclared here (not in a function);
72 did you mean 'DRM_IOCTL_MODE_DESTROY_DUMB'?
73
74 You'll need to clean usr.bin/ktruss, usr.bin/kdump, and rescue.
75
76 20220921:
77 Since the kernel version was bumped to 9.99.100, the bootloader
78 must be updated on x86 or EFI boot platforms in order to load
79 modules from boot.cfg(5) or interactively at the bootloader
80 prompt.
81
82 The kernel can still load modules at runtime, with modload(8)
83 or modules.conf(5), with no bootloader update. This will not
84 affect release branches because it only applies to patch
85 numbers >=100.
86
87 On x86 (i386 or amd64) with BIOS boot, this requires copying a
88 new /usr/mdec/boot to /boot. You can build this in the destdir
89 by running `$TOOLDIR/bin/nbmake-$ARCH dependall install' in
90 sys/arch/i386/stand.
91
92 On platforms with EFI boot (including x86 with EFI boot), this
93 requires copying a new /usr/mdec/boot*.efi to the EFI/BOOT/
94 directory on the EFI system partition. The boot*.efi file is:
95
96 aarch64 bootaa64.efi
97 amd64 bootx64.efi
98 arm bootarm.efi (32-bit arm)
99 i386 bootx32.efi
100
101 You can build this in the destdir by running
102 `$TOOLDIR/bin/nbmake-$ARCH dependall install' in
103 sys/stand/efiboot/boot*.
104
105 20220821:
106 Support for building extsrc/ has been deprecated.
107 EXTSRCSRCDIR and MKEXTSRC have been deprecated.
108
109 20220714:
110 Updates to xorg-server and associated drivers may cause builds to
111 fail. Cleaning both DESTDIR and the xorg build tree may be needed.
112
113 20220628:
114 Changes in the build of src/games/robots require a clean build
115 of that program.
116
117 20211116:
118 Changes in the xorg build require clean obj dirs for external/mit/xorg
119 (or a full clean/non-update build).
120
121 20211112:
122 Device tree sources were updated for evbarm. Some device nodes
123 (in particular, ld(4) devices on the ROCKPro64) will be renumbered.
124
125 20211014:
126 MKPIE default for aarch64 has changed, a clean build is required.
127
128 20210917:
129 Changed MNT_ACLS to default to POSIX1e ACLs instead of NFSv4
130 ACLs, to be compatible with FreeBSD. If you are using NFSv4 ACLs
131 and have "acls" in /etc/fstab you'll need to change it to "nfs4acls".
132
133 20210711:
134 Updated GMP sources may require cleaning in tools/gmp and/or in
135 external/lgpl3/gmp/lib, particularly if GCC itself does not build.
136
137 20210417:
138 GCC 10 was enabled for several platforms. If builds fail in either
139 tools/gcc or external/gpl/gcc, first try cleaning those objects and
140 removing the $DESTDIR/usr/include/g++ subdirectory.
141
142 20201230:
143 lint1/ops.c is no longer autogenerated. If this makes the build
144 fail, clean $OBJDIR/tools/*lint* and $OBJDIR/usr.bin/*xlint*.
145
146 20201016:
147 MIPS kernel modules have been disabled until they work. This will
148 turn up in extra files in the DESTDIR, which should be cleaned.
149
150 20200925:
151 GNU MPC and MPFR have been updated. At least MPFR needs cleaning
152 in both the tools and external dirs.
153
154 20200912:
155 GCC 9 has arrived for Arm and x86 platforms, and will be coming
156 for several more, as will binutils 2.34. Clean as required.
157
158 20200907:
159 GCC 9 is coming, and binutils has been updated for MIPS. This
160 probably requires cleaning the tools/binutils.
161
162 20200811:
163 GCC updates may require cleaning the objdir. This may occur
164 due to GCC 7.5 update, GCC 8.4 move to gcc.old, or the upcoming
165 GCC 9 upgrade.
166
167 20200614:
168 blacklist* has been renamed to blocklist*. postinstall(8)
169 should handle the migration.
170
171 20200601:
172 Due to a mistake in LIBISPRIVATE handling, .so libraries were
173 created in the build directories and need cleaning.
174
175 20200311:
176 GCC 8 ports will need cleaning in src/tools/gcc and
177 src/external/gpl3/gcc due to GCC 8.4 update.
178
179 20191118:
180 More architectures were switched to gcc8:
181 i386, ia64 powerpc64, sparc, sparc64, arm
182 The same comments as in 20191022 apply.
183
184 20191112:
185 The LLVM update requires a clean rebuild for all architectures using
186 LLVM during the tools build phase (i386, amd64, aarch64).
187
188 20191022:
189 Ports amd64 and aarch64 switched to GCC 8.3 by default.
190 In-place ("expert mode", build.sh -E) builds are not supported
191 when going from a GCC 7 userland to GCC 8. Do a regular
192 build to a different DESTDIR (or preferably: build.sh -U) at least
193 once and install sets, or download comp.{tar.xz,tgz} from the
194 daily builds and install that before doing the next in-place build.
195
196 20191001:
197 GCC 8.3 was imported. Builds of src/tools/gcc may fail if
198 old builds with GCC 7 output now uses GCC 8. Clean this
199 directory, and also clean src/external/gpl3/gcc.
200
201 20190903:
202 Files with names that coincide with existing files' names on
203 case-insensitive file systems were inadvertently committed, for
204 radeon GPU firmware. We cannot mark these as obsolete for
205 postinstall to fix, so if you updated src since 2019-08-26, and
206 ran build.sh distribution or ran build.sh release, you must
207 manually delete the following files in your DESTDIR (which is
208 usually $OBJDIR/destir.$ARCH), or from / if you have installed
209 them:
210
211 /libdata/firmware/radeon/bonaire_ce.bin
212 /libdata/firmware/radeon/bonaire_mc.bin
213 /libdata/firmware/radeon/bonaire_me.bin
214 /libdata/firmware/radeon/bonaire_mec.bin
215 /libdata/firmware/radeon/bonaire_pfp.bin
216 /libdata/firmware/radeon/bonaire_rlc.bin
217 /libdata/firmware/radeon/bonaire_sdma.bin
218 /libdata/firmware/radeon/bonaire_smc.bin
219 /libdata/firmware/radeon/bonaire_uvd.bin
220 /libdata/firmware/radeon/hainan_ce.bin
221 /libdata/firmware/radeon/hainan_mc.bin
222 /libdata/firmware/radeon/hainan_me.bin
223 /libdata/firmware/radeon/hainan_pfp.bin
224 /libdata/firmware/radeon/hainan_rlc.bin
225 /libdata/firmware/radeon/hainan_smc.bin
226 /libdata/firmware/radeon/hawaii_ce.bin
227 /libdata/firmware/radeon/hawaii_mc.bin
228 /libdata/firmware/radeon/hawaii_me.bin
229 /libdata/firmware/radeon/hawaii_mec.bin
230 /libdata/firmware/radeon/hawaii_pfp.bin
231 /libdata/firmware/radeon/hawaii_rlc.bin
232 /libdata/firmware/radeon/hawaii_sdma.bin
233 /libdata/firmware/radeon/hawaii_smc.bin
234 /libdata/firmware/radeon/kabini_ce.bin
235 /libdata/firmware/radeon/kabini_me.bin
236 /libdata/firmware/radeon/kabini_mec.bin
237 /libdata/firmware/radeon/kabini_pfp.bin
238 /libdata/firmware/radeon/kabini_rlc.bin
239 /libdata/firmware/radeon/kabini_sdma.bin
240 /libdata/firmware/radeon/kaveri_ce.bin
241 /libdata/firmware/radeon/kaveri_me.bin
242 /libdata/firmware/radeon/kaveri_mec.bin
243 /libdata/firmware/radeon/kaveri_mec2.bin
244 /libdata/firmware/radeon/kaveri_pfp.bin
245 /libdata/firmware/radeon/kaveri_rlc.bin
246 /libdata/firmware/radeon/kaveri_sdma.bin
247 /libdata/firmware/radeon/mullins_ce.bin
248 /libdata/firmware/radeon/mullins_me.bin
249 /libdata/firmware/radeon/mullins_mec.bin
250 /libdata/firmware/radeon/mullins_pfp.bin
251 /libdata/firmware/radeon/mullins_rlc.bin
252 /libdata/firmware/radeon/mullins_sdma.bin
253 /libdata/firmware/radeon/oland_ce.bin
254 /libdata/firmware/radeon/oland_mc.bin
255 /libdata/firmware/radeon/oland_me.bin
256 /libdata/firmware/radeon/oland_pfp.bin
257 /libdata/firmware/radeon/oland_rlc.bin
258 /libdata/firmware/radeon/oland_smc.bin
259 /libdata/firmware/radeon/pitcairn_ce.bin
260 /libdata/firmware/radeon/pitcairn_mc.bin
261 /libdata/firmware/radeon/pitcairn_me.bin
262 /libdata/firmware/radeon/pitcairn_pfp.bin
263 /libdata/firmware/radeon/pitcairn_rlc.bin
264 /libdata/firmware/radeon/pitcairn_smc.bin
265 /libdata/firmware/radeon/tahiti_ce.bin
266 /libdata/firmware/radeon/tahiti_mc.bin
267 /libdata/firmware/radeon/tahiti_me.bin
268 /libdata/firmware/radeon/tahiti_pfp.bin
269 /libdata/firmware/radeon/tahiti_rlc.bin
270 /libdata/firmware/radeon/tahiti_smc.bin
271 /libdata/firmware/radeon/verde_ce.bin
272 /libdata/firmware/radeon/verde_mc.bin
273 /libdata/firmware/radeon/verde_me.bin
274 /libdata/firmware/radeon/verde_pfp.bin
275 /libdata/firmware/radeon/verde_rlc.bin
276 /libdata/firmware/radeon/verde_smc.bin
277
278 We will re-import these radeon firmware images another way
279 later.
280
281 20190727:
282 The uefi bootloader has gained tftp support and needs a clean
283 build. If you do update builds, manually clean its object
284 directory by something like:
285 cd sys/arch/i386/stand/efiboot && make clean
286
287 20190723:
288 The jemalloc allocator in libc is now build without extended
289 debugging (for performance reasons). In update builds make sure
290 to rebuild it completely, by removing all affected object files,
291 including compat builds, something like:
292 cd /usr/obj && find . -type d -name jemalloc|xargs rm -rf
293
294 20190207:
295 GCC 7 switched for many ports. Update builds are likely to fail.
296
297 20180924:
298 A newer OpenSSL version has been imported. If you are doing
299 update builds, make sure to remove all old obj dirs, like:
300 cd /usr/obj && find . -type d -name openssl | xargs rm -rf
301
302 20180717:
303 On aarch64 int64_t and related types have changed from long long
304 to long. This requires recompiling all C++ binaries.
305
306 20180713:
307 On amd64 and i386 static binaries are now build position
308 independend. This requires recompilation of all object
309 files used to create the crunched /rescue binary.
310 Clean the rescue directory in your obj directory before
311 doing an update build, otherwise linking will fail.
312
313 20180414:
314 Existing binutils was migrated to binutils.old. Manual
315 removal of tools/binutils objects directory may be required
316 to fix tools build failure.
317
318 20180311:
319 bdftopcf was updated and may need cleaning in the
320 src/external/mit/xorg/tools/bdftopcf subdirectory if there are
321 link errors.
322
323 20180212:
324 between OpenSSL and GCC updates, many things may fail to build.
325 any failure that looks like GCC or openssl is best handled by
326 a clean destdir and objdir. Full cleandir and destdir deletion
327 is recommended if build failures occur.
328
329 20171225:
330 removal of the vadvise syscall requires manual removal of all
331 associated files from the libc build object directory (including
332 the .depend files) - a command like:
333 cd $OBJ && find . -type d -name libc | xargs rm -rf
334 For architectures that support multiple "compat" binary targets,
335 you'll need to cleanup both the regular libc directory and the
336 compat ones (the above command will do that).
337
338 20171010:
339 a change to the build structure of external/bsd/acpica/bin/iasl
340 means that its objdir (or *.d and .depend at least) might need
341 to be manually removed - or a build done once without -u.
342
343 20170822:
344 a new version of GMP has been imported and probably
345 will break parts of builds related to themselves or GCC, both
346 in the tools and the native section. Remove all GCC, GMP, MPFR
347 and MPC objdirs or build once without -u.
348
349 20170816:
350 a new version of MPFR and MPC have been imported and probably
351 will break parts of builds related to themselves or GCC, both
352 in the tools and the native section. Remove all GCC, GMP, MPFR
353 and MPC objdirs or build once without -u.
354
355 20170402:
356 a new version of dhcpcd has been imported, which does not support
357 update builds from the previous version. Remove your
358 external/bsd/dhcpcd object dir or build once without -u.
359
360 20170211:
361 a new terminfo database has been imported.
362 The structure of it has changed slightly from prior versions and
363 an updated tic tool is required.
364 If you build.sh, don't use -u
365
366 20170207:
367 various arch dependent libc/exect.S files were removed
368 Either remove the obj directories (lib/libc and compat/amd64/i386/lib
369 if it exists) or do a clean build.
370 (This is a bug in the make system, it should be corrected without
371 human intervention, but isn't.)
372
373 20170104:
374 xinput build options have changed.
375 Remove the obj directory (external/mit/xorg/bin/xinput)
376 if you build.sh -u
377
378 20170103:
379 a new version of flex has been imported.
380 Remove the file from obj (external/bsd/flex)
381 if you build.sh -u
382
383 20161014:
384 a new version of OpenSSL has been imported.
385 Remove the files from obj (crypto/external/bsd/openssl)
386 if you build.sh -u
387
388 20161009:
389 a new version of dhcpcd has been imported with slightly changed
390 build infrastructure. When doing a build.sh -u this requires
391 pruning the external/bsd/dhcpcd objdir.
392
393 20160914:
394 i386, amd64, shark, ofppc and macppc have joined shark and x68k
395 ports in using xorg-server 1.18. This requires a clean destdir
396 and a clean objdir.
397
398 20160527:
399 i386 needs a full cleandir or objdir deletion because PIE has
400 been enabled. (see the amd64 entry two down for further info)
401
402 20160418:
403 libedit needs manual removal of all autogenerated files since
404 some of them are not autogenerated anymore. Remember that there
405 might be two copies of libedit if your platform builds "compat".
406
407 20160410:
408 amd64 needs full "make cleandir" or deletion of objdir now that
409 PIE has been enabled for amd64. PIE, or position-independent
410 executables, means all code, including executables and not just
411 shared libraries, is position-independent and hence able to be
412 relocated by ASLR, address space layout randomization.
413
414 The change was made in Makefile variables for compiler and
415 linker flags, for which make(1) does not record dependencies,
416 hence it is unable to detect that all .o files need rebuilding.
417
418 Partial rebuilds with some modified source files will likely
419 fail when linking executables, since the linker refuses to mix
420 position-independent code with position-dependent code in
421 position-independent executables:
422
423 .../x86_64--netbsd/bin/ld: foo.o: relocation R_X86_64_32 against `...' cannot be used when making a shared object; recompile with -fPIC
424
425 20160401:
426 Ports switching to GCC 5.3 will need a full "make cleandir".
427 Some people have found that cleandir is not sufficient, so if
428 in doubt delete the entire object directory tree for gcc.
429
430 20160306:
431 NetBSD's regexp implementation is now part of libnbcompat.
432 Nblex, nbm4, nbpax, nbsed use it and they may crash on
433 non-NetBSD hosts if linked with stale object files produced
434 while they included a non-NetBSD regex.h.
435 In any case, you should "make cleandir" at least these tools
436 before updating your toolchain.
437
438 20160125:
439 Dtrace has been enabled by default on some architectures.
440 When doing an update build, make sure to clean the etc/mtree
441 object directory before starting the build - otherwise the
442 needed directories in destdir will not be created.
443 An easy way to do this is:
444 cd src/etc/mtree && $TOOLDIR/bin/nbmake-$arch cleandir
445
446 20150818:
447 New acpica requires "make cleandir" in src/external/bsd/acpica
448 again.
449
450 20150413:
451 New acpica requires "make cleandir" and reinstalling yacc
452 in /usr/src/external/bsd/byacc and /usr/src/tools/yacc and
453 also "make cleandir" in /usr/src/external/bsd/acpica.
454
455 20150404:
456 Lint changes require a full rebuild of the tool, so make
457 sure to build without -u option to build.sh, or manually
458 do a make cleandir in src/tools/lint1 and
459 src/usr.bin/xlint.
460
461 20150310:
462 Improvements to openssl for arm mean that update builds of
463 the openssl libraries will fail. A make cleandir in
464 external/bsd/openssl/lib is needed
465
466 20141026:
467 A mishap during the import of pppd may cause your corruption
468 in your cvs directory if you happened to do a cvs update
469 during a short period of time. To fix, just remove the
470 directory src/external/bsd/ppp/dist/pppd completely
471 and let cvs restore it on next update.
472
473 20140721:
474 The src/external/mit/lua/src directory was accidentally created
475 and then deleted in the CVS repository. If you get errors like
476
477 cvs [update aborted]: cannot open directory
478 /cvsroot/src/external/mit/lua/src: No such file or directory
479
480 then delete your local copy of that directory tree and try again.
481
482 20140530:
483 ARM eABI switched to DWARF based exception handling. This requires
484 rebuilding all C++ code. It is strongly advised to do a clean build.
485
486 20140131:
487 The new compiler_rt/libc integration moved a few things. It is strongly
488 advised to do a clean build. At least lib/libc, the compat version(s)
489 of libc, libkern, rump and the kernels need to be cleaned.
490
491 20131227:
492 1. The new ntpd runs in a restricted mode to prevent amplification
493 attacks. If you need ntpdc to work you need to explicitly enable
494 mode7 in your config file. Make sure you put the necessary restrict
495 statements to avoid being exposed.
496 2. strncat has moved from lib/libc to common/lib/libc; you might need
497 to make clean in libc
498
499 20131129:
500 The GMP sources were updated, and builds will likely fail without
501 cleaning their build trees for both tools and in-tree, like below.
502
503 20131128:
504 The MPC and MPFR sources were updated, and builds may require their
505 tools and in-tree directories cleaned for successful updates.
506
507 20130605:
508 The kernel option FAST_IPSEC no longer exists, it's been renamed
509 to IPSEC (and the older IPSEC version removed).
510
511 20130605:
512 Previous freetype installations erroneously installed private
513 header files. If you are building against a non-empty $DESTDIR,
514 please remove ${DESTDIR}//usr/X11R7/include/freetype2/freetype/.
515
516 20130531:
517 The xdm update may cause build failure due to xdm.man being
518 in the obj tree. Make sure to ensure any like this:
519 nbmake: nbmake: don't know how to make xdm.man. Stop
520 is fixed by deleting the xdm.man in the obj tree.
521
522 20130530:
523 Updates of many xsrc packages will leave old .pc files around.
524 Best to clean out the xsrc objdir entirely before rebuilds.
525
526 20130301:
527 The removal of netiso requires manual removal of /usr/include/netiso
528 prior to the build and make cleandir in /usr/src/usr.bin/{ktruss,kdump}
529
530 20120726:
531 The update of OpenSSL requires cleaning both the OpenSSL build
532 directory and DESTDIR. *Even non-update builds require cleaning
533 DESTDIR.* Builds done without taking these steps may fail, or in
534 some cases may succeed and install broken OpenSSL libraries that
535 cause third-party software to link incorrectly and/or crash.
536
537 20120507:
538 The database schema for makemandb was changed. You will
539 need to update the database using 'makemandb -f' or wait
540 for the next weekly run to fix it.
541
542 20120319:
543 sys/conf/Makefile.kern.inc has been modified to adjust the
544 size of db_symtab automatically. You need to update dbsym in
545 your $TOOLDIR to build kernels with options SYMTAB_SPACE. If
546 you don't want this behavior, add AUTO_SYMTAB_SPACE=no to your
547 mk.conf.
548
549 20120216:
550 Default for MKCATPAGES changed to NO. Update builds will fail
551 unless DESTDIR is cleaned manually. If you built between 20120207
552 and 20120216, daily and weekly could have created an unreadable
553 /var/db/man.db index for apropos. Running makemandb -f or
554 the next run of weekly will fix it.
555
556 20111227:
557 If you built between 20111225 and 20111227 you need to remove
558 /usr/lib/libpam.so.4* and /usr/lib/security/*.so.4, since the
559 bump has been reverted.
560
561 20111125:
562 The "rnd" pseudodevice has been added to sys/conf/std, which
563 means it should no longer be explicitly listed in kernel
564 configuration files. The line "pseudo-device rnd" should be
565 removed from any custom kernel config files users may have.
566
567 20111119:
568 A problem with the datastructures used by the rndctl(8)
569 utility (pointers in datastructures in an array, making 32->64
570 bit compatibility very painful) has been fixed in a
571 non-backwards-compatible way. If you replace your kernel,
572 replace your rndctl executable too.
573
574 20111001:
575 the prop_*_send_syscall() functions from proplib(3) have been
576 changed and their new version is not backward compatible with the old
577 one. So ensure that all consumers of these functions (currently:
578 quota2 code and its tests) are updated together with the new lib.
579
580 20110817:
581 sparc has been changed to use GCC 4.5.3, so any objdir or
582 DESTDIR for them should be deleted before updating.
583
584 20110806:
585 i386 and amd64 have been changed to use GCC 4.5.3, so any
586 objdir or DESTDIR for them should be deleted before updating.
587
588 20110805:
589 The update to GCC 4.5.3 requires a non-trivial portion of
590 the tree to be cleaned. Best to delete both objdir and
591 DESTDIR before running this update. So far, only the
592 sparc64, mips and powerpc platforms have changed.
593
594 20110803:
595 The layout of external/public-domain/xz has changed. To do an
596 update build you will have to remove the contents of the OBJDIR
597 for external/public-domain/xz/bin by hand as the xz entry there
598 is now a directory.
599
600 20110410:
601 The configuration of src/tools/gcc has changed. To do an
602 update build you have to clean both tools/binutils and
603 tools/gcc by hand.
604
605 20110328:
606 Building the Xorg binary was moved into a subdirectory to fix
607 ordering issues with "make all". It may be necessary to remove
608 the OBJDIR for external/mit/xorg/server/xorg-server/hw/xfree86
609 if your update build fails, as the "Xorg" entry there is now a
610 directory.
611
612 20110121:
613 Assembler files no longer use -traditional-cpp. This can break
614 the build of individual parts of the tree. This is handled
615 correctly by build.sh. Manual builds have to update /usr/share/mk
616 and re-run config(1) for any kernel configurations as needed.
617
618 20101217:
619 The tcpdump(8) program was changed to drop privileges and chroot(2)
620 by default. It may be necessary to manually update passwd(5) and
621 group(5) in order to make the program work with existing setups.
622
623 20101125:
624 The latest changes to setenv(3) disallow setting environment
625 variables with names that contain '='. Revision 1.18 of env.c
626 assumed that this was allowed. Installing a new libc with an
627 old copy of /usr/bin/env causes env x=1 printenv | grep x= to
628 break which affects the autoconf tests for dependency finding,
629 so building gcc will end up printing:
630 checking dependency style of gcc... none
631 configure: error: no usable dependency style found
632 Fix it by rebuilding and re-installing env.
633
634 20101119:
635 Recent Xorg updates in xsrc/external/mit/ may cause various build
636 or run-time problems. Delete your entire DESTDIR and OBJDIR if you
637 have any build problems with xsrc, or problems with mismatched
638 versions between xorg-server and drivers.
639
640 20100604:
641 The update of ATF to 0.9 causes old tests written in shell to fail
642 unless they are rebuilt. If you are building with MKUPDATE=yes,
643 you need to clean the src/external/bsd/atf/tests/ and the src/tests/
644 trees by hand.
645
646 20100522:
647 Recent Xorg updates in xsrc/external/mit/ will cause various build
648 problems. Delete your entire DESTDIR and OBJDIR if you have any
649 build problems with xsrc.
650
651 20100522:
652 private section of <ctype.h> was split, and now mklocale(1)
653 include ctype_local.h, so you have to make cleandir in tools/mklocale.
654
655 20100520:
656 The location of the xkb compiled descriptions has changed. Please
657 remove usr/X11R7/lib/X11/xkb/compiled from your $DESTDIR.
658
659 20100222:
660 The shared objects file extension has been changed from .so to
661 .pico, in order to avoid conflicts with shared libraries names
662 libXX.so. All now stale regular .so files can be removed from
663 your object directories.
664
665 20100204:
666 The termcap database has been removed from the sources,
667 but has not been marked obsolete so it is not removed
668 from the system when upgrading.
669 As such, you will need to remove them from your object
670 and destination directories.
671
672 20091101:
673 After updating, it may be necessary to make the 'cleandir'
674 target in src/tools/yacc/ and in src/usr.bin/yacc/ before a
675 'build.sh -u tools' or 'build.sh -u distribution'. Ditto
676 src/tools/lex/ and src/usr.bin/lex/.
677
678 20091001:
679 On amd64 you must rebuild tools (to get the new binutils)
680 before building a kernel, or the build fails on cpufunc.S.
681
682 20091001:
683 An error will create a ./usr/X11R7/lib/X11/xkb/compiled/xkb
684 symlink, failing the build. Delete the link, and the subdir
685 it is in, and retry your build.
686
687 20090718:
688 libc build changed so that strchr() provides the extra entry
689 point for index(). Update build of libc.a (and libc_pic.a)
690 may fail because the archive contains the unwanted index.o.
691 (Similarly for strrchr() and rindex().)
692
693 20090709:
694 Native Xorg was upgraded again. Builds will probably fail again
695 without a clean objdir, at least for src/external/mit/xorg.
696
697 20090616:
698 Native Xorg was upgraded. Builds will need a clean objdir for
699 src/external/mit/xorg. Upgrading a system from sets will not
700 work properly yet as the /usr/X11R7/lib/X11/xkb/symbols/pc
701 subdirectory has been changed into a file, and this needs to
702 be manually "rm -r"'ed before installing xbase.tgz.
703
704 20090501:
705 Several new functions were added to string.h/libc, and this
706 can cause autoconf problems during the tool build for people
707 who fail to clean out their tools objects properly. If you
708 note messages about stpcpy, stpncpy or strnlen accompanying a
709 failure during the tool build, clean out all your tools
710 objects and start again.
711
712 20090325:
713 The i386 port was switched to i486 default toolchain. This requires
714 cleaning your src/tools directory and $TOOLDIR and rebuilding them.
715
716 20090126:
717 The __posix_fadvise50 system call changed assembly stub type. You
718 need to 'rm -f __posix_fadvise50.*' in the libc build directory
719 to avoid using the old assembly stub.
720
721 20090202:
722 pkg_install now depends on the pkgdb cache for automatic conflict
723 detection. It is recommended to rebuild the cache with
724 ``pkg_admin rebuild''.
725
726 20090110:
727 time_t and dev_t have been bumped to 64 bit quantities. To upgrade:
728 1. Make sure your kernel has COMPAT_50 in it. Build and install.
729 This is needed even in the MODULAR kernel because there is
730 conditionally compiled code in rtsock.c.
731 2. make sure build.sh completes and the binaries in a chroot work
732 before installing.
733 3. If you don't use build.sh and you build directly to root, and
734 your build breaks in the middle, don't despair. Make sure headers
735 are installed properly, and start building libraries first libc
736 and libutil, install them and then continue building all the
737 libraries in src/lib and src/gnu/lib and install them. Once
738 the new libraries are installed, you can restart the build.
739 4. If you compile packages and you notice link time warnings,
740 rebuild the required packages to update their shared libraries.
741 Any package you rebuild will require rebuilding all the packages
742 that depend on it.
743 5. Next time you run pwd_mkdb with the new binary, the file
744 will be upgraded and it will not be backwards compatible.
745 6. The utmpx/wtmpx files (/var/run/utmpx and /var/log/wtmpx, see
746 lastlogx(5)) have been versioned, and there is a heuristic
747 for utmp. You are better off removing the old files after
748 upgrading. The automated clearing of /var/run during
749 boot, and the automated rotating of files in /var/log by
750 newsyslog(8), may mean that you do not have to remove the
751 files manually.
752 7. The optional accounting file (/var/account/acct, see
753 accton(8)) has not been versioned, and will need to be
754 removed. The automatic rotation of the accounting file by
755 /etc/daily limits the bad consequences of failure to remove
756 the file.
757 8. Application software that writes time_t to binary files on
758 disk will break or need attention. Most notably: if you are
759 using PostgreSQL < 8.4, you need to dump your databases,
760 rebuild PostgreSQL with the new time_t, then restore.
761
762 20081219:
763 config(1) has been updated, and one of the files it creates -
764 swapnetbsd.o - has changed format. You need to rebuild config
765 (done automatically by build.sh) and then you need to rerun
766 config on all kernel configuration files before rebuilding those
767 kernels.
768
769 20081205:
770 If you build with MKX11=no, you should remove /etc/rc.d/xdm and
771 /etc/rc.d/xfs from DESTDIR because those files were moved to the xetc
772 set and will appear as extra files for MKX11=no update builds.
773
774 20081122:
775 On i386, various kernel options(4) in GENERIC including
776 file systems have been disabled and moved into kernel modules.
777 Before trying a new GENERIC kernel, you have to prepare the
778 following files as well as a new GENERIC kernel:
779
780 - build and install kernel modules from src/sys/modules
781
782 - install the latest bootloader, which will load a module
783 for the file system from which the kernel is loaded automatically
784
785 If you have to load your kernel from a file system which is not of
786 the same type as the root file system, you have to load the necessary
787 file system module manually on the boot prompt or in the boot.cfg file.
788
789 20080827:
790 If you built and installed a libc from sources between
791 2008/08/20 and 2008/08/26 you got a broken strtouq(3)
792 which results in false errors reported by lint(1).
793 Since this breaks the libc build itself, manual help is
794 needed -- lint must be disabled temporarily, e.g.:
795 $ (cd lib/libc && make MKLINT=no dependall install)
796
797 20080813:
798 MKDEBUG build was broken because the .depend files did not know
799 about .go files. You need to remove all .depend files and rebuild.
800
801 20080802:
802 A regression in binary compatibility for pthread_mutex_t has
803 been fixed. Unfortunately, the price is breaking compatibility
804 for -current.
805
806 Threaded programs (using libpthread) and C++ programs (using
807 libstdc++) compiled after 20070907 and before 20080802 need to
808 be recompiled.
809
810 One way to find affected pkgsrc packages:
811
812 $ grep REQUIRES=/usr/lib/libpthread /var/db/pkg/*/+BUILD_INFO
813 $ grep REQUIRES=/usr/lib/libstdc++ /var/db/pkg/*/+BUILD_INFO
814
815 20080731:
816 WAPBL (metadata journaling support) has been added, but at this
817 time isn't backwards compatible with pre-WAPBL aware kernels
818 and userland (fsck_ffs in particular). Please make sure you
819 don't use a journaled filesystem with an older kernel/userland,
820 especially an uncleanly mounted journaled filesystem. WAPBL
821 also requires the super block to be in the UFS2 format. You
822 can use fsck_ffs -c 4 to update the superblock format.
823
824 20080721:
825 Assembler warnings are now fatal if $WARNS>0 and $NOGCCERROR
826 isn't defined.
827
828 20080531:
829 The ioctl number of DRVSUSPENDDEV command on /dev/drvctl changed
830 from 125 (conflicted with DRVCTLCOMMAND) to 129. The drvctl(8)
831 utility needs to be rebuilt and reinstalled as older binaries
832 won't work correctly. The following sequence of commands:
833
834 $ (cd sys/sys/ && nbmake-$arch includes)
835 $ (cd sbin/drvctl/ && nbmake-$arch clean)
836 $ (cd sbin/drvctl/ && nbmake-$arch all)
837
838 leaves new drvctl utility in sbin/drvctl build directory.
839
840 20080503:
841 The <bsd.lib.mk> variable MKPRIVATELIB was renamed to LIBISPRIVATE.
842
843 20080521:
844 For a while, unprivileged UPDATE builds would fail to
845 succeed at the checkflist stage, complaining that
846 ${DESTDIR}/stand/<arch>/ did not exist. A fix for this
847 problem was committed to share/mk/bsd.kmodule.mk, revision 1.9.
848 If you already hit this problem, update the .mk file,
849 remove ${DESTDIR}/stand/<arch>, and re-run the build.
850
851 20080303:
852 Linker warnings are now fatal if $WARNS>0.
853
854 20080126:
855 The posix_fadvise system call has been changed from an assembly
856 stub, to a c file that calls an assembly stub. You need to
857 'rm -f posix_fadvise.* .depend' in the libc build directory to
858 avoid using the old assembly stub.
859
860 20071209:
861 The acpiec(4) driver has been split into two attachments. If you
862 get ACPI errors before the attachment, please update your kernel
863 configuration file appropriately or see GENERIC for more details.
864
865 20071115:
866 The it(4) driver has been renamed to itesio(4) and the old port
867 argument specified in the kernel configuration file is not valid
868 anymore. The itesio(4) driver now uses the Super I/O address port
869 rather than the EC address port. Please update your kernel
870 configuration file appropriately or see GENERIC for more details.
871
872 20071028:
873 The pccons(4) driver has been removed from the NetBSD/shark port.
874 You need to update any custom kernel configuration file you have
875 to remove any references to pccons (which includes removing the
876 now useless XSERVER option) and replace them with the correct
877 entries for the wscons driver. See the GENERIC configuration file
878 for more details.
879
880 20070913:
881 A latent bug in dhclient/dhcpd that caused it to be unable to
882 enumerate interfaces was fixed. The bug began to cause
883 problems after 20070911 when the kernel's SIOCGIFCONF
884 implementation was repaired. From 20070529 to 20070911 racoon
885 could not enumerate interfaces. (These are noted because
886 normal kernel/userspace version matching hygiene is not
887 sufficient to avoid this problem.) Ensure that both kernel
888 and userland are from after 20070913.
889
890 20070703:
891 nbinstall has been renamed ${MACHINE_GNU_ARCH}-install. It
892 calls the target-specific strip program, and the logic to pass
893 down STRIP from make has been removed. This requires a
894 re-installation of tools.
895
896 20070422:
897 The way OS emulations lookup filenames inside the emulation root
898 has been changed. Rather than modify the pathname (and copy back
899 to userspace) namei() and lookup() directly check the emulation
900 root. One side effect is that absolute symlinks inside the emulated
901 root file system will be relative to that file system - unless they
902 start /../ this is useful when the emulated root is a real install
903 that has such links.
904 This might affect symlinks that have been added to reference outside
905 the emulated root.
906
907 20070412:
908 The pckbc driver on sgimips IP32 has been removed. Use macekbc
909 instead. See the GENERIC32_IP3x kernel configuration for an
910 example.
911
912 20070319:
913 src/lib/libc/Makefile revision 1.129 broke libc and ld.elf_so
914 on many platforms due to incorrect flags settings. If you
915 updated and built after about 20070315, do "nbmake-$arch
916 cleandir" in src/lib/libc and src/libexec/ld.elf_so to force a
917 rebuild of object files that might have been built
918 incorrectly, and ensure that you have at least
919 src/lib/libc/Makefile 1.130.
920
921 20070210:
922 src/sys/sys/{sa.h,savar.h} were removed.
923 find ${OBJDIR} \( -name .depend -o -name '*.d' \) -print \
924 | xargs egrep -l '/sa.h|/savar.h' | xargs rm
925 will allow dependencies on those files to get get rebuilt
926
927 20070209:
928 The threading model was changed when the newlock2 branch
929 was merged to NetBSD-current. If you boot with a new
930 kernel (version 4.99.10), then you also need a new pthread
931 library (/usr/lib/libpthread.so.0.7). If you boot with
932 an old kernel, then you need the old pthread library
933 (/usr/lib/libpthread.so.0.6). Provided you keep the kernel and
934 the pthread library in sync, old threaded applications should
935 continue to work with an old or new kernel. Note that named(8)
936 is the only threaded application in the base system.
937
938 20061214:
939 Following the move of string_to_flags() and flags_to_string()
940 from the bin/ls/ sources to libutil, users doing UPDATE builds
941 will need to do a "make cleandir" in
942 tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/,
943 bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/,
944 usr.bin/xinstall/, libexec/ftpd/, rescue/, as well
945 as the installation images in distrib/
946 in order to excise stale references to the old stat_flags.h header
947 file in the ls sources -- stat_flags.h has been removed.
948
949 20061108:
950 The configure script used in the src/tools/gcc compiler has been
951 changed to indicate that our libc has ssp support built-in and
952 does not depend on -lssp and -lssp-nonshared. You'll need to
953 make clean in src/tools/gcc first to rebuild the compiler.
954
955 20061009:
956 The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer
957 available. Use net.inet{,6}.tcp{,6}.congctl.selected instead.
958
959 20060814:
960 The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been
961 withdrawn. Use vidcvideo and pckbd instead. See the GENERIC
962 kernel configuration for an example. X servers from the last
963 few years should cope.
964
965 20060703:
966 MPACPI is no more. We always configure PCI interrupts using ACPI
967 if we have an ACPI kernel. The option MPACPI_SCANPCI has been renamed
968 to ACPI_SCANPCI. Thanks to work from fvdl.
969
970 20060627:
971 socket(2) has changed, and its system call has been versioned.
972 For userlands with the old version of socket(2), make sure that
973 your kernel has 'options COMPAT_30' set, or else 'bad system call'
974 errors will result.
975
976 Hints for a more successful build:
977 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
978 Use build.sh, but do not use its "expert mode":
979 This will automatically build the tools in the
980 correct order, and it will keep the tools and the
981 new build products from interfering with the running
982 system. This will allow you to ignore most of the
983 other advice in this file.
984 Build a new kernel first:
985 This makes sure that any new system calls or features
986 expected by the new userland will be present. This
987 helps to avoid critical errors when upgrading.
988 Use object directories:
989 This helps to keep stale object
990 files from polluting the build if a Makefile "forgets"
991 about one. It also makes it easier to clean up after
992 a build. It's also necessary if you want to use the
993 same source tree for multiple machines.
994 To use object directories with build.sh:
995 a) invoke build.sh with the "-M" or "-O" options.
996 To use object directories without using build.sh:
997 a) cd /usr/src ; make cleandir
998 b) Add "OBJMACHINE=yes" to /etc/mk.conf
999 c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1000 d) cd /usr/src ; make build
1001 Note that running "make obj" in a directory will create
1002 in obj.$MACHINE directory.
1003 Build to a DESTDIR:
1004 This helps to keep old installed files (especially libraries)
1005 from interfering with the new build.
1006 To build to a DESTDIR with build.sh, use the "-D" option.
1007 To build to a DESTDIR without using build.sh, set the DESTDIR
1008 environment variable before running make build. It should be
1009 set to the pathname of an initially empty directory.
1010 Problems: if you do not use build.sh, you might need to
1011 update critical utilities without using DESTDIR since
1012 nothing is executed from what is installed in DESTDIR.
1013 (See critical utils, below.)
1014 Build often:
1015 This keeps critical utilities current enough to not choke
1016 on any other part of the source tree that depends on up to
1017 date functionality. If you use build.sh, you should not have
1018 this problem.
1019
1020 What to do if things don't work:
1021 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1022 When things don't work there are usually a few things that commonly
1023 should be done.
1024 1) make includes
1025 This should be done automatically by make build.
1026 2) cd share/mk && make install
1027 Again, automatically done by make build.
1028
1029 Failsafe rebuild of a small part of the tree:
1030 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1031 To make sure you rebuild something correctly you want to do
1032 something like the following:
1033 1) Make sure the includes and .mk files are up to date.
1034 2) Make sure any program used to build the particular
1035 utility is up to date. (yacc, lex, etc...)
1036 3) cd ...path/to/util...
1037 make cleandir
1038 rm ...all obj directories...
1039 make cleandir # yes, again
1040 make obj
1041 make depend && make
1042
1043 Failsafe rebuild of the entire tree:
1044 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1045 If you really want to make sure the source tree is clean and
1046 ready for a build try the following. Note that sourcing /etc/mk.conf
1047 (a make(1) Makefile) in this manner is not right, and will not work
1048 for anyone who uses any make(1) features in /etc/mk.conf.
1049
1050 ---cut here---
1051 #!/bin/sh
1052 . /etc/mk.conf
1053
1054 if [ -z $NETBSDSRCDIR ] ; then
1055 NETBSDSRCDIR=/usr/src
1056 fi
1057 if [ \! -d $NETBSDSRCDIR ] ; then
1058 echo Unable to find sources
1059 exit 1
1060 fi
1061 find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
1062
1063 if [ -z $BSDOBJDIR ] ; then
1064 BSDOBJDIR=/usr/obj
1065 fi
1066 if [ -d $BSDOBJDIR ] ; then
1067 rm -rf $BSDOBJDIR
1068 fi
1069
1070 cd $NETBSDSRCDIR && make cleandir
1071
1072 ---cut here---
1073
1074 Critical utilities:
1075 ^^^^^^^^^^^^^^^^^^^
1076 usr.bin/compile_et
1077 usr.bin/make
1078 usr.bin/yacc
1079 usr.bin/lex
1080 usr.bin/xlint
1081 usr.bin/config
1082
1083 Other problems and possible solutions:
1084 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1085 Symptom:Complaints involving a Makefile.
1086 Fix: Rebuild usr.bin/make:
1087 cd usr.bin/make && make && make install
1088 Or, a failsafe method if that doesn't work:
1089 cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
1090
1091 Fix: Make sure .mk files are up to date.
1092 cd share/mk && make install
1093
1094 Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
1095 Fix: Rebuild usr.bin/config
1096
1097 Symptom:
1098 Fix: Rebuild usr.bin/yacc
1099
1100 Symptom:
1101 Fix: Rebuild usr.bin/lex
1102
1103 Symptom:
1104 Fix: rm /usr/lib/libbfd.a
1105
1106 Symptom:Obsolete intermediate files are used during compilation
1107 Fix: Try the following sequence of commands in the directory in question.
1108 make cleandir; rm `make print-objdir`; make cleandir; make obj
1109 (If you built the tree without "make obj" in the past, obsolete files
1110 may remain. The command tries to clean everything up)
1111
1112 Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible
1113 pointer type
1114 Fix: Rebuild and install usr.bin/menuc
1115
1116 Symptom:mklocale not found during build in share/locale/ctype
1117 Fix: Build and install usr.bin/mklocale
1118
1119 Symptom:undefined reference to `__assert13' or `__unsetenv13'
1120 Fix: Rebuild and install lib/libc
1121
1122 Symptom:usr.bin/config fails to build.
1123 Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
1124
1125 Symptom:undefined reference to `getprogname' or `setprogname'
1126 Fix: Rebuild and install lib/libc
1127
1128 Symptom:lint does not understand the '-X' option
1129 Fix: May need to build & install libs with NOLINT=1 before rebuilding lint
1130
1131 Symptom:Update build fails in src/tools/gcc complaining that a variable
1132 (e.g. CPPFLAGS) has changed since the previous run.
1133 Fix: Run "nbmake-${ARCH} clean" in src/tools/gcc or do a clean build.
1134
1135 Symptom:cvs [update aborted]: cannot open directory /cvsroot/src/...:
1136 No such file or directory.
1137 Cause: If a directory is created by mistake, then it is sometimes
1138 deleted from the CVS repository using administrative commands
1139 that bypass the normal cvs access controls. If your cvs working tree
1140 contains references to a directory that has been deleted on the
1141 server in this way, then "cvs update" reports this error.
1142 Fix: Recursively delete the affected directory from your working tree
1143 and try the update again.
1144