1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
Commit Graph

5209 Commits

Author SHA1 Message Date
Dimitry Andric
574b7079b9 Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR:		261742
MFC after:	2 weeks

(cherry picked from commit 4824e7fd18)
2022-06-04 13:59:04 +02:00
Dimitry Andric
1f6fd64fe9 Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR:		261742
MFC after:	2 weeks

(cherry picked from commit 5e801ac66d)
2022-06-04 13:58:59 +02:00
Alex Richardson
3c01fdcfc1 cross-build: fix some redeclaration warnings during bootstrap
MFC after:	3 days

(cherry picked from commit a89410ef91)
2022-05-07 13:09:56 +01:00
Ed Maste
c25c8d621e Remove stray .Pp from WITH_LOADER_EFI_SECUREBOOT description
MFC after:	3 days
Fixes:		13ea0450a9 ("Extend libsecureboot(old libve) to...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 729ee78911)
2022-05-06 21:13:58 -04:00
Ed Maste
1ce2670170 Correct markup in WITH_/WITHOUT_UNIFIED_OBJDIR descriptions
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 60b08330a5)
2022-05-06 21:13:58 -04:00
Ed Maste
2103ecdad8 Update UNIFIED_OBJDIR descriptions
src.conf(5) previously stated they would be removed before FreeBSD 12.0,
but that did not happen.  Change it to "a future version of FreeBSD."

Also pick up LOADER_KBOOT change (enabled on x86) in src.conf regen.

Reported by:	jhb
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b7f53cdcf8)
2022-05-06 21:11:37 -04:00
Ed Maste
8feaf3506d Update WITH_PROFILE description as it is yet removed
GCC still wants to link against (for example) libc_p.a when -pg is in
use, and it's unclear when and how this will be addressed.  Change the
WITH_PROFILE option description to claim that it may be removed from an
unspecified future version of FreeBSD, rather than FreeBSD 14.

Reported by:	Steve Kargl
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f768ecf247)
2022-05-06 21:09:48 -04:00
Ed Maste
e5f1a45b24 Clean up warnings in pthread tests
I intend to move these into lib/libthr/tests/ and connect to kyua.  This
is a first step to address warnings emitted when building using standard
make infrastructure.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34306

(cherry picked from commit ef135466f8)
(cherry picked from commit 7bfe5e4515)
2022-05-03 14:20:43 -04:00
John Baldwin
f0e7c59d30 cryptocheck: Add aliases for algs with multiple key sizes.
Previously algorithms such as AES-CBC would provide an algorithm
without a key size for the smallest key size and additional algorithms
with an explicit key size, e.g. "aes-cbc" (128 bits), "aes-cbc192",
and "aes-cbc256".

Instead, always make the key size name explicit and reuse the
"generic" name to request running tests against all of the key sizes.
For example, for AES-CBC this means "aes-cbc128" is now the name of
the variant with a 128-bit key and "aes-cbc" runs tests of AES-CBC
with all three key sizes.

This makes it easier to run tests on all combinations of ciphers like
AES-GCM or AES-CCM with -z in a single invocation.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33759

(cherry picked from commit 78beb051a2)
2022-04-29 15:53:14 -07:00
John Baldwin
b1c38f0407 cryptocheck: Test Camellia-CBC cipher and RIPEMD-160 HMAC.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33518

(cherry picked from commit a62478aa05)
2022-04-29 14:10:19 -07:00
John Baldwin
1367dcbfef Only use OLD_LIBS with shared libraries.
Use OLD_FILES for a few symbolic links and static libraries previously
included in OLD_LIBS.

Add a missing shared library major number to an old libroken entry.

(cherry picked from commit 60a8277413)
2022-04-29 13:50:04 -07:00
John Baldwin
b47e48d2f5 Add lib32 entries for WITHOUT_PROFILE.
Reported by:	Mark Millard

(cherry picked from commit 610d908f8a)
2022-04-29 13:50:04 -07:00
John Baldwin
f5c9fb1069 Trim a couple of duplicate entries from WITHOUT_PROFILE.
(cherry picked from commit 07c2b29b6e)
2022-04-29 13:50:04 -07:00
John Baldwin
d53a247f86 Add various profiled libraries missing from the WITHOUT_PROFILE list.
Reported by:	Mark Millard

(cherry picked from commit 99188582cc)
2022-04-29 13:50:04 -07:00
Mark Johnston
3681c4f065 ctf: Import ctf.h from OpenBSD
Use it instead of the existing ctf.h from OpenSolaris.  This makes it
easier to use CTF in the core kernel, and to extend the CTF format to
support wider type IDs.

The imported ctf.h is modified to depend only on _types.h, and also to
provide macros which use the "parent" bit of a type ID to refer to types
in a parent CTF container.

No functional change intended.

Reviewed by:	Domagoj Stolfa, emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 2d5d2a986c)
2022-04-06 20:30:44 -04:00
Gordon Bergling
0954cb209c pkgbase: Fix a typo in a source code comment
- s/begining/beginning/

(cherry picked from commit eec4f5c034)
2022-04-02 15:32:27 +02:00
Hans Petter Selasky
90afe1886f usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

Sponsored by:	NVIDIA Networking

(cherry picked from commit 16346e1401)
2022-03-17 10:54:52 +01:00
John Baldwin
b2127b6f1a Install unwind.h into /usr/include
Install headers from LLVM's libunwind in place of the headers from
libcxxrt and allow C applications to use the library.

As part of this, remove include/unwind.h and switch libthr over to
using the installed unwind.h.

Reviewed by:	dim, emaste
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D34065

(cherry picked from commit c00d345665)
2022-02-20 13:29:44 +01:00
Ed Maste
8464ad72e0 ssh: update to OpenSSH v8.8p1
OpenSSH v8.8p1 was motivated primarily by a security update and
deprecation of RSA/SHA1 signatures.  It also has a few minor bug fixes.

The security update was already applied to FreeBSD as an independent
change, and the RSA/SHA1 deprecation is excluded from this commit but
will immediately follow.

MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e9e8876a4d)
(cherry picked from commit 2ffb13149c)
2022-02-10 13:09:57 -05:00
Ed Maste
a613d68fff ssh: enable FIDO/U2F keys
Description of FIDO/U2F support (from OpenSSH 8.2 release notes,
https://www.openssh.com/txt/release-8.2):

  This release adds support for FIDO/U2F hardware authenticators to
  OpenSSH. U2F/FIDO are open standards for inexpensive two-factor
  authentication hardware that are widely used for website
  authentication.  In OpenSSH FIDO devices are supported by new public
  key types "ecdsa-sk" and "ed25519-sk", along with corresponding
  certificate types.

  ssh-keygen(1) may be used to generate a FIDO token-backed key, after
  which they may be used much like any other key type supported by
  OpenSSH, so long as the hardware token is attached when the keys are
  used. FIDO tokens also generally require the user explicitly
  authorise operations by touching or tapping them.

  Generating a FIDO key requires the token be attached, and will
  usually require the user tap the token to confirm the operation:

    $ ssh-keygen -t ecdsa-sk -f ~/.ssh/id_ecdsa_sk
    Generating public/private ecdsa-sk key pair.
    You may need to touch your security key to authorize key generation.
    Enter file in which to save the key (/home/djm/.ssh/id_ecdsa_sk):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/djm/.ssh/id_ecdsa_sk
    Your public key has been saved in /home/djm/.ssh/id_ecdsa_sk.pub

  This will yield a public and private key-pair. The private key file
  should be useless to an attacker who does not have access to the
  physical token. After generation, this key may be used like any
  other supported key in OpenSSH and may be listed in authorized_keys,
  added to ssh-agent(1), etc. The only additional stipulation is that
  the FIDO token that the key belongs to must be attached when the key
  is used.

To enable FIDO/U2F support, this change regenerates ssh_namespace.h,
adds ssh-sk-helper, and sets ENABLE_SK_INTERNAL (unless building
WITHOUT_USB).

devd integration is not included in this change, and is under
investigation for the base system.  In the interim the security/u2f-devd
port can be installed to provide appropriate devd rules.

Reviewed by:	delphij, kevans
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32509

(cherry picked from commit e9a994639b)
2022-02-09 19:03:21 -05:00
Ed Maste
c437ff145c Add libfido2 to the build
From https://github.com/Yubico/libfido2:

    libfido2 provides library functionality and command-line tools to
    communicate with a FIDO device over USB, and to verify attestation
    and assertion signatures.

    libfido2 supports the FIDO U2F (CTAP 1) and FIDO 2.0 (CTAP 2)
    protocols.

libfido2 will be used by ssh to support FIDO/U2F keys. It is currently
intended only for use by ssh, and so is installed as a PRIVATELIB and is
placed in the ssh pkgbase package.

This is currently disabled for the 32-bit library build as libfido2 is
not compatible with the COMPAT_32BIT hack in usb_ioctl.h.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32448

(cherry picked from commit 7b1e19ad78)
(cherry picked from commit 93942379cc)
2022-02-09 16:24:54 -05:00
Ed Maste
e610bb4a85 Add libcbor to the build
From https://github.com/PJK/libcbor:

    libcbor is a C library for parsing and generating CBOR, the general-
    purpose schema-less binary data format.

libcbor will be used by ssh to support FIDO/U2F keys.  It is currently
intended only for use by ssh, and so is installed as a PRIVATELIB and is
placed in the ssh pkgbase package.

cbor_export.h and configuration.h were generated by the upstream CMake
build.  We could create them with bmake rules instead (as NetBSD has
done) but this is a fine start.

This is currently disabled for the 32-bit library build as libfido2 is
not compatible with the COMPAT_32BIT hack in usb_ioctl.h, and there is
no need for libcbor without libfido2.

Reviewed by:	kevans
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32347

(cherry picked from commit 2e85df652c)
2022-02-09 16:24:32 -05:00
Ed Maste
bbe50accc9 Belatedly track private lib renaming for OptionalObsoleteFiles.inc
Reviewed by:	kevans
Fixes:		5551c57355 ("Rework PRIVATELIB")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32384

(cherry picked from commit 032448cd2c)
2022-02-09 12:39:51 -05:00
Ed Maste
b5ed0dcc83 OptionalObsoleteFiles.inc: remove MK_CXX rule for usr/bin/c++
In fact MK_CXX does not control whether /usr/bin/c++ is built -- it is
installed as a link to Clang (which is always a C/C++ compiler), and it
already exists in OptionalObsoleteFiles under MK_TOOLCHAIN.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c3f345ae3c)
2022-02-09 12:39:51 -05:00
Ed Maste
77a3ace8fe OptionalObsoleteFiles: move /usr/bin/CC to MK_TOOLCHAIN section
/usr/bin/CC is installed by usr.bin/clang/clang/Makefile, as with
/usr/bin/cc, /usr/bin/cpp, etc., and is not controlled by MK_CXX.
Move it to the same section as those tools.

(It may be that these should all be under
MK_TOOLCHAIN == no || MK_CLANG_IS_CC == no, but that seems like
unnecessary complexity.)

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f7ea22e211)
2022-02-09 12:39:50 -05:00
Ed Maste
1a9aca594a OptionalObsoleteFiles: remove GCC remnants
g++ and cc1plus were GCC components that are already removed
unconditionally in ObsoleteFiles.inc.

Reported by:	jhb (in review D33108)
Fixes:		57f804675e ("remove GCC 4.2.1 build infrastructure")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1b9344add4)
2022-02-09 12:39:50 -05:00
Ed Maste
e12d36cfab Remove unused GNUCXX option descriptions
Missed from 57f804675e

Reported by:	arhchardson in D27974
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6955737522)
2022-02-09 12:28:41 -05:00
Ed Maste
0f5c3053ac Drop 'Set to' from most src.conf(5) knobs
The description is clearly what effect the knob has when set, so the
additional text was unnecessary.

Reviewed by:	jhb, se
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29583

(cherry picked from commit 9d178c925f)
2022-02-08 15:50:31 -05:00
Andriy Gapon
eee25e8417 schedgraph.py: port to Python 3
The change does not preserve compatibility with Python 2.7.

(cherry picked from commit 7e8ed296e1)
2022-02-08 18:15:24 +02:00
Mark Johnston
2faefc48c7 tools/build: Fix the error message used when a host tool is not present
(cherry picked from commit ddf312e8d7)
2022-02-01 20:28:12 -05:00
Jessica Clarke
62b958cb94 cross-build: Add comment missing from 9e5b0d9eac
Whilst the commit message documented some of the details, I had intended
to include this comment in the actual header, but failed to amend the
commit properly.

Fixes:		9e5b0d9eac ("cross-build: Fix bmake bootstrap with glibc 2.34")
MFC after:	1 week

(cherry picked from commit aee99ab4fe)
2022-01-24 23:59:44 +00:00
Jessica Clarke
e8a6686252 cross-build: Fix bmake bootstrap with glibc 2.34
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
sys/wait.h.

MFC after:	1 week

(cherry picked from commit 9e5b0d9eac)
2022-01-24 23:59:42 +00:00
Jessica Clarke
b65517ccd7 cross-build: Add __weak_symbol definition for libdwarf bootstrap
Fixes:		3aa0bc89c6 ("libdwarf: Add a weak uncompress() symbol")
MFC after:	1 week

(cherry picked from commit d752d10e53)
2022-01-24 23:59:40 +00:00
Jessica Clarke
102717f773 cross-build: Provide _PASSWORD_EFMT1 for libcrypt on Linux
Linux's pwd.h does not define _PASSWORD_EFMT1 (macOS's does), so we need
to define it in order to be able to bootstrap libcrypt (crypt-des.c uses
it) on non-FreeBSD, which will be done in a subsequent commit.

MFC after:	1 week

(cherry picked from commit e0cb1fe7dd)
2022-01-24 23:59:24 +00:00
Jessica Clarke
94b6c9bab7 cross-build: Define crypt_data in unistd.h for libcrypt
This is where it's defined in the base system, so is where libcrypt
expects it to exist when being built, and will be needed when being
bootstrapped in a subsequent commit.

MFC after:	1 week

(cherry picked from commit 8ceba27a5d)
2022-01-24 23:59:21 +00:00
Jessica Clarke
6318e220e3 Bootstrap libz when cross-building from non-FreeBSD
This is needed now libdwarf depends on libz.

Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week

(cherry picked from commit 8d5d329553)
2022-01-24 23:59:14 +00:00
Jessica Clarke
e06a24658a tools: Also create ${WORLDTMP}/legacy/usr/libdata/pkgonfig
This is needed for the next commit which will make libz a bootstrap
library as needed by ctfconvert. We could just not install the .pc file
as it's not needed, but that requires a per-library hack every time a
bootstrap library gains a .pc file, so this keeps bootstrap-tools
looking as much like a normal build as possible.

