b6a2aba9 avg Dec. 15, 2021, 11:15 a.m.
This also fixes an access beyond msgs array.

MFC after:	1 week
ede57683 avg Dec. 15, 2021, 11:15 a.m.
When i % 4 == 0 the result of (i / 4) * 4 is always i.

MFC after:	1 week
1da04ae8 avg Dec. 15, 2021, 11:15 a.m.
MFC after:	1 week
552503ac avg Dec. 15, 2021, 11:14 a.m.
MFC after:	1 week
5f863d7e avg Dec. 15, 2021, 11:14 a.m.
MFC after:	1 week
8296d2f9 pho Dec. 15, 2021, 8:57 a.m.
9e5b0d9e jrtc27 Dec. 15, 2021, 5:52 a.m.
As of glibc 2.34, our unistd.h wrapper's inclusion of stdlib.h exposes
fragility in glibc's sys/wait.h and corresponding part of stdlib.h,
leading to "error: use of undeclared identifier 'WNOHANG'" and similar
errors when bootstrapping bmake.

Work around this by wrapping sys/wait.h to force stdlib.h's inclusion
first before it's implicitly included during the problematic window in

MFC after:	1 week
6a2b72bf imp Dec. 15, 2021, 4:42 a.m.
This is making the CI red. I believe this is because we do a clean build
w/o metamode in the tinderbox, so none of the artifacts needed to build
a binary are present. However, I've not recreated the problem locally
yet to confirm. Remove this while I investigate. This partially reverts
dd55767b86bc. The rest of the commit causes no harm w/o the explicit
test here.

Sponsored by:		Netflix
d752d10e jrtc27 Dec. 15, 2021, 4:36 a.m.
Fixes:		3aa0bc89c6a1 ("libdwarf: Add a weak uncompress() symbol")
MFC after:	1 week
9dc70af8 imp Dec. 15, 2021, 4:09 a.m.
Build uboot ubldr and friends like we build efi binaries
o move everything to be under stand/uboot
o md code goes in arch/$ARCH
o move everything over from the library
  - Had to rename console.c, disk.c and module.c due to conflicts
o update version to 1.5 to reflect the new way of building

This results in a more consistent build system and should represent no
functional change, apart from powerpc version getting new help
file. Also, moved to exlcuding uboot on powerpc64le by using
BROKEN_OPTION instead of the incidental exclusion we had before due to
Makefile reorgs.

Sponsored by:		Netflix
Feedback by:		stevek, jrtc27
Differential Revision:	https://reviews.freebsd.org/D33362
aab8ed23 imp Dec. 15, 2021, 4:05 a.m.
Fixes:		dd55767b86bc
Sponsored by:	Netflix
dd55767b imp Dec. 15, 2021, 3:25 a.m.
A number of header files in sys/* have, going back to 7th Edition Unix
in 1979, reqiured other files (like sys/types.h) to compile. Likewise
the 4BSD networking code has had prerequisites. However, going back to
around the turn of the 21st century, other systems have made them be
independently include-able (wide-spread header include protection
post-dates 7th edition Unix by maybe 3 or so years judging from USENET
source postings). Start down the path of making them all independently
include-able by creating this test that fails buildworld when they are

The file 'badfiles.inc' contains a list of the currently broken files
that cannot be included w/o any prerequisites. As files are fixed, 'make
badfiles.inc' should be re-run to remove them from the list. Note: All
files that start with an underscore are considered internal and not

Please note: once a file is removed from badfiles.inc, it must pass on
all architectures. Buildworld through at least the _includes target is
needed to ensure its working (though a buildkernel should also be done
on all architectures as well).

Sponsored by:		Netflix
Reviewed by:		brooks, markj
Differential Revision:	https://reviews.freebsd.org/D32498
56e4bee1 imp Dec. 15, 2021, 3:25 a.m.
Due to the way that we configure llvm, there's a problem with NO_CLEAN
builds. The *.def files listed in the commit change their behavior based
on command line arguments. Since my flipping the default of the mips
target, this meant there were .o files that were now inconsistent with
how we'll now compile things, leading to errors. By touching the *.def
files list, one can workaround this problem.

Noticed by:		jhb
Sponsored by:		Netflix
2426adf4 imp Dec. 14, 2021, 11:53 p.m.
Sponsored by:		Netflix
f581847a imp Dec. 14, 2021, 11:53 p.m.
The scanning code uses Giant to coordinate its accesses to newbus as
well as to synchronize a little state within hyperv's vmbus. Switch to
the new bus_topo_* functions instead of referring to Giant explicitly.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D31840