MFC after:	1 week

(cherry picked from commit 7ba31d58f0)
2022-01-24 23:59:12 +00:00
Jessica Clarke
cd7a83084e Makefile.boot: Fix copy/paste error in LIBNV's crossbuild override
Only noticed due to needing to change the surrounding lines, so
presumably nothing currently needs this.

MFC after:	1 week

(cherry picked from commit 5022d54e06)
2022-01-24 23:59:05 +00:00
Jessica Clarke
29665d68e2 Makefile.boot: Make -Wno-typedef-redefinition Clang-specific
GCC doesn't have this warning and so also doesn't have the flag to
disable it, resulting in it spewing a bunch of warnings about the
command line option being unrecognised.

MFC after:	1 week

(cherry picked from commit 05066fad68)
2022-01-24 23:59:02 +00:00
Mark Johnston
b1ecdb70c9 depend-cleanup.sh: Make the output message more precise
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 73db11a4d1)
2021-12-13 08:27:31 -05:00
Mark Johnston
18ae2f6f4b depend-cleanup.sh: Handle commit cbdec8db18
That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned.  The new file is _pdfork.o.

Reported by:	jhb
Reviewed by:	emaste
Fixes:		cbdec8db18 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 187fe192ce)
2021-12-13 08:27:24 -05:00
Ed Maste
0f0d52fd6a sbin: build ping if at least one of INET & INET6 is enabled
It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR:		260082
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4ef9e58bc)

OptionalObsoleteFiles: remove ping with INET & INET6 disabled

Reported by:	kevans
Fixes:		a4ef9e58bc ("sbin: build ping if at least one of...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 0179739a00)
2021-12-12 20:28:58 -05:00
Ed Maste
129d0eb49e CI: add arm64 support to ci-qemu-test.sh
Reviewed by:	imp (earlier)
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30907

(cherry picked from commit bba96bb143)
2021-12-12 17:45:25 -05:00
Ed Maste
4a713d6501 WITH_/WITHOUT_CXX: update description
Contrary to the previous description WITHOUT_CXX does not disable
/usr/bin/c++, which is just a link to Clang.  We also no longer have
gperf.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 145a574fa1)
2021-12-08 20:44:29 -05:00
Cameron Katri
e52de8a915 llvm-readobj: Attach to buildsystem
Also install it as readelf when MK_LLVM_BINUTILS is set.

Reviewed By:	dim, arichardson
Differential Revision: https://reviews.freebsd.org/D32058

(cherry picked from commit 1b85b68da0)
2021-12-06 17:30:05 +01:00
Dimitry Andric
2e2f8eac75 Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-rc1-97-g23ba3732246a.

PR:		258209

(cherry picked from commit 6e75b2fbf9)
2021-12-06 17:30:03 +01:00
Dimitry Andric
5f7ddb1456 Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR:		258209

(cherry picked from commit fe6060f10f)
2021-12-06 17:30:02 +01:00
Warner Losh
59a8905f08 nanobsd/rescue: Catch up to 20210907 OpenSSH import
Sponsored by:		Netflix

(cherry picked from commit 872d50a5d8)
2021-12-06 08:55:55 -07:00
Warner Losh
002309f649 nanobsd: remove psuedo-terminals from ttys
Yowsa! Another review mentioned this in passing... Only 10 years late.

Sponsored by:		Netflix

(cherry picked from commit 1376924697)
2021-12-06 08:55:54 -07:00
Jose Luis Duran
b1b13085a3 NanoBSD/rescue: Update to 20200214 OpenSSH configuration files
No functional change intended.

(cherry picked from commit 9f6c794ee2)
2021-12-06 08:55:54 -07:00
Herbert J. Skuhra
4a10f984d8 OptionalObsoleteFiles.inc: Add rc.d/zfskeys
While here, sort the etc/rc.d entries.

PR:		256483
Reviewed by:	allanjude
Approved by:	allanjude (src)
MFC after:	3 days
Sponsored by:	Modirum MDPay
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33238

(cherry picked from commit a58135eb09)
2021-12-06 10:56:28 +01:00
Alex Richardson
5b356e6395 Update OptionalObsoleteFiles.inc after 021385aba5
I forgot to update this file so make delete-old would incorrectly remove
the newly-installed LLVM binutils. While touching the file also update
for 8e1c989abb since ObsoleteFiles.inc now inludes the tablegen binaries.

Reported by:	Herbert J. Skuhra <herbert@gojira.at>
Reviewed By:	emaste, imp

Differential Revision: https://reviews.freebsd.org/D32022

(cherry picked from commit 88c027338f)
2021-12-05 21:56:38 +01:00
Alex Richardson
a5186406ac Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By:	emaste

Differential Revision: https://reviews.freebsd.org/D31060

(cherry picked from commit 021385aba5)
2021-12-05 21:42:14 +01:00
Ed Maste
9a463b80e5 CI: use amd64 EDK II firmware included with QEMU
QEMU (now) includes a prebuilt EDK II firmare in edk2-x86_64-code.fd.
Use that instead of requring a standalone uefi-edk2-qemu-x86_64 package.

Reviewed by:	imp
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30915

(cherry picked from commit 7d9794b34b)
2021-12-03 11:44:48 -05:00
John Baldwin
64c043d2d2 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.
This is useful for WireGuard which uses a nonce of 8 bytes rather
than the 12 bytes used for IPsec and TLS.

Note that this also fixes a (should be) harmless bug in ossl(4) where
the counter was incorrectly treated as a 64-bit counter instead of a
32-bit counter in terms of wrapping when using a 12 byte nonce.
However, this required a single message (TLS record) longer than 64 *
(2^32 - 1) bytes (about 256 GB) to trigger.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32122

(cherry picked from commit 42dcd39528)
2021-10-21 14:19:30 -07:00
John Baldwin
8581b350dd cryptocheck: Support multiple IV sizes for AES-CCM.
By default, the "normal" IV size (12) is used, but it can be overriden
via -I.  If -I is not specified and -z is specified, issue requests
for all possible IV sizes.

Reviewed by:	markj
Sponsored by:	 Chelsio Communications, The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32110

(cherry picked from commit bcb0fd6acc)
2021-10-21 14:07:24 -07:00
John Baldwin
d8b6a65590 cryptocheck: Expand the set of sizes tested by -z.
Test individual sizes up to the max encryption block length as well as
a few sizes that include 1 full block and a partial block before
doubling the size.

Reviewed by:	cem, markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D29518

(cherry picked from commit c86de1dab8)
2021-10-21 08:51:24 -07:00
John Baldwin
29af3bc12d cryptocheck: Free generated IV after each GMAC test.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28753

(cherry picked from commit 442a293611)
2021-10-21 08:51:23 -07:00
John Baldwin
1ab6c8ca7e cryptocheck: Add support for the Poly1305 digest.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28758

(cherry picked from commit 68c0373448)
2021-10-21 08:51:23 -07:00
John Baldwin
3a7ae9ce6d cryptocheck: Add Chacha20-Poly1305 AEAD coverage.
- Make openssl_gcm_encrypt generic to AEAD ciphers (aside from CCM)
  and use it for Chacha20-Poly1305.

- Use generic AEAD control constants instead of GCM/CCM specific names.

Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27838

(cherry picked from commit 1bd9fc96d4)
2021-10-21 08:51:22 -07:00
Vincenzo Maffione
fdbbd118fa nemtap: lb app: Validate ihl field when hashing packet
MFC after:	1 week

(cherry picked from commit f7cef43aa9)
2021-10-09 21:19:20 +00:00
Alan Somers
ce10852cb3 tools/test/upsdl: fix compiler warnings
Sponsored by:	Axcient

(cherry picked from commit 5dc5f849be)
2021-10-07 15:41:47 -06:00
Konstantin Belousov
9eb77afb4d test/ptrace/scescx.c: fix printing of braces for syscalls without args
(cherry picked from commit 9a8eb5db55)
2021-09-19 14:18:12 +03:00
Warner Losh
363f9e1114 nanobsd: adopt dhcpd to latest conventions
Adopt the dhcpd build to use nanobsd-build top level directory that
other nanobsd builds are using.

Sponsored by:		Netflix

(cherry picked from commit 9ed1e98abf)
2021-09-12 09:56:15 -06:00
Jessica Clarke
572a78599d tools/build/cross-build: Fix building libllvmminimal on Linux
There is a __used member in glibc's posix_spawn_file_actions_t in
spawn.h, so we must temporarily undefine __used when including it,
otherwise Support/Unix/Program.inc fails to build. This is based on
similar handling for __unused in other headers.

Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week

(cherry picked from commit 8a1895a3fa)
2021-09-07 13:08:17 +01:00
Jose Luis Duran
4a6bf977ac Fix cross-builds after 4e5d32a445
Add alignment macros to cross-build's sys/cdefs.h

Pull Request:	https://github.com/freebsd/freebsd-src/pull/531
MFC after:	immediately (build fix)

(cherry picked from commit 94d9439b6b)
2021-09-07 10:56:17 +01:00
Gordon Bergling
a6bc738260 Fix a few typos in source code comments
- s/posbile/possible/

(cherry picked from commit 34f620f1d0)
2021-08-19 09:29:25 +02:00
Emmanuel Vadot
e99783747e pkgbase: Add an src.conf option for splitting man pages
Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by:	bapt, Mina Galić <me@igalic.co>
Differential Revision:	https://reviews.freebsd.org/D29169
MFC after:      2 weeks

(cherry picked from commit c7e6cb9e08)
2021-08-16 18:13:51 +02:00
Gordon Bergling
b844fc25c8 nanobsd: Correct a typo in a comment
- s/partion/partition/

(cherry picked from commit 8b9f6d62f7)
2021-08-12 14:25:50 +02:00
Alex Richardson
c65dab7dd2 Allow bootstrapping llvm-tblgen on macOS and Linux
This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.

Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org>
Test Plan:	Compiles on ubuntu 18.04 and macOS 11.4
Reviewed By:	dim
Differential Revision: https://reviews.freebsd.org/D31057

(cherry picked from commit 31ba4ce889)
2021-08-05 10:01:08 +01:00
Alex Richardson
85c76b4117 tools/build: Don't redefine open() for the linux bootstrap
This is needed to bootstrap llvm-tblgen on Linux since LLVM calls
`::open(...)` which does not work if open is a statement macro.
Also stop defining O_SHLOCK/O_EXLOCK and update the only bootstrap tools
user of those flags to deal with missing definitions.

Reviewed By:	jrtc27
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D31226

(cherry picked from commit 5f6c8ce245)
2021-08-05 10:00:45 +01:00
Ed Maste
3f244aace2 Update WITHOUT_KERNEL_SYMBOLS description
We have installed kernel debug data under /usr/lib/debug/ for some time
now, so the suggestion to set WITHOUT_KERNEL_SYMBOLS for small root
partitions is no longer valid.

Also call them "debug symbol files" rather than just "symbol files",
since they contain much more than just symbols.  The kernel also
includes (some) symbols, regardless of the setting of this knob.

MFC after:	1 week

(cherry picked from commit 5f946c76c0)
2021-08-04 13:21:33 -04:00
Dimitry Andric
af732203b8 Merge llvm-project 12.0.1 release and follow-up fixes
Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR:		255570

(cherry picked from commit e8d8bef961)

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR:		255570

(cherry picked from commit d409305fa3)

Disable strict-fp for powerpcspe, as it does not work properly yet

Merge commit 5c18d1136665 from llvm git (by Qiu Chaofan)

  [SPE] Disable strict-fp for SPE by default

  As discussed in PR50385, strict-fp on PowerPC SPE has not been
  handled well. This patch disables it by default for SPE.

  Reviewed By: nemanjai, vit9696, jhibbits

  Differential Revision: https://reviews.llvm.org/D103235

PR:		255570

(cherry picked from commit 715df83abc)

Apply upstream libc++ fix to allow building with devel/xxx-xtoolchain-gcc

Merge commit 52e9d80d5db2 from llvm git (by Jason Liu):

  [libc++] add `inline` for __open's definition in ifstream and ofstream

  Summary:

  When building with gcc on AIX, it seems that gcc does not like the
  `always_inline` without the `inline` keyword.
  So adding the inline keywords in for __open in ifstream and ofstream.
  That will also make it consistent with __open in basic_filebuf
  (it seems we added `inline` there before for gcc build as well).

  Differential Revision: https://reviews.llvm.org/D99422

PR:		255570

(cherry picked from commit d099db2546)

Undefine HAVE_(DE)REGISTER_FRAME in llvm's config.h on arm

Otherwise, the lli tool (enable by WITH_CLANG_EXTRAS) won't link on arm,
stating that __register_frame is undefined. This function is normally
provided by libunwind, but explicitly not for the ARM Exception ABI.

Reported by:	oh
PR:		255570

(cherry picked from commit f336b45e94)

Merge llvm-project 12.0.1 rc2

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-rc2-0-ge7dac564cd0e, a.k.a. 12.0.1 rc2.

PR:		255570

(cherry picked from commit 23408297fb)

Revert libunwind change to fix backtrace segfault on aarch64

Revert commit 22b615a96593 from llvm git (by Daniel Kiss):

  [libunwind] Support for leaf function unwinding.

  Unwinding leaf function is useful in cases when the backtrace finds a
  leaf function for example when it caused a signal.
  This patch also add the support for the DW_CFA_undefined because it marks
  the end of the frames.

  Ryan Prichard provided code for the tests.

  Reviewed By: #libunwind, mstorsjo

  Differential Revision: https://reviews.llvm.org/D83573

  Reland with limit the test to the x86_64-linux target.

Bisection has shown that this particular upstream commit causes programs
using backtrace(3) on aarch64 to segfault. This affects the lang/rust
port, for instance. Until we can upstream to fix this problem, revert
the commit for now.

Reported by:	mikael
PR:		256864

(cherry picked from commit 5866c369e4)

Merge llvm-project 12.0.1 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-0-gfed41342a82f, a.k.a. 12.0.1 release.

PR:		255570

(cherry picked from commit 4652422eb4)

compilert-rt: build out-of-line LSE atomics helpers for aarch64

Both clang >= 12 and gcc >= 10.1 now default to -moutline-atomics for
aarch64. This requires a bunch of helper functions in libcompiler_rt.a,
to avoid link errors like "undefined symbol: __aarch64_ldadd8_acq_rel".

(Note: of course you can use -mno-outline-atomics as a workaround too,
but this would negate the potential performance benefit of the faster
LSE instructions.)

Bump __FreeBSD_version so ports maintainers can easily detect this.

PR:		257392

(cherry picked from commit cc55ee8009)
2021-07-31 20:56:55 +02:00
Jose Luis Duran
d2d322b012 Fix the pattern for changing PermitRootLogin
The previous pattern had the (harmless) side-effect of duplicating the
entry in the config file.

No functional change intended.

Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/510

(cherry picked from commit 73358cd2cf)
2021-07-30 17:02:13 -06:00
Yann Kerherve
2cbf9eff2d nanobsd: fix typo in NANO_WORLDDIR
Reviewed by:	imp
PR:		257299

(cherry picked from commit 5a9e5a5111)
2021-07-30 17:02:13 -06:00
Warner Losh
1f5bcd0b47 nanobsd: Bump rescue size to 8GB
Bump the rescue size from 1.2GB to just shy of 8GB as things have grown
somewhat. Also make it possible to build rescue somewhere other than
/usr/src.

Sponsored by:		Netflix

(cherry picked from commit 998abf5a12)
2021-07-21 10:13:11 -06:00
Warner Losh
b78807daaa pcengines: Fix kernel config
Update the old ALIX config to remove devices, add iflib and remove
trailing white space.

Sponsored by:		Netflix

(cherry picked from commit e44c620681)
2021-07-21 10:13:11 -06:00
Warner Losh
54ff80e07f nanobsd: default to -j $hw.ncpu
For paralllel builds, default to using all the CPUs on the system. The
old default of -j 3 was too few.

Sponsored by:		Netflix

(cherry picked from commit 7e3a794be3)
2021-07-21 10:13:11 -06:00
Arrigo Marchiori
50b2e5d608 nanobsd: Use gpart and create code image before full disk image
The attached patch brings two main changes to the nanobsd script:
 1- gpart is used instead of fdisk;
 2- the code image is created first, and then used to ``assemble'' the
    full disk image.

The patch was first proposed on the freebsd-embedded list:
http://lists.freebsd.org/pipermail/freebsd-embedded/2012-June/001580.html
and is currently under discussion:
http://lists.freebsd.org/pipermail/freebsd-embedded/2014-January/002216.html

Another effect is that the -f option ("suppress code slice extraction")
now imples the -i option ("suppress disk image build").

imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs
NANO_OBJ confusion in original.

PR:			186030
Reviewed by:		imp@
Differential Revision:	https://reviews.freebsd.org/D31102

(cherry picked from commit 587c054bea)
2021-07-21 10:13:11 -06:00
Lev A. Serebryakov
1405d761ba nanobsd: enhance fill_pkg.sh
NanoBSD has helper script "fill_pkg.sh" which links all packages and
ther dependencies from "package dump" (like /usr/ports/packages/All) to
specified director. fill_pkg.sh has some limitations:

1) It needs ports tree, which should have exactly same versions as
   "package dump".
2) It requires full paths to needed ports, including "/usr/ports" part.
3) It has assumptions about Nano Package Dir (it assumes, that it
   specified rtelative to current directory).
4) It does not have any diagnostics (almost).

This PR enhances "fill_pkg.sh" script in several ways:

1) Nano package dir could be absolute path.
2) Script understands four ways to specify "root" ports/packages:
   (a) Absolute directory with port (old one)
   (b) Relative directory with port, relative to ${PORTSDIR} or /usr/ports
   (c) Absolute path to file with package (with .tbz suffix)
   (d) Name of package in dump dir, with or without .tbz suffix

   These ways can be mixed in one call. Dependencies for
   packages are obtained with 'pkg_info -r' call, and are searched for
   in same directory as "parent" package. Dependencies for ports are
   obtained in old way from port's Makefile.
3) Three levels of diagnostic (and -v option, could be repeated) are added.
4) All path variables are enclosed in quotes, to make script work with paths,
   containing spaces.

Note: imp merged in the changes to fill_pkg.sh since this has been a PR.

PR:			151695
Reviewed by:		imp@
MFC After:		3 days
Differential Revision:	https://reviews.freebsd.org/D31101

(cherry picked from commit 36cfb5d50f)
2021-07-16 12:28:44 -06:00
Warner Losh
9148a80a65 mk: LZMA_SUPPORT is unused
Retire LZMA_SUPPORT. It's unused since r332995.

Reviewed by:		delphij
PR:			244302
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31088

(cherry picked from commit d8514fa6f1)
2021-07-16 12:28:44 -06:00
Warner Losh
940fae4082 nanobsd: remove sparc64 embedded example
Remove the qemu sparc64 example. It was only ever compile tested since
qemu had issues booting FreeBSD/sparc64. Also remove obsolete info about
armv5 configs removed long ago.

Sponsored by:		Netflix

(cherry picked from commit 25a66f1fb1)
2021-07-12 13:42:13 -06:00
Ed Maste
9e06b34bb5 Add deprecation notice for WITH_PROFILE option
As discussed on freebsd-current [1] and freebsd-arch [2] and review
D30833, FreeBSD 14 will ship without the _p.a libraries built with -pg.
Both upstream and base system (in commit b762974cf4) Clang have been
modified to remove the special case for linking against these libraries.

Clang's -pg support and mcount() remain, so building with -pg can still
be used on code that the user builds; we just do not provide prebuilt
libraries compiled with -pg.  A similar change is still needed for GCC.

[1]  https://lists.freebsd.org/pipermail/freebsd-current/2020-January/075105.html
[2] https://lists.freebsd.org/archives/freebsd-arch/2021-June/000016.html

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 175841285e)

Clarify notice for profiled libraries in FreeBSD 14

Reported by:	kevans
Fixes:		175841285e ("Add deprecation notice for...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f94360971e)
2021-07-07 09:17:06 -04:00
Warner Losh
05e6f6b650 libspl: fix NO_CLEAN build
atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by:		Netflix

(cherry picked from commit dbbf7cb21c)
2021-06-22 11:01:06 +02:00
John Baldwin
214bbc2ddc Add a description for WITH_SVNLITE.
Reviewed by:	emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D30106

(cherry picked from commit 0ac711e07e)
2021-06-09 15:22:43 -07:00
Dimitry Andric
70e13c4cff Add C++ headers <barrier> <concepts> <execution> <latch> <numbers> <semaphore>
I missed adding these to the libc++ Makefile, when importing
llvm-project 11.0.0-rc1, even though they were supplied by upstream.

While here, update OptionalObsoleteFiles.inc to add these new headers,
and cleanup old cruft.

Reported by:	yuri
Submitted by:	jkim (Makefile diff)
PR:		255374
MFC after:	3 days

(cherry picked from commit 95aa617e4b)
2021-06-06 13:41:34 +02:00
Alex Richardson
9f9c2745e8 tools/build/bootstrap-m4: regenerate after d37f81e35b
Reviewed by:	jkim

(cherry picked from commit f8e57f89f3)
2021-05-11 09:39:30 +01:00
Sofian Brabez
447133ecfd wlanstats: fix build
Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats

Approved by:	adrian
MFC after:	1 week

(cherry picked from commit b8be809495)
2021-04-27 17:31:18 +00:00
Sofian Brabez
d61f10a878 iwnstats: fix build with clang and allow install under /usr/local/sbin
iwnstats was not compiling because of some issues raised by the clang
compiler due to -Werror. As a tool it is not connected to world build.

Add missing field "barker_mrc" initialization in struct
iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused
pointer *is on iwn_stats_*_print functions and unused variables for
-Wunused-parameter and -Wunused-variable.

The value for field "barker_mrc" of struct iwn2030_sensitivity_limits
was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115
.barker_corr_th_min_mrc = 390).

Also set BINDIR in Makefile to make it possible to install under
/usr/local/sbin/iwnstats as it require super user.

Reviewed by:	adrian
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29800

(cherry picked from commit 561d34d705)
2021-04-27 17:31:12 +00:00
Alex Richardson
f323095645 Don't add -Winline for WARNS=6
This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By:	jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235

(cherry picked from commit c8c62548bf)
2021-04-22 10:44:51 +01:00
Alex Richardson
4eaec3eb5f tools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily
If all the require variables (XCC/XCXX/XCPP/XLD) are already set in the
environment, we don't have to infer a default value for the cross toolchain
path. This avoids an additional `brew --prefix` call when building with
cheribuild (since it already sets all these variables).

(cherry picked from commit 2b181156c8)
2021-04-10 13:56:08 +01:00
Alex Richardson
0a0e327fad tools/build/make.py: Don't call brew --prefix if --cross-bindir is set
Also updated the logic to use subprocess.run() instead of the old
subprocess.getoutput() which also includes stderr and therefore
can trigger an exception inside Path().exists().

Reported by:	gnn

(cherry picked from commit a26ace4db6)
2021-04-10 13:56:02 +01:00
Alex Richardson
3501239475 tools/build/make.py: drop workaround for cc --version not being parsed
Previously bsd.compiler.mk was not able to detect the compiler type for
Ubuntu's /usr/bin/cc unless we were invoking the /usr/bin/gcc symlink.
This problem has been fixed by 9c6954329a
so we can drop the workaround from make.py.

Reviewed By:	jrtc27
Differential Revision: https://reviews.freebsd.org/D28323

(cherry picked from commit 88db1cc9f1)
2021-04-10 13:55:54 +01:00
Vincenzo Maffione
588b2e6dd2 netmap: pkt-gen: allow -Z and -z to be used together
These options are used for generating random source/destination
IP/ports within transmitted packets.

MFC after:	1 week

(cherry picked from commit 27bf5dd3d4)
2021-04-07 21:06:01 +00:00
Vincenzo Maffione
894b3a1a32 netmap: bridge: fix transmission in busy-wait mode
In busy-wait mode (BUSYWAIT defined), NIOCTXSYNC should be
performed after packets have been moved to the TX ring
(rather than before).
Before the change, moved packets may stall for an indefinite
time in the TX ring.

MFC after:	1 week

(cherry picked from commit 51cc31088b)
2021-04-07 21:04:33 +00:00
Jessica Clarke
5a9fe096f1 tools/build: Improve host-symlinks failure mode
Since set -e is enabled by sys.mk, if the tool cannot be found in PATH
then the entire shell command line fails, causing us to not print the
error message below and instead silently (due to the @) fail, only
getting the usual "Error code 1" print from bmake. Thus, provide a dummy
default that will never exist (the same as is used by meta2deps.sh) if
which fails so that we get the error message as intended.

(cherry picked from commit 8c9e45503f)
2021-03-27 02:10:29 +00:00
Alex Richardson
2556fce493 Silence a macro-redefined warning when crossbuilding
This is already defined by the ncurses headers, so just undef it before
defining it again.

(cherry picked from commit 10f2a0c2e8)
2021-03-17 22:22:48 +00:00
Alex Richardson
60fd443962 Fix bootstrap tools build on macOS after 02af91c52e
After changing the namespace.h header we need to provide _err on macOS, too.
Previously we used the system libc err*/warn*, but that does not provide
_err/_warn (which is used by other bootstrapped files from libc).
To fix this problem bootstrap err.c on macOS as well.

Fixes:		02af91c52 (Fix crossbuild bootstrap tools build with Clang 12)
(cherry picked from commit 962a3814d4)
2021-03-17 09:59:38 +00:00
Alex Richardson
edb96bf587 Fix crossbuild bootstrap tools build with Clang 12
Clang 12 no longer allows re-defining a weak symbol as non-weak. This
happed here because we compile err.c with _err defined to err. To fix
this, use the same approach as the libc namespace.h

(cherry picked from commit 02af91c52e)
2021-03-17 09:59:32 +00:00
Alex Richardson
c437c2b136 tools/build/make.py: -DNO_CLEAN -> -DWITHOUT_CLEAN
(cherry picked from commit 43e083be81)
2021-03-17 09:56:18 +00:00
Alex Richardson
aa68a0b324 Create symlinks to host tools on non-FreeBSD hosts
This is unnecessary when cross-building from Linux/macOS.
Additionally, cp -p appears to be broken on macOS Big Sur
(https://openradar.appspot.com/8957219).

For some unknown reason this commit appears to fix
freezes when building on macOS Big Sur.
This also fixes building in docker with volume mounts
with ACLs, since setting the ACL with cp -p fails otherwise.

Obtained From:	CheriBSD
Tested By:	gnn (macOS Big Sur), Nathaniel Wesley Filardo (docker)
Reviewed By:	jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D28267

(cherry picked from commit a8b20f4fab)
2021-03-17 09:48:28 +00:00
John Baldwin
6a2ab3769a Remove the usr/tests/usr.bin/yacc/yacc directory when removing yacc.
(cherry picked from commit e6cfd2939a)
2021-03-11 11:17:56 -08:00
Konstantin Belousov
e4a6846c34 WITH_OFED build option: fix
(cherry picked from commit ff975f15d8)
2021-02-05 03:27:33 +02:00
John Baldwin
c1c52cd57e OpenSSL: Support for kernel TLS offload (KTLS)
This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support.  It defaults to enabled on amd64 and disabled on all
other architectures.

Sponsored by:	Netflix

(cherry picked from commit aa906e2a49)
2021-02-04 16:03:20 -08:00
Kyle Evans
d37a305bc5 build: options: mention ports in the WITH_OPENLDAP description
There's a third party dependency on this option; currently,
net/openldap24-{,sasl-}client.  At least mention that an openldap from ports
is needed for this option.

PR:		252866

(cherry picked from commit 7587d9823a)
2021-02-03 20:56:01 -06:00
Kyle Evans
ed05bfceb8 build: remove LIBPTHREAD/LIBTHR build options
WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR:		252760

(cherry picked from commit 123ae3045d)
(cherry picked from commit 251a6ddfbd)
2021-01-28 19:21:46 -06:00
Ed Maste
03d837b565 Remove Binutils from src.conf(5) option descriptions
All binutils remnants have been removed before FreeBSD 13.

PR:		252842
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b23665f316)
2021-01-26 19:26:16 -05:00
Alex Richardson
0348c8fcfa getopt: Fix conversion from string-literal to non-const char *
Define a non-const static char EMSG[] = "" to avoid having to add
__DECONST() to all uses of EMSG. Also make current_dash a const char *
to fix this warning.
2021-01-19 21:23:25 +00:00
Marius Strobl
145f01a3df kerneldoc: remove Doxyfile for cmx(4)
The latter has been removed in 0d3a424a89.
2021-01-16 23:53:13 +01:00
Dimitry Andric
7593c13e18 Add libclang_rt.profile-powerpc64le.a to (Optional)?ObsoleteFiles.inc
On little-endian PowerPC64, this prevented /usr/lib/clang/11.0.0 being
cleaned up completely after upgrading to clang 11.0.1.

Noticed by:	pkubaj
MFC after:	4 weeks
X-MFC-With:	r364284
2021-01-16 17:25:56 +01:00
Mariusz Zaborski
aefe30c543 cat: capsicumize it
Reviewed by:	markj, arichardson
Differential Revision:	https://reviews.freebsd.org/D28083
2021-01-15 21:23:42 +01:00
Kyle Evans
03774659d1 tools: git hooks: drop "submitted by" from commit template
With the switch to git, we should strive to properly attribute every
commit appropriately with the metadata that's provided to do so. In this
case, the submitter should be recorded via the author metadata.  Committing
an arbitrary patch, one can set it as such:

git commit --author="John Smith <smith@example.com>"

Reviewed-by:	emaste
Differential-Revision:	https://reviews.freebsd.org/D28069
2021-01-14 00:33:07 -06:00
Vincenzo Maffione
d7493759fb netmap: pkt-gen: fix offset hex formatting
PR:		252594
Reported by:	brpoole@vt.edu
MFC after:	3 days
2021-01-12 22:05:04 +00:00
Kyle Evans
14a16fd3e7 build: add WITHOUT_CLEAN workaround for 821aa63a09
The *w variants of ncurses directories went away, and the remaining names
build the widechar variants instead of non-widechar variants. As such, the
entire ncurses tree should be regenerated.

Key off of lib/ncurses/ncursesw being present and remove the whole ncurses
hierarchy if it is.

Reviewed by:	emaste (IRC)
2021-01-08 10:43:53 -06:00
Warner Losh
a21def4d56 pccard: Remove wi(4) driver
Remove wi(4). pccard is going away, and wi only supports PC Card
devices, though it has a minor amount of glue to also support
PCI cards. However, removing the one without removing the other
is hard, so the whole driver is being removed.

Relnotes: Yes
2021-01-07 20:41:06 -07:00
Alex Richardson
d146f83180 prepare-commit-msg: Avoid warning on macOS and shellcheck fixes
The macOS /bin/sh complains about using return outside of functions.
Replace `return 0` with `exit 0` to fix this. While editing this files
I've also fixed all the shellcheck warnings that were displayed by my IDE.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D28016
2021-01-07 14:00:32 +00:00
Alex Richardson
b500c184b6 Drop some unncessary stale code from Makefile.boot
No longer required after 0e1e341b48.
2021-01-07 10:55:21 +00:00
Alex Richardson
d037edf820 tools/build/make.py: Fix macOS build after a920b9817
If we set STRIPBIN, we also have to set XSTRIPBIN since we otherwise
use the host /usr/bin/strip during buildworld. However, this does not
work on macOS since /usr/bin/strip doesn't handle ELF binaries.
2021-01-07 10:55:21 +00:00
Alex Richardson
7fa2f2a62f Rename NO_WERROR -> MK_WERROR=no
As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D27601
2021-01-07 09:31:03 +00:00
Alex Richardson
7467c537a5 Fix warnings during bootstrap phase on macOS 2021-01-07 09:31:03 +00:00
Alex Richardson
4e64fb9f49 Fix warnings during bootstrap on Linux systems
Most warnings are currently off for the boostrap phase, but once D27598
lands they will be enabled again.
2021-01-07 09:30:50 +00:00
Alex Richardson
ed8455806e Fix all warnings emitted in make kernel-toolchain
With this change and D27598 make kernel-toolchain no longer emits any
warnings for me.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D27599
2021-01-07 09:26:22 +00:00
Vincenzo Maffione
163f4f1573 netmap: bridge: fix NS_MOREFRAG support
Support for NS_MOREFRAG is broken, as NS_MOREFRAG is copied from
the TX slot to the RX slot rather than the other way around.
Also, the NS_MOREFRAG must be copied also in case of packet
copy (no zerocopy).

Reported by:	rajesh1.kumar_amd.com
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D27980
2021-01-07 07:05:57 +00:00
Kristof Provost
c38e59ce1b pfctl: Fix NOCLEAN build
We've created a new pf_ruleset.c file for pfctl and no longer use the
kernel vrsion, but the build system doesn't handle this dependency
change correctly. Delete the dependency file if it contains the kernel
version of the file.

MFC after:	2 weeks
2021-01-06 22:07:46 +01:00
Baptiste Daroussin
821aa63a09 ncurses: only keep the version with widechar support
Only keep the widechar version of ncurses as libncursesw.so.9

Keep the old name to avoid breaking the ABI compatibility (the non
widechar version libncurses.so.9 is not binary compatible with
libncursesw.so.9) since all ports and base are already only linking
against the widechar version we can simply remove libncurses.so.9

Since the .9 version only lived in the dev branch and never ended in a
release, it is simply removed and not added to any binary compat
package.

Add symlinks to keep build time compatibility for anyone linking against
-lncurses
2021-01-05 14:01:32 +01:00
Dimitry Andric
eaeb601bd6 Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.1-rc2-0-g43ff75f2c3f (aka 11.0.1 rc2).

MFC after:	4 weeks
X-MFC-With:	r364284
2021-01-03 13:54:24 +01:00
Ed Maste
b67e440755 Add comment explaining Git commit message hook
Suggested by:	jhb
2020-12-30 12:33:19 -05:00
Poul-Henning Kamp
07b0027f6c Handle ports FLAVOR better. (+minor polish) 2020-12-30 16:05:09 +00:00
Hiroki Sato
916806472a Fix generation of colldef source files for non-UTF-8 locales
- Files for colldef were generated by duplicating UTF-8 collation files
  for each language and included invalid characters in the non-UTF-8
  encodings.  localedef(1) does not allow those characters.
  cldr2def.pl now checks if the characters are valid based on charmap files.

  TODO: ja_JP.UTF-8 locale should not be generated solely from CLDR because
  it was standardized in a document "UI-OSF Application Platform Profile for
  Japanese Environment" which was incompatible with information in CLDR.
  Most of commercial Unix vendors adopt this pre-Unicode-era document
  as the reference even for UTF-8 locale.  Newer versions of Solaris have
  added a CLDR version as ja_JP.UTF-8@cldr, and IBM AIX has used
  JA_JP.UTF-8 for the UI-OSF specification and ja_JP.UTF-8 for CLDR.

  Note that this commit does not change generation of ja_JP.UTF-8.
  Changes related to this issue will be committed separately later.

- Generate POSIX charamap UTF-32 as a reference.  It was confusing that
  charmap.xml used Unicode names defined in UnicodeData.txt though POSIX
  charmap used slightly different names for the same code points.
  cldr2def.pl now uses UTF-32.cm as single information source for Unicode
  symbol names and code points.  Charset.xml is also updated to use them.

- Fix a bug in get_encodings() in cldr2def.pl which did not understand
  0x00+0x00 notation correctly in charmaps/ISCII-DEV.TXT.

- Do not regenerate posix/xx_Comm_C.UTF-8.src every time when doing
  "make build".

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D27809
2020-12-30 04:40:27 +09:00
Adrian Chadd
66585c3fe2 [wlanwatch] fix compiler warnings-as-errors on gcc-6.4 mips
* argc/argv are currently unused
* msglen is currently unused
* "default" is a const buffer, but char *cp isn't, so
  change default string to be a non-const global string variable
* Make 'cp' private to each context that's using it, which fixes
  a "variable shadows previous declaration" warning and makes it
  easier to track where it was being leaked between address family
  sections
2020-12-29 10:24:36 -08:00
Adrian Chadd
1fef838b91 [wlanwds] Fix compiler warnings-as-errors on freebsd gcc-6.4 mips
* Remove unused verbose global; things are now done through syslog
* Mark a variable as unused in handle_rtmsg()

Tested:

* FreeBSD/mips32 using gcc-6.4
2020-12-29 10:24:33 -08:00
Adrian Chadd
ff7c2c5a3b [wlanstats] Fix warnings-as-errors on gcc-6.4 on mips
* use CLLADDR() to not try deconsting a const
* Unsigned where they should be
* static where it should be

Tested:

* freebsd/mips32, using gcc-6.4
2020-12-29 10:24:30 -08:00
Kyle Evans
8aff76fb37 build: remove the option to build gnugrep
Unconditionally install bsdgrep as grep, bootstrap or not. Remove all
build glue and stop installing both gnugrep and libgnuregex now that
all consumers of the latter are gone.

Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27732
2020-12-25 15:14:17 -06:00
Marius Strobl
9cca83b6db mk48txx(4): remove obsolete driver
It's no longer used since 58aa35d429
and r357455 respectively.
2020-12-25 19:47:45 +01:00
Marius Strobl
d141239c56 mc146818(4): remove obsolete driver
It's no longer used since 58aa35d429
and r357455 respectively.
2020-12-25 19:47:45 +01:00
Ed Maste
a62107ed19 make the git commit message template more compact
git's default commit message includes the list of staged, unstaged, and
untracked files; adding our metadata tags and then their descriptions
made for a very long template.

Move the descriptions to the metadata lines themselves.

Reviewed by:	bcr
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27664
2020-12-23 08:58:17 -05:00
Yuri Pankov
f952bdf142 tools/tools/locale: skip control character widths
Do not explicitly encode control characters widths as 0
allowing wcwidth() to return the proper implicit value for
non-printable characters (-1).

Reported by:	naddy
2020-12-23 15:53:43 +03:00
Yuri Pankov
150367e9aa tools/tools/locale: fix static-colldef 2020-12-18 08:43:06 +00:00
Yuri Pankov
43835d120f tools/tools/locale: install generated files in current src checkout 2020-12-18 04:01:05 +00:00
Ed Maste
f3fec471a3 Describe the commit message template our git hook script produces
Reported by:	rpokala
2020-12-17 20:31:45 +00:00
Ed Maste
352b4e2092 chmod +x the git commit message prep hook 2020-12-17 20:11:31 +00:00
Ed Maste
9f13adee8b Add initial version of git commit message preparation hook
Start with a slightly modified version of the SVN commit template, to
allow developers to experiment.  This will be updated in the future as
our process and techniques evolve.

This can be installed by copying or symlinking into the .git/hooks/
directory.

Feedback from:	cem, jhb
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27633
2020-12-17 19:58:29 +00:00
Kyle Evans
29842cb36e lualoader: fix lua-lint run
luacheck rightfully complains that i is unused in the show-module-options
loop at the end (it was used for some debugging in the process).

We've added a new pager module that's compiled in, so declare that as an
acceptable global.
2020-12-17 18:29:30 +00:00
Brooks Davis
a7e24b48d2 Remove Doxyfiles for removed drivers
Reported by:	emaste
2020-12-15 18:44:41 +00:00
Ed Maste
1c0ea326aa Retire obsolete GDB 6.1.1
GDB 6.1.1 was released in June 2004 and is long obsolete. It does not
support all of the architectures that FreeBSD does, and imposes
limitations on the FreeBSD kernel build, such as the continued use of
DWARF2 debugging information.

It was kept (in /usr/libexec/) only for use by crashinfo(8), which
extracts some basic information from a kernel core dump after a crash.
Crashinfo already prefers gdb from port/package if installed.

Future work may add kernel debug support to LLDB or find another path
for crashinfo's needs, but in any case we do not want to ship the
excessively outdated GDB in FreeBSD 13.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27610
2020-12-15 17:44:19 +00:00
Ed Maste
369d70ec92 Remove more cx,ctau leftovers
Missed in r359178
2020-12-15 01:45:19 +00:00
Yuri Pankov
89b418d69e locale: fix mode for installed files to be 644, not 755
While here, drop '-c' flag to install as it's default and provided for
backward compatibility only.
2020-12-12 23:41:47 +00:00
Ian Lepore
ff3468ac94 Provide userland notification of gpio pin changes ("userland gpio interrupts").
This is an import of the Google Summer of Code 2018 project completed by
Christian Kramer (and, sadly, ignored by us for two years now).  The goals
stated for that project were:

    FreeBSD already has support for interrupts implemented in the GPIO
    controller drivers of several SoCs, but there are no interfaces to take
    advantage of them out of user space yet. The goal of this work is to
    implement such an interface by providing descriptors which integrate
    with the common I/O system calls and multiplexing mechanisms.

The initial imported code supports the following functionality:

 -  A kernel driver that provides an interface to the user space; the
    existing gpioc(4) driver was enhanced with this functionality.
 -  Implement support for the most common I/O system calls / multiplexing
    mechanisms:
     -  read() Places the pin number on which the interrupt occurred in the
        buffer. Blocking and non-blocking behaviour supported.
     -	poll()/select()
     -	kqueue()
     -	signal driven I/O. Posting SIGIO when the O_ASYNC was set.
 -  Many-to-many relationship between pins and file descriptors.
     -  A file descriptor can monitor several GPIO pins.
     -  A GPIO pin can be monitored by multiple file descriptors.
 -  Integration with gpioctl and libgpio.

I added some fixes (mostly to locking) and feature enhancements on top of
the original gsoc code.  The feature ehancements allow the user to choose
between detailed and summary event reporting.  Detailed reporting provides
a record describing each pin change event.  Summary reporting provides the
time of the first and last change of each pin, and a count of how many times
it changed state since the last read(2) call.  Another enhancement allows
the recording of multiple state change events on multiple pins between each
call to read(2) (the original code would track only a single event at a time).

The phabricator review for these changes timed out without approval, but I
cite it below anyway, because the review contains a series of diffs that
show how I evolved the code from its original state in Christian's github
repo for the gsoc project to what is being commited here.  (In effect,
the phab review extends the VC history back to the original code.)

Submitted by:	Christian Kramer
Obtained from:	https://github.com/ckraemer/freebsd/tree/gsoc2018
Differential Revision:	https://reviews.freebsd.org/D27398
2020-12-12 18:34:15 +00:00
Mitchell Horne
d46a2a0013 riscv: allow building virtual machine images
RISC-V has the same booting requirements as arm64 (loader.efi, no legacy
boot options), so generated images for both architectures have the same
partition layout.

Reviewed by:	gjb
Differential Revision:	https://reviews.freebsd.org/D27044
2020-12-08 00:37:11 +00:00
Hiroki Sato
6c9838ca71 Fix the source directory when installing the results. The install
target did not install them actually.

Spotted by:	Thomas Munro, bapt, yuripv
2020-12-07 04:45:29 +00:00