Commit Graph

9560 Commits

Author SHA1 Message Date
Dimitry Andric
dbc822f3bc Merge llvm-project release/14.x llvmorg-14.0.0-2-g3f43d803382d
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.0-2-g3f43d803382d.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:46:31 +02:00
Dimitry Andric
fb03ea46eb Merge llvm-project release/14.x llvmorg-14.0.0-rc4-2-gadd3ab7f4c8a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.0-rc4-2-gadd3ab7f4c8a.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:46:23 +02:00
Dimitry Andric
a1f13cbcbb Apply libc++ fix for firefox visibility push/pop issue
Merge commit 7ab1ab0db401 from llvm git (by Dimitry Andric):

  [libc++] Make __dir_stream visibility declaration consistent

  The class `__dir_stream` is currently declared in two places: as a
  top-level forward declaration in `directory_iterator.h`, and as a friend
  declaration in class `directory_entry`, in `directory_entry.h`.

  The former has a `_LIBCPP_HIDDEN` attribute, but the latter does not,
  causing the Firefox build to complain about the visibility not matching
  the previous declaration. This is because Firefox plays games with
  pushing and popping visibility.

  Work around this by making both `__dir_stream` declarations consistently
  use `_LIBCPP_HIDDEN`.

  Reviewed By: ldionne, philnik, #libc

  Differential Revision: https://reviews.llvm.org/D121639
2022-05-14 13:46:21 +02:00
Dimitry Andric
d781ede639 Merge llvm-project release/14.x llvmorg-14.0.0-rc2-12-g09546e1b5103
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.0-rc2-12-g09546e1b5103.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:46:11 +02:00
Dimitry Andric
d56accc7c3 Merge llvm-project release/14.x llvmorg-14.0.0-rc1-74-g4dc3cb8e3255
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.0-rc1-74-g4dc3cb8e3255.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:45:57 +02:00
Dimitry Andric
8885dff6ce Apply fix for asm constraint error in www/php80-opcache
Merge commit 027c16bef4b7 from llvm git (by Nick Desaulniers):

  [X86ISelLowering] permit BlockAddressSDNode "i" constraints for PIC

  When building 32b x86 code as PIC, the existing handling of "i"
  constraints is conservative since generally we have to go through the
  GOT to find references to functions.

  But generally, BlockAddresses from C code refer to the Function in the
  current TU.  Permit BlockAddresses to be used with the "i" constraint
  for those cases.

  I regressed this in
  commit 4edb9983cb8c ("[SelectionDAG] treat X constrained labels as i for asm")

  Fixes: https://github.com/llvm/llvm-project/issues/53868

  Reviewed By: efriedma, MaskRay

  Differential Revision: https://reviews.llvm.org/D119905
2022-05-14 13:45:37 +02:00
Dimitry Andric
1838bd0f48 Merge llvm-project release/14.x llvmorg-14-init-18315-g190be5457c90
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18315-g190be5457c90.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:45:25 +02:00
Dimitry Andric
1fd87a682a Merge llvm-project main llvmorg-14-init-18294-gdb01b123d012
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18294-gdb01b123d012, the last commit before
the upstream release/14.x branch was created.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:47 +02:00
Dimitry Andric
04eeddc0aa Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:34 +02:00
Dimitry Andric
0eae32dcef Merge llvm-project main llvmorg-14-init-13186-g0c553cc1af2e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-13186-g0c553cc1af2e.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:01 +02:00
Dimitry Andric
4824e7fd18 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
2022-05-14 13:43:49 +02:00
Dimitry Andric
5e801ac66d 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
2022-05-14 13:43:32 +02:00
Dimitry Andric
349cc55c97 Merge llvm-project main llvmorg-14-init-10186-gff7f2cfa959b
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10186-gff7f2cfa959b.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:05 +02:00
Eric van Gyzen
20917cac7b sysv test: properly wait for children
In the msg and shm tests, if the child exited before the parent
entered sigsuspend(), the test would hang and time out.  This was
also a problem in the sem test, but the misuse of atf_tc_pass()
masked it.  Adding a short sleep before the sigsuspend() calls made
the hang 100% reliable.  With the same sleep in the new version,
the test passes reliably.

Remove calls to atf_tc_pass().  The call in the sem test broke the test
by exiting prematurely, after only one child out of five had finished.
The other two were harmless but unhelpful.

Reduce a one-second sleep to a more reasonable duration so I can quickly
run many iterations of the test.

Where feasible, assert that wait() returns the child PID.  While I'm here,
use the more succinct ATF_REQUIRE* instead of if/atf_tc_fail/else.

Flush stdout before forking to avoid double-flush.

Use errx() when errno is irrelevant.

Don't use ATF_REQUIRE* in children.  Apparently, the output doesn't
get saved.  The exit status works, so it fails correctly, but silently.

Re-enable the test in CI.

PR:		233649
Reviewed by:	markj (previous version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35187
2022-05-13 11:38:26 -05:00
Cy Schubert
4fe1295c96 sqlite3: Vendor import of sqlite3 3.38.5
Changes at https://www.sqlite.org/releaselog/3_38_5.html.

Obtained from https://www.sqlite.org/2022/sqlite-autoconf-3380500.tar.gz.

Merge commit 'b562e59e27efbea397bdc8782dfceaa3c0e23542'
2022-05-12 12:25:36 -07:00
Stefan Eßer
bbd60e2c94 contrib/bc: update to version 5.2.5
This is a production release that fixes this bc's behavior on ^D to
match GNU bc.

Merge commit 'ed0603704174b01c25b49efc08c82e1532dc5622'

MFC after:	3 days
2022-05-10 15:16:19 +02:00
Stefan Eßer
aaa77b3a36 contrib/bc: revert commit f4ff1c300e
This commit was executed by accident while testing the new version.
2022-05-10 15:11:49 +02:00
Stefan Eßer
f4ff1c300e vendor/bc: import of version 5.2.5
This is a production release that fixes this bc's behavior on ^D to
match GNU bc.

(cherry picked from commit ed06037041)
2022-05-10 14:50:29 +02:00
Ed Maste
c40e434988 libcxxrt: Insert padding in __cxa_dependent_exception
Padding was added to __cxa_exception in 45ca8b19 and
__cxa_dependent_exception needs the same layout.
Add some static_asserts to detect this in the future.

Merge of libcxxrt commit b00c6c564357
2022-04-27 09:41:26 -04:00
Baptiste Daroussin
0a736f0a6a ASAN: reduce verbosity
When running binaries compiled with libasan in PIE and with ALSR on,
the previous code always print the WARNING message, the new code only
printed it if the run is made with the right verbosity

Before this change, many unit test will always fail because of the extra
message which is printed

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35055
MFC after:	2 weeks
2022-04-25 15:41:32 +02:00
Simon J. Gerraty
2f2a5ecdf8 Merge bmake-20220418
o ignore '.POSIX:' if not in first non-comment line
        of Makefile as specified by POSIX.
        add unit-tests for above.

Merge commit '92bfae0e6bd53a7a0d6fe55e70a916d86cf26e8b'
2022-04-22 13:42:11 -07:00
Alfonso S. Siciliano
b9e5884ef7
bsddialog(3): fix disabled shadow
Fix dialogs building and updating fault with disabled shadow
(conf.shadow=false and implicitly bsddialog --no-shadow).

While here delete WARNS=2: all warnings were fixed in upstream and
imported in 0.2.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34958
2022-04-20 17:52:04 +02:00
Dimitry Andric
434215c26d Merge libcxxrt commit 45ca8b1942090226ba9368caeeeabc0d4ee41ad6
Insert padding in __cxa_exception struct for compatibility

  Similar to https://github.com/llvm/llvm-project/commit/f2a436058fcb, the
  addition of __attribute__((__aligned__)) to _Unwind_Exception (in commit
  b9616964) causes implicit padding to be inserted before the unwindHeader
  field in __cxa_exception.

  Applications attempt to get at the earlier fields in __cxa_exception, so
  preserve the same negative offsets in __cxa_exception, by moving the
  padding to the beginning of the struct.

  The assumption here is that if the ABI is not aware of the padding
  before unwindHeader and put the referenceCount/primaryException in
  there, no padding should exist before unwindHeader.

This should make libreoffice's custom exception handling mechanisms work
correctly, even if it was built against an older cxxabi.h/unwind.h pair.

PR:		263370
MFC after:	3 days
2022-04-19 18:11:11 +02:00
Simon J. Gerraty
cc9e659077 Merge bearssl-20220418
Main change is a callback for checking validity period of certificates.

Merge commit 'f6acb9b9f81c96ae7c9592bee1bb89c4357cc3e5'

Add -DHAVE_BR_X509_TIME_CHECK to libsecureboot/Makefile.inc
2022-04-18 14:52:30 -07:00
Stefan Eßer
b85b9c88eb contrib/bc: import version 5.2.4
This update fixes an issue in input line editing: when going left to
the start of the line, the cursor would jump to the end of the line
instead.

Merge commit 'bc75dcc4ce682562390fa32e7cd63c08160e21b9'
2022-04-17 13:30:22 +02:00
Baptiste Daroussin
7f39937557 libedit: import version of 2022-04-11
It includes improvements in the libreadline compatibility and a change
from pstef@ which fixes filename autocompletion for strings like a\)b
2022-04-14 16:46:47 +02:00
Cy Schubert
1e0ca65a3b wpa: Correctly call pcap_next_ex()
The second argument to pcap_next_ex() is a pointer to a pointer.
Not a pointer. This fixes a wpa_supplicent SIGSEGV.

PR:		263266
Reported by:	Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Fixes:		6e5d01124f
MFC:		immediately
2022-04-14 06:16:45 -07:00
Martin Matuska
7ec51a3e2b libarchive: import changes from upstream
Libarchive 3.6.1

Bug fixes:
  PR #1549: archive_digest: check return value of EVP_DigestInit()

PR:		263146 (exp-run)
MFC after:	1 week
2022-04-12 20:14:04 +02:00
Cy Schubert
6e5d01124f wpa/hostapd: Fix 100% CPU when USB wlan NIC removed
hostapd calls pcap_next(3) to read the next packet off the wlan interface.
pcap_next() returns a pointer to the packet header but does not indicate
success or failure. Unfortunately this results in an infinite loop (100%
CPU) when the wlan device disappears, i.e. when a USB wlan device is
manually removed or a USB error results in the device removal. However
pcap_next_ex(3) does return success or failure. To resolve this we use
pcap_next_ex(), forcing hostapd to exit when the error is encountered.

An error message is printed to syslog or stderr when debugging (-d flag)
is enabled. Unfortunately wpa_printf() only works when debugging is enabled.

PR:		253608
Reported by:	Damjan Jovanovic <damjan.jov@gmail.com>,
		bz (privately)
MFC after:	3 days
2022-04-04 06:11:28 -07:00
Alfonso S. Siciliano
9225c909fb
bsddialog(1): Improve --hline (help subtitle)
Improvement for bsdconfig(8): avoid to draw delimiters (or spaces) on
the bottom line if the argument of --hline is an empty string.
2022-04-03 22:26:50 +02:00
Simon J. Gerraty
1d3f2ddc32 Merge bmake-20220330
Merge commit 'a052cb432096794be5070dc68a2b302eaf5a4783'
2022-04-03 12:58:43 -07:00
Martin Matuska
9f690fcfdc libarchive: merge vendor bugfixes
Bugfixes:
  IS #1685 and OSS-Fuzz #38764 (security):
    (ISO reader) fix possible heap buffer overflow in read_children()
  IS #1715 and OSS-Fuzz #46279 (security):
    (RARv4 reader) fix heap-use-after-free in run_filters()

MFC after:	3 days
2022-04-03 14:21:28 +02:00
Piotr Kubaj
57b6ac48a9 powerpc: implement __clear_cache
Merge LLVM commit 81f5c6270cdfcdf80e6296df216b696a7a37c8b5.

This fixes runtime of most notably pcre libraries (currently patched in ports),
and probably also other ports since currently __clear_cache() just calls
SIGABRT on powerpc.

MFC after:	3 days
Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D34736
2022-04-02 12:47:19 +02:00
Xin LI
7ed8e142a0 MFV 45916e7c91: libbsdxml (expat) 2.4.7
Update contrib/expat from 2.4.6 to 2.4.7.

MFC after:	2 weeks
Relnotes:	yes
2022-03-27 22:22:07 -07:00
Mateusz Guzik
30ed48b0a5 clang: Skip attempts to access /proc/self/fd
In contrast to Linux it does not provide entries which can be readlinked
-- these are just regular files, not giving the expected outcome. That's
on top of procfs not being mounted by default to begin with.

Reviewed by:	dim
Differential Revision:		https://reviews.freebsd.org/D34684
2022-03-27 18:01:38 +00:00
Martin Matuska
0c9c2eb394 libarchive: merge vendor bugfixes
Bugfixes:
  IS #1672 and OSS-Fuzz #38766:
    (zip reader) fix possible out-of-bounds read in zipx_lzma_alone_init()
  PR #1676: (mtree reader) remove the unused variable "detected_bytes"
  PR #1674: (doc) fix use of At mdoc(7) macro in cpio.5

MFC after:	3 days
2022-03-26 11:11:14 +01:00
John Baldwin
931983ee08 x86: Add a NT_X86_SEGBASES register set.
This register set contains the values of the fsbase and gsbase
registers.  Note that these registers can already be controlled
individually via ptrace(2) via MD operations, so the main reason for
adding this is to include these register values in core dumps.  In
particular, this will enable looking up the value of TLS variables
from core dumps in gdb.

The value of NT_X86_SEGBASES was chosen to match the value of
NT_386_TLS on Linux.  The notes serve similar purposes, but FreeBSD
will never dump a note equivalent to NT_386_TLS (which dumps a single
segment descriptor rather than a pair of addresses) and picking a
currently-unused value in the NT_X86_* range could result in a future
conflict.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34650
2022-03-24 11:36:19 -07:00
Piotr Kubaj
9b597132ae Merge LLVM commit c03fdd340356 to fix lang/rust on powerpc
Summary:
Without it building rust fails with:
ld: error: CallSiteSplitting.cpp:(function llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >::operator=(llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >&&): .text._ZN4llvm15SmallVectorImplINSt3__14pairIPNS_10BasicBlockENS_11SmallVectorINS2_IPNS_8ICmpInstEjEELj2EEEEEEaSEOSB_+0xB0): relocation R_PPC_PLTREL24 out of range: -33582208 is not in [-33554432, 33554431]

This will need to be merged to releng/13.1.

Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D34652
MFC after:	3 days
2022-03-24 09:06:12 +01:00
John Baldwin
b2cb74c22c arm,arm64: Add a NT_ARM_TLS read-only register set.
This register set exposes the per-thread TLS register.  It matches the
layout used by Linux on arm64.  Linux does not implement this note for
32-bit arm.

Reviewed by:	andrew, markj
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34595
2022-03-23 13:33:06 -07:00
Dimitry Andric
7819a911ff Merge libcxxrt commit f2e55091e2e878386c9f7974d4922bbdc4faed84
Fix unlock in two-word version and add missing comment.

  Fixes #15
  Fixes #16

This should fix the hangs in __cxa_guard_acquire() reported on i386 (and
possibly other 32-bit platforms).

Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/f2e5509
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-20 22:34:41 +01:00
Dimitry Andric
bfffb66e7f Reapply libcxxrt atomics cleanup commit, preparing for upstream fix
This reapplies upstream commit fd484be, as there is a follow-up fix for
the possible hangs in __cxa_guard_acquire() on i386:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-20 22:25:35 +01:00
Dimitry Andric
8e72f458c6 Fix llvm build after 1b3bef43e3, due to API change
After merging llvm commit b9ca73e1a8fd for PR 262608, it would fail to
compile with:

/usr/src/contrib/llvm-project/llvm/lib/IR/Operator.cpp:197:22: error: no member named 'isZero' in 'llvm::APInt'
   if (!IndexedSize.isZero()) {
        ~~~~~~~~~~~ ^

Upstream refactored their APInt class, and isZero() was one of the newer
methods which did not yet exist in llvm 13.0.0. Fix this by using the
older but equivalent isNullValue() method instead.

Fixes:		1b3bef43e3
MFC after:	3 days
2022-03-20 00:12:58 +01:00
Dimitry Andric
1b3bef43e3 Apply llvm fix for assertion compiling certain versions of Wine
Merge commit b9ca73e1a8fd from llvm git (by Stephen Tozer):

  [DebugInfo] Correctly handle arrays with 0-width elements in GEP salvaging

  Fixes an issue where GEP salvaging did not properly account for GEP
  instructions which stepped over array elements of width 0 (effectively a
  no-op). This unnecessarily produced long expressions by appending
  `... + (x * 0)` and potentially extended the number of SSA values used
  in the dbg.value. This also erroneously triggered an assert in the
  salvage function that the element width would be strictly positive.
  These issues are resolved by simply ignoring these useless operands.

  Reviewed By: aprantl

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

PR:		262608
Reported by:	Damjan Jovanovic <damjan.jov@gmail.com>
MFC after:	3 days
2022-03-19 20:59:04 +01:00
Dimitry Andric
2548237983 Revert upstream libcxxrt commit which can cause hangs on i386
This reverts upstream commit fd484be:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

It looks like there are some corner cases in the i386 and/or 32-bit
atomics handling, which can make __cxa_guard_acquire() hang in certain
situations.

Reported by:	antoine
Obtained from:	https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes:		56aaed388b
MFC after:	2 weeks
2022-03-19 20:47:29 +01:00
Philip Paeps
8ea5af2b77 contrib/tzdata: import tzdata 2022a
Merge commit '971fa603f2bdf16273135a00ff16c5585520c53f'

Changes: https://github.com/eggert/tz/blob/2022a/NEWS

MFC after:	3 days
2022-03-17 11:30:12 +08:00
Tom Jones
81e0e7b9e3 bsnmp: Use mkstemp when creating clients local socket
Reviewed by:	harti, rew
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #72
Differential Revision:	https://reviews.freebsd.org/D34550
2022-03-15 08:20:13 +00:00
Piotr Kubaj
3781e77995 riscv: actually enable sanitizers
1. Backport b475ce39e8.
2. Enable libclang_rt for riscv.

Previous commit missed it.

MFC after:	3 days
Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D34543
2022-03-13 13:06:57 +01:00
Alfonso S. Siciliano
bce40c0242
Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f' 2022-03-13 02:38:51 +01:00
Dimitry Andric
56aaed388b Merge libcxxrt master fd484be8d1e94a1fcf6bc5c67e5c07b65ada19b6
Interesting fixes:
47661d0 Match libc++abi/libsupc++ when demangling array types
e44a05c Fix unitialized variable in __cxa_demangle_gnu3 after #6 (#8)
5088b05 Remove some code duplication.
fd484be Atomics cleanup (#11)

MFC after:	2 weeks
2022-03-09 20:45:01 +01:00
Stefan Eßer
b66d67d97a contrib/bc: include assert.h when building with C11 or newer
This chunk should have been committed with the MFV commit
23210c9f42 but was missing for an unknown reasn.

MFC after:	3 days
2022-03-09 18:57:30 +01:00
Dimitry Andric
72df847a94 Remove compat hacks from libcxxrt's _Unwind_Exception
This reverts 9097e3cbca, which was in itself a revert of upstream
libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM
unwind") and b96169641f79 ("Updated Itanium unwind"), and a
reapplication of our commit 3c4fd2463b ("libcxxrt: add padding in
__cxa_allocate_* to fix alignment").

The editors/libreoffice port will be patched to be able to cope with the
standards-compliant alignment of _Unwind_Exception and consequently,
that of __cxa_exception. The layouts and sizes of these structures
should then be completely the same for libcxxrt, libunwind and
libc++abi.

PR:		262008
Reviewed by:	emaste, jhb, theraven
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D34488
2022-03-09 18:25:18 +01:00
Stefan Eßer
23210c9f42 contrib/bc: update to version 5.2.3
This version fixes a parse error when passing a file to bc using -f
if that file has a multiline comment or string in it.

Merge commit '3673adf1ee311d6f83176d3e43cf0efb314764e4'

MFC after:	3 days
2022-03-07 23:26:09 +01:00
Mateusz Piotrowski
dd74471e49 ctime.3: Add a cross-reference to clock_gettime(2)
MFC after:	1 week
2022-03-04 17:49:34 +01:00
Eric van Gyzen
ac69e5d471 MFV d1b143ee9a: libbsdxml (expat) 2.4.6
Update contrib/expat from 2.4.3 to 2.4.6 to fix multiple vulnerabilities.

Reviewed by:	delphij
MFC after:	2 weeks
Relnotes:	yes
Security:	yes; see contrib/expat/Changes since 2.4.3
Sponsored by:	Dell EMC Isilon
2022-03-02 16:40:47 -06:00
Dimitry Andric
298c3e8d6b Apply lld fixes for internal errors building perl on 32-bit PowerPC
Merge commit f457863ae345 from llvm git (by Fangrui Song):

  [ELF] Support REL-format R_AARCH64_NONE relocation

  -fprofile-use=/-fprofile-sample-use= compiles may produce REL-format
  .rel.llvm.call-graph-profile even if the prevailing format is RELA on AArch64.
  Add R_AARCH64_NONE to getImplicitAddend to fix this linker error:

  ```
  ld.lld: error: internal linker error: cannot read addend for relocation R_AARCH64_NONE
  PLEASE submit a bug report to https://crbug.com and run tools/clang/scripts/process_crashreports.py (only works inside Google) which will upload a report and include the crash backtrace.
  ```

Merge commit 53fc5d9b9a01 from llvm git (by Fangrui Song):

  [ELF] Support R_PPC_NONE/R_PPC64_NONE in getImplicitAddend

  Similar to f457863ae345d2635026501f5383e0e625869639

Merge commit 767e64fc11d7 from llvm git (by Fangrui Song):

  [ELF] Support some absolute/PC-relative relocation types for REL format

  ctfconvert seems to use REL-format `.rel.SUNW_dof` for 32-bit architectures.
  ```
  Binary file usr/ports/lang/perl5.32/work/perl-5.32.1/dtrace_mini.o matches
  [alfredo.junior@dell-a ~/tmp/llvm-bug]$ readelf -r dtrace_mini.o

  Relocation section (.rel.SUNW_dof):
  r_offset r_info   r_type              st_value st_name
  00000184 0000281a R_PPC_REL32         00000000 $dtrace1772974259.Perl_dtrace_probe_load
  ```

  Support R_PPC_REL32 to fix `ld.lld: error: drti.c:(.SUNW_dof+0x4E4): internal linker error: cannot read addend for relocation R_PPC_REL32`.
  While here, add some common relocation types for AArch64, PPC, and PPC64.
  We perform minimum tests.

  Reviewed By: adalava, arichardson

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

Requested by:	alfredo
MFC after:	3 days
2022-02-27 13:53:19 +01:00
Piotr Pawel Stefaniak
9b6a8ee28d tcp_wrappers: remove duplicate errno declarations 2022-02-23 16:26:14 +01:00
Piotr Pawel Stefaniak
7d636a4d3e tcp_wrappers: include <unistd.h>
This is for getdomainname(3).
2022-02-23 16:26:14 +01:00
Ed Maste
817e68d8e6 readelf: add Arm address mask note type NT_ARM_ADDR_MASK
Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34346
2022-02-22 14:50:42 -05:00
Piotr Kubaj
884ba43116 powerpc: enable initial-exec TLS
Summary:
Use initial-exec, like other architectures.

While here, switch MACHINE_ARCH in lib/libc/Makefile to LIBC_ARCH and consistently use powerpc.

Subscribers: imp, #contributor_reviews_base

Differential Revision: https://reviews.freebsd.org/D34315
Reviewed by:	luporl
MFC after:	2 weeks
2022-02-22 19:34:28 +01:00
Martin Matuska
5ccf909af9 libarchive: merge vendor bugfix
OSS-Fuzz #44843 (security):
RAR reader: fix null-dereference in RAR (v4) filter code

X-MFC-with:	833a452e9d
2022-02-21 12:06:54 +01:00
Martin Matuska
47a2e541dc libarchive: merge vendor bugfixes
Bugfixes:
OSS-Fuzz #44547: fix heap-use-after-free in RAR (v4) filter code
PR #1671: Fix 7z PPMD reading beyond boundary

X-MFC-with: 833a452e9d
2022-02-19 01:00:15 +01:00
Cy Schubert
9cf5bc93f6 unbound: Vendor import 1.15.0
Vendor import GA release of unbound 1.15.0.

MFC after:      2 weeks
2022-02-17 16:05:15 -08:00
Cy Schubert
3574dc0bd8 unbound: Vendor import 1.15.0 2022-02-17 14:47:14 -08:00
Cy Schubert
0640e0c196 unbound: Refresh manpages to latest version
Update unbound manpages by copying the current unbound manpages in
contrib/doc/*.in to their respective manpages,

PR:		262013
Reported by:	Michael Osipov <michael.osipov@siemens.com>
Fixes:		numerous previous updates
MFC after:	3 days
2022-02-17 09:05:34 -08:00
Simon J. Gerraty
c4bf04f40b cc-wrap.mk: fix typo in modifiers 2022-02-16 15:21:27 -08:00
Ed Maste
089eb4ead8 readelf: add newer Linux core arm note types
Sponsored by:	The FreeBSD Foundation
2022-02-16 11:02:02 -05:00
Eric van Gyzen
4e71258227 newfs_msdos: connect the ATF test from NetBSD
NetBSD has an ATF test for newfs_msdos.  Connect it to the build.
Adapt it for FreeBSD.  This would have caught the bug fixed by my
previous commit.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116
2022-02-16 09:56:16 -06:00
Martin Matuska
833a452e9f libarchive: import changes from upstream
Libarchive 3.6.0

New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support

Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
   fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
   extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries

MFC after:	2 weeks
Relnotes:	yes
2022-02-10 00:35:42 +01:00
Simon J. Gerraty
a6f0e10b24 Merge bmake-20220208
* unit-tests/Makefile: disable opt-debug-x-trace on Linux if there
        is any chance we have dash as .SHELL

        * meta.c: use a variable to hold command line to be filtered
        to avoid any side effects from content of command line.

Merge commit '535c59a6a9214436f5d6643775d29808e4b3408d'
2022-02-09 09:31:30 -08:00
Martin Matuska
84631082f6 Update vendor/libarchive libarchive/libarchive@9147def1d
Libarchive 3.6.0

New features:
  PR #1614: tar: new option "--no-read-sparse"
  PR #1503: RAR reader: filter support
  PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
  PR #1567: tar: threads support for zstd (#1567)
  PR #1518: ZIP reader: zstd decompression support

Security Fixes:
  PR #1491, #1492, #1493, CVE-2021-36976:
    fix invalid memory access and out of bounds read in RAR5 reader
  PR #1566, #1618, CVE-2021-31566:
    extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
  PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
  PR #1625: reduced size of application binaries

Obtained from:		libarchive
Libarchive commit:	9147def1da7ad1bdd47b3559eb1bfeeb0e0f374b
Libarchive tag:		v3.6.0
2022-02-09 14:20:23 +01:00
Ed Maste
d940e94121 bmake: make opt-debug-x-trace broken on Linux
It fails during GitHub cross-build actions from Ubuntu 20.04.

sjg investigated and found it is a dash bug; a more extensive change
to handle this case will come in the next bmake update.

Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D34219
2022-02-08 22:19:59 -05:00
Dimitry Andric
1c21bfb1b1 Apply fix for ThreadSanitizer false positive data race reports
Merge commit 28fb22c90fe7 from llvm git (by Dimitry Andric):

  [TSan] Handle FreeBSD specific indirection of libpthread functions

  Similar to 60cc1d3218fc for NetBSD, add aliases and interceptors for the
  following pthread related functions:

  - pthread_cond_init(3)
  - pthread_cond_destroy(3)
  - pthread_cond_signal(3)
  - pthread_cond_broadcast(3)
  - pthread_cond_wait(3)
  - pthread_mutex_init(3)
  - pthread_mutex_destroy(3)
  - pthread_mutex_lock(3)
  - pthread_mutex_trylock(3)
  - pthread_mutex_unlock(3)
  - pthread_rwlock_init(3)
  - pthread_rwlock_destroy(3)
  - pthread_rwlock_rdlock(3)
  - pthread_rwlock_tryrdlock(3)
  - pthread_rwlock_wrlock(3)
  - pthread_rwlock_trywrlock(3)
  - pthread_rwlock_unlock(3)
  - pthread_once(3)
  - pthread_sigmask(3)

  In FreeBSD's libc, a number of internal aliases of the pthread functions
  are invoked, typically with an additional prefixed underscore, e.g.
  _pthread_cond_init() and so on.

  ThreadSanitizer needs to intercept these aliases too, otherwise some
  false positive reports about data races might be produced.

  Reviewed By: dvyukov

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

MFC after:	3 days
2022-02-07 19:39:02 +01:00
Ed Maste
d21e71efce dma: use canonical getline() loop
getline() returns -1 on erorr or EOF, so use that condition instead of
feof() and check that there was no error after the loop exits.

Reviewed by:	bapt, kevans (both earlier)
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34159
2022-02-05 21:55:03 -05:00
Stefan Eßer
00698711de vendor/bc: import release 5.2.2
This release assigns a default value to the internal program name
variable in case the program is invoked with argv[0] == NULL.

There was no security issue: the prevuous program version would have
been immediately terminated due to a NULL dereference.
2022-02-05 22:39:59 +01:00
Simon J. Gerraty
9f45a3c8c8 Merge bmake-20220204 2022-02-05 12:26:16 -08:00
Ed Maste
930a7c2ac6 compiler-rt: re-exec with ASLR disabled when necessary
Some sanitizers (at least msan) currently require ASLR to be disabled.
When we detect that ASLR is enabled, re-exec with it disabled rather
than exiting with an error.  See LLVM GitHub issue 53256 for more
detail: https://github.com/llvm/llvm-project/issues/53256

No objection:	dim
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33934
2022-02-04 11:20:00 -05:00
Ed Maste
96fe7c8ab0 compiler-rt: support ReExec() on FreeBSD
Based on getMainExecutable() in llvm/lib/Support/Unix/Path.inc.
This will need a little more work for an upstream change as it must
support older FreeBSD releases that lack elf_aux_info() / AT_EXEC_PATH.

No objection:	dim
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33934
2022-02-04 11:18:12 -05:00
Toomas Soome
658a47d1ef contrib/terminus: update to terminus-font-4.49.1 2022-02-02 15:42:18 +02:00
Gregory Neil Shapiro
e58d0869c6 Update commit instructions. Still more TBD as I plan out the first
git-based vendor import.
2022-01-30 22:20:12 +00:00
Dimitry Andric
fdf2784101 Apply clang fix for assertion failure compiling science/chrono
Merge commit 6b0f35931a44 from llvm git (by Jennifer Yu):

  Fix signal during the call to checkOpenMPLoop.

  The root problem is a null pointer is accessed during the call to
  checkOpenMPLoop, because loop up bound expr is an error expression
  due to error diagnostic was emit early.

  To fix this, in setLCDeclAndLB, setUB and setStep instead return false,
  return true when LB, UB or Step contains Error, so that the checking is
  stopped in checkOpenMPLoop.

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

Note this only fixes the assertion reported in bug 261567; some other
tweaks for port dependencies are probably still required to make it
build to completion.

PR:		261567
MFC after:	3 days
2022-01-30 21:41:37 +01:00
Dimitry Andric
9738bc28ab Apply llvm fix for assertion failure compiling recent libc++
Merge commit c7c84b90879f from llvm git (by Adrian Prantl):

  [DwarfDebug] Refuse to emit DW_OP_LLVM_arg values wider than 64 bits

  DwarfExpression::addUnsignedConstant(const APInt &Value) only supports
  wider-than-64-bit values when it is used to emit a top-level DWARF
  expression representing the location of a variable. Before this change,
  it was possible to call addUnsignedConstant on >64 bit values within a
  subexpression when substituting DW_OP_LLVM_arg values.

  This can trigger an assertion failure (e.g. PR52584, PR52333) when it
  happens in a fragment (DW_OP_LLVM_fragment) expression, as
  addUnsignedConstant on >64 bit values splits the constant into separate
  DW_OP_pieces, which modifies DwarfExpression::OffsetInBits.

  This change papers over the assertion errors by bailing on overly wide
  DW_OP_LLVM_arg values. A more comprehensive fix might be to be to split
  wide values into pointer-sized fragments.

  [0] https://github.com/llvm/llvm-project/blob/e71fa03/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp#L799-L805

  Patch by Ricky Zhou!

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

MFC after:	3 days
2022-01-29 22:28:24 +01:00
Ed Maste
1c91aedf25 dma: exit if invoked with invalid (zero) argc
This was prompted by the recent pkexec vulnerability (CVE-2021-4034).
This change is being made on general principle for setuid/setgid
binaries and is not in response to an actual issue.

Reviewed by:	kevans, markj (both earlier)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34087
2022-01-28 17:49:45 -05:00
Ed Maste
1a0dde338d dma: limit lines to 998 characters
Per RFC2822 the maximum transmitted line length is "998 characters...
excluding the CRLF."  In a file the maximum is 999 with the \n included.

Previously mail containing a line with exactly 999 characters would
bounce.

PR:		208261
Reported by:	Helge Oldach
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-01-28 10:02:43 -05:00
Alfonso Siciliano
263660c061 bsddialog: import version 0.1
Import bsddialog 0.1 Utility and Library, fully refatorized, API stable,
manuals completed, easier to maintain and improve.

Update deps for new API:
add mixedgauge consts, delete __DECONST and add bsddialog_geterror()
info to avoid silent errors

* tzsetup
* kbdmap
* distextract

Differential Revision:	https://reviews.freebsd.org/D34066
2022-01-28 09:56:21 +01:00
Ed Maste
d045091ea2 dma: update to 2022-01-27 snapshot 2022-01-27 14:35:07 -05:00
Gordon Bergling
4731124cac bsnmp: Fix two typos in error messages
- s/responce/response/

MFC after:	1 week
2022-01-26 20:25:40 +01:00
Cy Schubert
273016e836 unbound: Vendor import 1.14.0
Vendor import GA release of unbound 1.14.0.

MFC after:      2 weeks

Merge commit '9b87431a326169e72d5ca55670cb3c95205aa350' into unbound/main
2022-01-23 21:58:36 -08:00
Ed Maste
7cafe89f9c sanitizers: Improve FreeBSD ASLR detection
The kern.elf64.aslr.pie_enable and kern.elf32.aslr.pie_enable sysctls
control the default setting for PIE binary address randomization, but
it is possible to enable or disable ASLR on a per-process basis.  Use
procctl(2) to query whether ASLR is enabled.

(Note that with ASLR enabled but sysctl kern.elf64.aslr.pie_enable=0
a PIE binary will in effect have randomization disabled, and be
functional with msan.  This is not intended as as a user-facing control
though.  The user can use proccontrol(1) to disable aslr for the
process.)

Approved by:	dim
Obtained from:	LLVM 64de0064f315f57044294879d9ff4eacb454d45b
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33933
2022-01-19 13:07:40 -05:00
Alfonso Siciliano
8ea2d22e6d bsddialog: Fix for terminals without colours
When running the installer, in particular disextract (which is so far
the only part converted to bsddialog), on serial console or vt100 or
actually any terminal without color support, it failed to start.

This change makes bsddialog fallback on the black and white theme.

This is incorporated in newer version of bsddialog which will be
imported soon.

PR:		261272
Reported by:	thj
Differential Revision:	https://reviews.freebsd.org/D33920
2022-01-19 09:28:42 +01:00
Cy Schubert
ec080394e2 wpa: Import wpa 2.10.
The long awaited hostapd 2.10 is finally here.

MFC after:      3 weeks
2022-01-18 08:17:08 -08:00
Cy Schubert
64e33c5cb1 Revert "wpa: Import wpa 2.10."
This reverts commit 5eb81a4b40, reversing
changes made to c6806434e7 and
this reverts commit 679ff61123.

What happend is git rebase --rebase-merges doesn't do what is expected.
2022-01-18 08:10:33 -08:00
Cy Schubert
5eb81a4b40 wpa: Import wpa 2.10.
The long awaited hostapd 2.10 is finally here.

MFC after:	3 weeks
2022-01-18 07:45:39 -08:00
Xin LI
cc68614da8 MFV f83ac37f1e: libbsdxml (expat) 2.4.3. 2022-01-17 16:34:41 -08:00
Mark Johnston
758d98debe exec: Remove the stack gap implementation
ASLR stack randomization will reappear in a forthcoming commit.  Rather
than inserting a random gap into the stack mapping, the entire stack
mapping itself will be randomized in the same way that other mappings
are when ASLR is enabled.

No functional change intended, as the stack gap implementation is
currently disabled by default.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33704
2022-01-17 16:11:54 -05:00
Mark Johnston
95c75073d3 netbsd-tests: Fix the libc stat_socket test
The test tries to connect a socket to a closed port at 127.0.0.1.  It
sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from
connect(2), but this is not guaranteed, ECONNREFUSED is possible.
Handle both cases, and re-enable the test.

PR:		240621
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-01-14 15:01:41 -05:00
Mark Johnston
7bd2df8c82 Revert "Disable flaky test lib.libc.sys.setrlimit_test.setrlimit_stack"
The stack gap implementation is disabled by default now, so the test
passes.

This reverts commit dad71022bd.

PR:		259969
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-01-14 14:58:56 -05:00
Cy Schubert
8778e54cab sqlite3: Vendor import of sqlite3 3.37.2
Changes at https://www.sqlite.org/releaselog/3_37_2.html.

MFC after:	1 month
2022-01-11 08:14:43 -08:00
Cy Schubert
32a95656b5 wpa: Import wpa_supplicant/hostapd commit b26f5c0fe
This is the December/January update to vendor/wpa committed upstream
2021-12-13.

MFC after:	1 month
2022-01-06 10:30:51 -08:00
Cy Schubert
0197ba465f sqlite3: Vendor import of sqlite3 3.37.1
Changes at https://www.sqlite.org/releaselog/3_37_1.html.

Merge commit '7e13a4eb402641ddf307497cc9ac7ce1ab21c2a8' into sqlite3-work2
2022-01-06 06:08:07 -08:00
Cy Schubert
7e13a4eb40 sqlite3: Vendor import of sqlite3 3.37.1
Changes at https://www.sqlite.org/releaselog/3_37_1.html.
2022-01-05 15:26:24 -08:00
Cy Schubert
9b0b0740be sqlite3: Vendor import of sqlite3 3.37.1
Changes at https://www.sqlite.org/releaselog/3_37_1.html.
2022-01-05 11:24:29 -08:00
Xin LI
43a5ec4eb4 file: upgrade to 5.41.
MFC after:	2 weeks
2022-01-03 22:03:39 -08:00
Stefan Eßer
e2650af157 Make CPU_SET macros compliant with other implementations
The introduction of <sched.h> improved compatibility with some 3rd
party software, but caused the configure scripts of some ports to
assume that they were run in a GLIBC compatible environment.

Parts of sched.h were made conditional on -D_WITH_CPU_SET_T being
added to ports, but there still were compatibility issues due to
invalid assumptions made in autoconfigure scripts.

The differences between the FreeBSD version of macros like CPU_AND,
CPU_OR, etc. and the GLIBC versions was in the number of arguments:
FreeBSD used a 2-address scheme (one source argument is also used as
the destination of the operation), while GLIBC uses a 3-adderess
scheme (2 source operands and a separately passed destination).

The GLIBC scheme provides a super-set of the functionality of the
FreeBSD macros, since it does not prevent passing the same variable
as source and destination arguments. In code that wanted to preserve
both source arguments, the FreeBSD macros required a temporary copy of
one of the source arguments.

This patch set allows to unconditionally provide functions and macros
expected by 3rd party software written for GLIBC based systems, but
breaks builds of externally maintained sources that use any of the
following macros: CPU_AND, CPU_ANDNOT, CPU_OR, CPU_XOR.

One contributed driver (contrib/ofed/libmlx5) has been patched to
support both the old and the new CPU_OR signatures. If this commit
is merged to -STABLE, the version test will have to be extended to
cover more ranges.

Ports that have added -D_WITH_CPU_SET_T to build on -CURRENT do
no longer require that option.

The FreeBSD version has been bumped to 1400046 to reflect this
incompatible change.

Reviewed by:	kib
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33451
2021-12-30 12:20:32 +01:00
Dimitry Andric
1331805574 Avoid emitting popcnt in libclang_rt.fuzzer*.a if unsupported
Since popcnt is only supported by CPUTYPE=nehalem and later, ensure that
this instruction is only emitted when appropriate. Otherwise, programs
using the library can abort with SIGILL.

See also: https://github.com/llvm/llvm-project/issues/52893

PR:		258156
Reported by:	Eric Rucker <bhtooefr@bhtooefr.org>
MFC after:	3 days
2021-12-30 10:55:49 +01:00
Ed Maste
ca457394fc readelf: add Go Build ID ELF note support
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33379
2021-12-29 15:30:22 -05:00
Dimitry Andric
ada8b24d48 Apply clang fix for crash or assertion failure compiling part of llvm
Merge commit 77e8f4eeeeed from llvm git (by David Green):

  [ARM] Define ComplexPatternFuncMutatesDAG

  Some of the Arm complex pattern functions call canExtractShiftFromMul,
  which can modify the DAG in-place. For this to be valid and handled
  successfully we need to define ComplexPatternFuncMutatesDAG.

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

When building parts of llvm targeting armv6 on stable/12, the following
assertion can appear (or if assertions are disabled, clang is likely to
crash):

Assertion failed: (NodeToMatch->getOpcode() != ISD::DELETED_NODE && "NodeToMatch was removed partway through selection"), function SelectCodeCommon, file /usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, line 3573.
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /usr/obj/usr/src/freebsd12-amd64/tmp/usr/bin/c++ -cc1 -triple armv6kz-unknown-freebsd12.3-gnueabihf -S --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -mrelocation-model static -mconstructor-aliases -target-cpu arm1176jzf-s -target-feature +vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature -vfp3d16sp -target-feature -vfp3sp -target-feature -fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature -vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature +fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi hard -fallow-half-arguments-and-returns -ffunction-sections -fdata-sections -O1 -std=c++14 -fdeprecated-macro -fno-rtti -fno-signed-char -faddrsig -fexperimental-new-pass-manager PPCISelLowering-009095.ii
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module 'PPCISelLowering-009095.cpp'.
4.	Running pass 'ARM Instruction Selection' on function '@_ZN4llvm17PPCTargetLoweringC2ERKNS_16PPCTargetMachineERKNS_12PPCSubtargetE'

This crash or assertion is fixed by the upstream commit.

MFC after:	3 days
2021-12-24 12:46:00 +01:00
Kyle Evans
a2c51da658 tzcode: fix tz change detection logic
clock_gettime() returns 0 if it succeeds, so don't capture that into the
fail logic.  With this, WITH_DETECT_TZ_CHANGES successfully detects a
change after 61 seconds.

Reviewed by:	imp, trasz
Differential Revision:	https://reviews.freebsd.org/D33494
2021-12-21 12:01:24 -06:00
Baptiste Daroussin
d93b4d3203 bsddialog: import version 0.0.2 2021-12-21 16:13:00 +01:00
Marcin Wojtas
4b97eef0bb Revert "t_setrlimit: Adjust resource limit to 20M"
This reverts commit 4f741801d8.

As per discussion in PR: 260303 the reverted patch covered the
real issue with a fixed address of the top of the stack.
2021-12-20 18:33:06 +01:00
Cy Schubert
5ee61c7daa ipfilter: Remove remaining unused bits
Remove the remaining unused source files. These were never used.

This is the last of a three commit series to move ipfilter.

Discussed with:		glebius
Reviewed by:		glebius, kp (for #network)
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D33510
2021-12-20 06:16:33 -08:00
Cy Schubert
41edb306f0 ipfilter: Move userland bits to sbin
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sbin/ipf. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to sbin.

This is the second of three commits of the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
MFC after:				1 month
Differential Revision:		https://reviews.freebsd.org/D33510
2021-12-20 06:16:33 -08:00
Dawid Gorecki
4f741801d8 t_setrlimit: Adjust resource limit to 20M
With ASLR enabled by default, RLIMIT_STACK test fails due to the fact
that default stack gap can be as big as 15M. Because of that the
resource limit of 4M results in test program receiving SIGSEGV
immediately after exiting the setrlimit syscall. Since the idea of this
test is to check if rlim_cur does not extend past rlim_max, adjusting
the resource limit to 20M should not invalidate the test results.

Obtained from:		Semihalf
Sponsored by:		Alstom Group
Differential revision:	https://reviews.freebsd.org/D33116
2021-12-20 06:28:20 +01:00
Simon J. Gerraty
129043849f Merge bmake-20211212
commit '2935fe8237c83c1dcb113dd5335733263e68e6fd'
2021-12-18 10:09:14 -08:00
Cy Schubert
c610426c4d ipfilter: MSN RPC proxy is not complete
The MSN RPC proxy is incomplete and does not do any address
translation. Remove it.

MFC after:	1 week
2021-12-16 06:51:16 -08:00
Cy Schubert
7aec934fff ipfilter: ipf_dstlist is a kernel source file
Remove duplicate ipf_dstlist.* files. They live in sys/.

MFC after:	1 week
2021-12-15 13:50:38 -08:00
Dimitry Andric
5a925e4644 Apply fix for clang incorrectly optimizing part of dns/bind916
Merge commit e5a8af7a90c6 from llvm git (by Gulfem Savrun Yeniceri):

  [Passes] Fix relative lookup table converter pass

  This patch fixes the relative table converter pass for the lookup table
  accesses that are resulted in an instruction sequence, where gep is not
  immediately followed by a load, such as gep being hoisted outside the loop
  or another instruction is inserted in between them. The fix inserts the
  call to load.relative.instrinsic in the original place of load instead of gep.
  Issue is reported by FreeBSD via https://bugs.freebsd.org/259921.

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

PR:		259921
Reported by:	O. Hartmann <freebsd@walstatt-de.de>
MFC after:	3 days
2021-12-15 22:27:39 +01:00
Cy Schubert
a6fb9bbea7 ipfilter userland: Replace sprintf with range checking version (snprintf)
MFC after:	1 week
2021-12-14 06:19:21 -08:00
Cy Schubert
9a563c5e48 ipfilter: radix_ipf is a kernel source file
Remove duplicate radix_ipf.* files. They live in sys/.

MFC after:	1 week
2021-12-14 06:19:21 -08:00
Mark Johnston
3aa0bc89c6 libdwarf: Add a weak uncompress() symbol
This works around brokenness in buildworld's bootstrapping logic: it
uses the source tree's metadata to collect dependency info (such as,
"libdwarf depends on libz") but links against static host libraries.
If these two are out of sync, as is the case if one builds a commit
prior to the introduction of the libz dependency, then the build fails
when trying to statically link nm(1).

Mitigate the problem by defining a weak uncompress() symbol which simply
returns an error.  This ensures that the build won't fail when
statically linking libdwarf without zlib.  The downside is that any
tools using libdwarf without zlib will now hit a runtime error if they
attempt to decode compressed sections, but at least they'll fail
deterministically, and compressed debug info is only enabled by default
in main.

In particular, this fixes building of branches lacking commit
dbf05458e3, such as releng branches, stable/12 and 13 and old
revisions of main.  Previously the nm(1) build would fail with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233
>>> (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive
>>> /usr/lib/libdwarf.a

Reported by:	dim, ler, krion
Reviewed by:	imp, emaste
Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33419
2021-12-13 18:47:15 -05:00
Mark Johnston
c983ec6428 libdwarf: Fix error handling in _dwarf_elf_init()
We were not setting "ret" before jumping to the error path, so the
function returned success even when it had failed.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33420
2021-12-13 18:46:59 -05:00
Baptiste Daroussin
8c4f402881 bsddialog: import version 0.0.1 2021-12-13 09:01:39 +01:00
Dimitry Andric
da2012af42 Revert clang change that breaks CTF on aarch64
Revert commit e655e74a318e from llvm git (by Peter Collingbourne):

  AST: Create __va_list in the std namespace even in C.

  This ensures that the mangled type names match between C and C++,
  which is significant when using -fsanitize=cfi-icall. Ideally we
  wouldn't have created this namespace at all, but it's now part of
  the ABI (e.g. in mangled names), so we can't change it.

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

As reported by Jessica in https://reviews.llvm.org/D104830#3129527, this
upstream change is implemented in such a way that it breaks DTrace's
CTF. Since a proper fix has not yet been forthcoming, and we are
unaffected by the (CFI-related) problem upstream was trying to address,
revert the change for now.

Requested by:	jrtc27
MFC after:	3 days
2021-12-12 21:11:40 +01:00
Cy Schubert
2169572e74 ippool: remove set-but-not-unused vars
Display of stats from a kernel core dump was never fully implemented.
Remove the dangling vars and remove the documentation.

MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
fe5b077c9e ipfcomp: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
edcdd4f644 ipfilter printfieldhdr: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
9018f7fa45 ipft_tx: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
712b938661 ipft_pc: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
ece1946c1f ipft_hx: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:53 -08:00
Ed Maste
bdcfd222ce Remove FREEBSD-vendor files
These files were intended to track version and perhaps maintainership
information for contrib software.  However, they were never used beyond
bzip2, netcat, and OpenSSH, and generally haven't been kept up to date
recently (my OpenSSH 8.7p1 update notwithstanding).  Just remove them to
avoid having confusing or outdated information.

Suggested by:	des
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-12-06 16:36:44 -05:00
Mark Johnston
dbf05458e3 libdwarf: Support consumption of compressed ELF sections
Automatically decompress zlib-compressed debug sections when loading
them.  This lets ctfcovert work on userland code after commit
c910570e75 ("Use compressed debug in standalone userland debug files
by default").

Reported by:	avg
Reviewed by:	avg, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33139
2021-12-06 10:37:49 -05:00
Baptiste Daroussin
f499134dd4 bsddialog: import snapshot 2021-12-05 2021-12-06 11:43:34 +01:00
Dimitry Andric
a9cd5c30d6 Apply fix for clang crashing on invalid -Wa,-march= values
Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric):

  [AArch64] Avoid crashing on invalid -Wa,-march= values

  As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
  pass -Wa,-march=all to compile a number of assembly files. Clang does
  not support this -march value, but because of a mistake in handling
  the arguments, an unitialized Arg pointer is dereferenced, which can
  cause a segfault.

  Work around this by adding a check if the local WaMArch variable is
  initialized, and if so, using its value in the diagnostic message.

  Reviewed By: tschuett

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

PR:		260078
Reported by:	bz
MFC after:	3 days
2021-12-05 18:54:13 +01:00
Gordon Bergling
e10ac08631 ipfilter(4): Fix a typo in an error message
- s/addresss/address/

This is a direct commit to contrib since the upstream is
no longer active.

MFC after:	3 days
2021-12-04 12:10:39 +01:00
Cy Schubert
24e3652200 unbount: Vendor import 1.14.0rc1
This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by:	glebius
MFC after:	1 week
2021-12-02 22:11:04 -08:00
Cy Schubert
68965ba955 unbound: Vendor import 1.14.0rc1
This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by:	glebius
2021-12-02 21:35:06 -08:00
Cy Schubert
4b72b91a71 wpa: Redo import wpa_supplicant/hostapd commit 14ab4a816
This is the November update to vendor/wpa committed upstream 2021-11-26.

MFC after:	1 month
2021-12-02 15:08:52 -08:00
Cy Schubert
db0ac6ded6 Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"
This reverts commit 266f97b5e9, reversing
changes made to a10253cffe.

A mismerge of a merge to catch up to main resulted in files being
committed which should not have been.
2021-12-02 14:45:04 -08:00
Cy Schubert
266f97b5e9 wpa: Import wpa_supplicant/hostapd commit 14ab4a816
This is the November update to vendor/wpa committed upstream 2021-11-26.

MFC after:      1 month
2021-12-02 13:35:14 -08:00
Stefan Eßer
10041e99a0 contrib/bc: merge version 5.2.1 from vendor branch
Merge commit 'e63540eed295749528548c2e3a90f5a6e57275c8'
2021-11-30 18:40:32 +01:00
Konstantin Belousov
f16ec9c6e3 Add tests for posix_spawn_file_actions_add{chdir,fchdir}_np(3)
Reviewed by:	kevans, ngie (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33143
2021-11-30 03:43:54 +02:00
Konstantin Belousov
e8b6309c70 netbsd h_raw.c test: fake use of sum to avoid warning
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:51 +02:00
Konstantin Belousov
631607ac29 t_mlock.c: Remove null_errno, it is write-only
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:51 +02:00
Li-Wen Hsu
dad71022bd
Disable flaky test lib.libc.sys.setrlimit_test.setrlimit_stack
PR:		259969
Sponsored by:	The FreeBSD Foundation
2021-11-28 14:58:21 +08:00
Baptiste Daroussin
c76f07938c Add 'contrib/bsddialog/' from commit '857c66bb5f3c5651b012beb1b5ea6ba39354ea94'
git-subtree-dir: contrib/bsddialog
git-subtree-mainline: a46722b580
git-subtree-split: 857c66bb5f
2021-11-24 11:03:17 +01:00
Allan Jude
5bbfa333cf ipresend(1): Make the build slightly less broken.
X-NetApp-PR:	35
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D27335
2021-11-22 18:03:24 +00:00
Dimitry Andric
3adc9c8c73 Belatedly update contrib/llvm-project/FREEBSD-Xlist for llvm 13
MFC after:      2 weeks
2021-11-20 18:06:36 +01:00
Martin Matuska
201d0ebee3 libarchive: cherry-pick bugfix from vendor
Vendor commit message (ede459d2e):
  archive_write_disk_posix: fix writing fflags broken in 8a1bd5c

  The fixup list was erroneously assumed to be directories only.
  Only in the case of critical file flags modification (e.g.
  SF_IMMUTABLE on BSD systems), other file types (e.g. regular files
  or symbolic links) may be added to the fixup list. We still need to
  verify that we are writing to the correct file type, so compare the
  archive entry file type with the file type of the file to be
  modified.

Fixes vendor issue #1617:
  Immutable flag no longer preserved during tar extraction on FreeBSD

MFC after:		3 days
Reported by:		markjdb
Libarchive commit:	ede459d2ebb879f5eedb6f7abea203be0b334230
2021-11-17 22:28:45 +01:00
Baptiste Daroussin
6d38604fc5 mandoc: import version 1.14.6
MFC after: 3 weeks
2021-11-15 16:58:58 +01:00
Dimitry Andric
397a8ba053 Apply fix for LLVM PR51957 (Miscompilation in Botan's SHA3)
Merge commit e27a6db5298f from llvm git (by Jameson Nash):

  Bad SLPVectorization shufflevector replacement, resulting in write to wrong memory location

  We see that it might otherwise do:

    %10 = getelementptr {}**, <2 x {}***> %9, <2 x i32> <i32 10, i32 4>
    %11 = bitcast <2 x {}***> %10 to <2 x i64*>
  ...
    %27 = extractelement <2 x i64*> %11, i32 0
    %28 = bitcast i64* %27 to <2 x i64>*
    store <2 x i64> %22, <2 x i64>* %28, align 4, !tbaa !2

  Which is an out-of-bounds store (the extractelement got offset 10
  instead of offset 4 as intended). With the fix, we correctly generate
  extractelement for i32 1 and generate correct code.

  Differential Revision: https://reviews.llvm.org/D106613
2021-11-13 21:52:25 +01:00
Dimitry Andric
a18c6161ef Fix assertion when building devel/glog with new pass manager
Merge commit 029f1a534489 from llvm git (by Arthur Eubanks):

  [LazyCallGraph] Skip blockaddresses

  blockaddresses do not participate in the call graph since the only
  instructions that use them must all return to someplace within the
  current function. And passes cannot retrieve a function address from a
  blockaddress.

  This was suggested by efriedma in D58260.

  Fixes PR50881.

  Reviewed By: nickdesaulniers

  Differential Revision: https://reviews.llvm.org/D112178
2021-11-13 21:52:24 +01:00
Dimitry Andric
4e117af10c Fix "Bad machine code" when building world for mips or mips64
Merge commit f5755c0849a5 from llvm git (by Jessica Clarke):

  [Mips] Add glue between CopyFromReg, CopyToReg and RDHWR nodes for TLS

  The MIPS ABI requires the thread pointer be accessed via rdhwr $3, $r29.
  This is currently represented by (CopyToReg $3, (RDHWR $29)) followed by
  a (CopyFromReg $3). However, there is no glue between these, meaning
  scheduling can break those apart. In particular, PR51691 is a report
  where PseudoSELECT_I was moved to between the CopyToReg and CopyFromReg,
  and since its expansion uses branches, it split the def and use of the
  physical register between two basic blocks, resulting in the def being
  eliminated and the use having no def. It also seems possible that a
  similar situation could arise splitting up the CopyToReg from the RDHWR,
  causing the RDHWR to use a destination register other than $3, violating
  the ABI requirement.

  Thus, add glue between all three nodes to ensure they aren't split up
  during instruction selection. No regression test is added since any test
  would be implictly relying on specific scheduling behaviour, so whilst
  it might be testing that glue is preventing reordering today, changes to
  scheduling behaviour could result in the test no longer being able to
  catch a regression here, as the reordering might no longer happen for
  other unrelated reasons.

  Fixes PR51691.

  Reviewed By: atanasyan, dim

  Differential Revision: https://reviews.llvm.org/D111967
2021-11-13 21:52:24 +01:00
Dimitry Andric
39dadd0628 Stop clang 13 from defining conflicting macros on PowerPC
Merge commit c9539f957f57 from llvm git (by Nemanja Ivanovic):

  [PowerPC] Define XL-compatible macros only for AIX and Linux

  Since XLC only ever shipped on PowerPC AIX and Linux, it is not
  reasonable to provide the compatibility macros on any target other
  than those two. This patch restricts those macros to AIX/Linux.

  Differential revision: https://reviews.llvm.org/D110213

PR:		258209
2021-11-13 21:52:23 +01:00
Dimitry Andric
28a41182c0 Merge llvm-project 13.0.0 release
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-0-gd7b669b3a303, aka 13.0.0 release.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:49:29 +01:00
Dimitry Andric
8c6f6c0c80 Merge llvm-project release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-rc3-8-g08642a395f23.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:46:08 +01:00
Dimitry Andric
69ade1e033 Merge llvm-project release/13.x llvmorg-13.0.0-rc2-43-gf56129fe78d5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-rc2-43-gf56129fe78d5.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:45:49 +01:00
Dimitry Andric
6e75b2fbf9 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
MFC after:	2 weeks
2021-11-13 21:42:03 +01:00
Dimitry Andric
fe6060f10f 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
MFC after:	2 weeks
2021-11-13 21:39:49 +01:00
Warner Losh
3fe0a5d2f6 Awk: Add error file
Add the expected output on stderr file.

Sponsored by:		Netflix
2021-11-06 16:24:36 -06:00
Warner Losh
517e52b6c2 awk: Move to using two sets of tests
Upstream one-true-awk has two sets of tests. These are in addition to
NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are
ready to use as-is (more or less). However, the 'tests' from upstream
are not, so for now we'll just use the netbsd and bugs-fixed tests.
They provide an OK workout and are better than nothing, though the tests
themselves are for specific esoteric things.

The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test
for errors and the upstream test jig mashes stdout and stderr together,
which atf doesn't do, so make a tiny tweak to the upstream tests that I
hope to upstream. Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream and have changed the test locally.

In addition, the system-status.awk test is not suitable to run in ATF.
It wants to force sh to dump core, but kyua doesn't seem to allow that
sometimes so the test will fail or pass based on whether or not a core
dump can be created. Since it's unstable, remove it.

This required moving the netbsd tests to a new direcotry, so update
mtree files as well. The change is useless for 'make check' without it.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31376
2021-11-05 08:53:36 -06:00
Kristof Provost
76c5eecc34 pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

Obtained from:	pfSense
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32750
2021-11-05 09:39:56 +01:00
Ed Maste
179219ea04 strip/objcopy: handle empty file as unknown
Previously strip reported a somewhat cryptic error for empty files:

    strip: elf_begin() failed: Invalid argument

Add a special case to treat empty files as with an unknown file format.
This is consistent with llvm-strip.  GNU strip produces no output which
does not seem like useful behaviour (but it does exit with status 1).

Reported by:	andrew
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32648
2021-10-25 17:28:41 -04:00
Dimitry Andric
4b9725184e Fix clang's internal assembler adding unwanted prefix to VIA xstore
Merge commit 2d8c18fbbdd1 from llvm git (by Jessica Clarke):

  [X86] Don't add implicit REP prefix to VIA PadLock xstore

  Commit 8fa3e8fa1492 added an implicit REP prefix to all VIA PadLock
  instructions, but GNU as doesn't add one to xstore, only all the others.
  This resulted in a kernel panic regression in FreeBSD upon updating to
  LLVM 11 (https://bugs.freebsd.org/259218) which includes the commit in
  question. This partially reverts that commit.

  Reviewed By: craig.topper

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

MFC after:	3 days
2021-10-23 20:20:00 +02:00
Philip Paeps
b02df2322c contrib/tzdata: import tzdata 2021e
Merge commit 'c66f7aacfc78e5e86469f85f20d3d4fc7d1e9a74'

Changes: https://github.com/eggert/tz/blob/2021e/NEWS

MFC after:	3 days
2021-10-22 13:20:20 +08:00
Kyle Evans
8c22b9f3ba Fix cross-building on Linux/aarch64
Add necessary bits to detect ELF format on Linux/aarch64; note that
Linux calls it aarch64 where we would typically call it arm64 (uname -m)

Reviewed by:	arichardson, emaste, imp
Sponsored by:	Ampere Computing LLC
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D32542
2021-10-18 11:09:00 -05:00
Philip Paeps
6b7d3b4de8 contrib/tzdata: import tzdata 2021d
Merge commit 'c28d35783173c0b09ca1f7e29d2565b1602f733d'

Changes: https://github.com/eggert/tz/blob/2021d/NEWS

MFC after:	3 days
2021-10-18 14:19:42 +08:00
Cy Schubert
fc39305439 ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV."
This reverts commit 5526318062 because the
underlying problem was fixed by 889b56c8cd.

MFC after:	1 month
2021-10-15 16:06:26 -07:00
Andrew Turner
aacbf3fb84 Teach the readelf about arm64 gnu properties
On arm64 binaries can be tagged as using BTI or PAC. Add support to
decode these to the elftoolchain readelf.

To simplify the code use a table based method to find the flag
description table.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32315
2021-10-11 10:39:49 +01:00
Jessica Clarke
224a95f124 libfido2: Address CHERI compatibility
Cherry-picked from libfido2 upstream f20a735c0a6f:

iso7816: Avoid storing pointers in a packed structure

On CHERI, and thus Arm's experimental Morello prototype architecture,
pointers are represented as capabilities, which are unforgeable bounded
pointers, providing always-on fine-grained spatial memory safety. The
unforgeability is enforced through the use of tagged memory, with one
validity tag bit per capability-sized-and-aligned word in memory. This
means that storing a pointer to an unaligned location, which is not
guaranteed to work per the C standard, either traps or results in the
capability losing its tag (and thus never being dereferenceable again),
depending on how exactly the store is done (specifically, whether a
capability store or memcpy is used).

However, iso7816 itself does not need to be packed, and doing so likely
causes inefficiencies on existing architectures. The iso7816_header_t
member is packed, and the flexible payload array is a uint8_t (which by
definition has no padding bits and is exactly 8 bits in size and, since
CHAR_BITS must be at least 8, its existence implies that it has the same
representation as unsigned char, and that it has size and alignment 1)
so there will never be any padding inserted between header and payload
(but payload may overlap with padding at the end of the struct due to
how flexible arrays work, which means we need to be careful about our
calculations).

Co-authored-by: pedro martelletto <pedro@yubico.com>
2021-10-06 21:40:26 -04:00
Ed Maste
0afa8e065e Import libfido2 at 'contrib/libfido2/'
git-subtree-dir: contrib/libfido2
git-subtree-mainline: d586c978b9
git-subtree-split: a58dee945a
2021-10-06 21:29:18 -04:00
Ed Maste
10ff414c14 Import libcbor at 'contrib/libcbor/'
git-subtree-dir: contrib/libcbor
git-subtree-mainline: 293663f4da
git-subtree-split: 5b2defbd2a
2021-10-06 20:26:10 -04:00
Stefan Eßer
a30efc5ca7 contrib/bc: update to version 5.1.1
Merge commit '6f49f5cdde1c62c4e5a743e895f3afe592b5c0e5'
2021-10-06 23:30:59 +02:00
Stefan Eßer
d43fa8ef53 contrib/bc: merge version 5.1.0 from vendor branch
This version adds options and functions that allow to print numbers
in the open interval (-1 .. 1) with or without a leading 0 digit.

Additionally, an option has been added to prevent line wrap and
allows to print arbitrarily long results on a single line.

Merge commit '5d58a51571721190681c50d4bd3a1f45e6282d72'
2021-10-04 22:25:24 +02:00
Stefan Eßer
d6c323eda2 Remove files that were checked in with wrong .gitattributes
These files will be added back in updated form, but are only relevant
for the Windows platform, anyway.
2021-10-04 22:10:32 +02:00
Stefan Eßer
ea31d1a5c4 contrib/bc: remove files ommitted from the release
A number of files have been removed from the release distribution of
this bc implementation. They were mostly relevant for pre release
testing and benchmarking to identify regressions. The Markdown
sources of the man pages are only relevant for combinations of build
options not used in FreeBSD and need non-default conversion tools
(available as ports in FreeBSD).

All the omitted files can be found in the upstream git repository,
and they are fetched when building this software as a port. But they
have never been used in the FreeBSD base system.
2021-10-04 09:41:06 +02:00
Stefan Eßer
662087dfd0 vendor/bc: update to upstream version 5.0.2
(cherry picked from commit a60ef1802a)
2021-10-04 09:37:19 +02:00
Philip Paeps
93d120dbc0 contrib/tzdata: import tzdata 2021c
Merge commit '9530c11c35707c2ed4a95aa90097b30f8a230563'

Changes: https://github.com/eggert/tz/blob/2021c/NEWS

MFC after:	3 days
2021-10-02 10:52:02 +08:00
Warner Losh
4aed5c3c9d time_t is pathological: use %j + cast to print it.
Sponsored by:		Netflix
2021-10-01 12:16:10 -06:00
Eric van Gyzen
35e4527e88 sem_clockwait_np test: fix usage of ATF API
ATF_REQUIRE_ERRNO requires the given errno iff the given expression is
true.  These test cases used it incorrectly, potentially allowing
sem_clockwait_np to succeed when it was expected to fail.  Use separate
ATF calls to require failure and the expected errno.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2021-10-01 06:39:34 -05:00
Eric van Gyzen
2334abfd01 sem test: move sem_clockwait_np tests into individual cases
Move these tests into individual test cases for all the usual reasons.
No functional change intended.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2021-10-01 06:39:34 -05:00
Eric van Gyzen
31466594cd sem_clockwait_np test: relax time constraint on VMs
In a guest on a busy hypervisor, the time remaining after an
interrupted sleep could be much lower than other environments.
Relax the lower bound on VMs.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2021-10-01 06:39:30 -05:00
Shteryana Shopova
8b959dd6a3 Fix bsnmpd(1) crash with ill-formed Discovery message
RFC 3414 Section 4. Discovery specifies that a discovery request message has a
varBindList left empty. Nonetheless, bsnmpd(1) should not crash when receiving
a non-zero var-bindings list in a Discovery Request message.

PR:		255214
MFC after:	2 weeks
2021-10-01 14:10:39 +03:00
Kyle Evans
4dbd8c72d3 tcp_wrappers: get rid of duplicate fgets declarations
This is declared in stdio.h, no need for this one.
2021-09-30 23:55:27 -05:00
Philip Paeps
94c2d487f1 contrib/tzdata: import tzdata 2021b
Merge commit 'a5725262945a2971af3b808088217fe975e8364e'

Changes: https://github.com/eggert/tz/blob/2021b/NEWS

MFC after:	3 days
2021-09-26 14:45:39 +08:00
Baptiste Daroussin
fbe95b885f dma: import snapshot 2021-07-10 2021-09-22 11:10:58 +02:00
Baptiste Daroussin
91f764172e libedit: import snapshot 2021-09-10 2021-09-22 10:19:43 +02:00
Ed Maste
deef4b8ce8 readelf: document that -u / --unwind is not yet implemented
ELF tool chain readelf accepts -u / --unwind but just ignores the
option.  This was previously undocumented, which could be confusing for
someone encountering `readelf -u` (in a script or GNU readelf example).

Reported by:	markj (in D32003)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-09-17 10:22:05 -04:00
Ed Maste
f161abf9f2 readelf: include notes (-n) and unwind (-u) in --all/-a
This matches the GNU and LLVM versions of readelf.

As markj noted in the review -u is not actually implemented yet and has
no effect.  The option is accepted and just ignored.

Reported by:	andrew
Reviewed by:	andrew, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32003
2021-09-17 09:51:59 -04:00
Edward Tomasz Napierala
6f43f86bf3 tzcode: Fix operation without WITH_DETECT_TZ_CHANGES
Reviewed By:	bdrewery, kevans, cy
Reported By:	lwhsu, bdrewery
Fixes:		ddedf2a11e
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31961
2021-09-14 20:17:50 +00:00
Edward Tomasz Napierala
ddedf2a11e tzcode: Implement timezone change detection
Implement optional timezone change detection for local time libc
functions.  This is disabled by default; set WITH_DETECT_TZ_CHANGES
to build it.

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#47
Differential Revision:	https://reviews.freebsd.org/D30183
2021-09-12 03:07:58 +00:00
Alan Somers
71a1ae7ceb Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542
The main improvement is the ability to skip a test that is expected to
fail.
2021-09-10 17:08:42 -06:00
Simon J. Gerraty
3b96abbab0 make: fix MAKE_JOB_ERROR_TOKEN
The rework of GetBooleanVar to GetBooleanExpr requires
we add "${" and ":U}" around the expression so it can be directly
evaluated.

Reported by: mjg
MFC after: 1 week

#
#                                                         72 columns --|
#
# Uncomment and complete these metadata fields, as appropriate:
#
# PR:		<If and which Problem Report is related.>
# Reported by:	<If someone else reported the issue.>
# Reviewed by:	<If someone else reviewed your modification.>
# Approved by:	<If you needed approval for this commit.>
# Obtained from:	<If the change is from a third party.>
# MFC after:	<N [day[s]|week[s]|month[s]].  Request a reminder email>
# MFH:		<Ports tree branch name.  Request approval for merge.>
# Relnotes:	<Set to 'yes' for mention in release notes.>
# Security:	<Vulnerability reference (one per line) or description.>
# Sponsored by:	<If the change was sponsored by an organization.>
# Pull Request:	<https://github.com/freebsd/<repo>/pull/###>
# Differential Revision:	<https://reviews.freebsd.org/D###>
#
# "Pull Request" and "Differential Revision" require the *full* GitHub or
# Phabricator URL.  The commit author should be set appropriately, using
# `git commit --author` if someone besides the committer sent in the change.
#
# Uncomment and complete these metadata fields, as appropriate:
#
# PR:
# Reported by:	<If someone else reported the issue.>
# Reviewed by:	<If someone else reviewed your modification.>
# Approved by:	<If you needed approval for this commit.>
# Obtained from:	<If the change is from a third party.>
# MFC after:	<N [day[s]|week[s]|month[s]].  Request a reminder email>
# MFH:		<Ports tree branch name.  Request approval for merge.>
# Relnotes:	<Set to 'yes' for mention in release notes.>
# Security:	<Vulnerability reference (one per line) or description.>
# Sponsored by:	<If the change was sponsored by an organization.>
# Pull Request:	<https://github.com/freebsd/<repo>/pull/###>
# Differential Revision:	<https://reviews.freebsd.org/D###>
#
# "Pull Request" and "Differential Revision" require the *full* GitHub or
# Phabricator URL.  The commit author should be set appropriately, using
# `git commit --author` if someone besides the committer sent in the change.
#
2021-09-10 13:11:28 -07:00
Dimitry Andric
efe67f33c3 compiler-rt: add aarch64 init function for LSE atomics
As reported by Ronald, adding the out-of-line LSE atomics helpers for
aarch64 to compiler-rt was not sufficient to link programs using these,
as they also require a __aarch64_have_lse_atomics global. This is
initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar
to the x86 CPU model and feature detection in that file.

Since upstream does not yet have a FreeBSD specific implementation for
getting the required information, add a simple one that should work for
now, while I try to get it sorted with the LLVM people.

Reported by:	Ronald Klop <ronald-lists@klop.ws>
Fixes:		cc55ee8009
PR:		257392
MFC after:	2 weeks
2021-09-06 21:24:01 +02:00
Alfredo Dal'Ava Junior
f21fcae487 llvm: Revert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount."
Reverts llvm commit 42eaf4fe0adef3344adfd9fbccd49f325cb549ef, pointed
from bisect as source of regression that causes liblzma to compress/
uncompress incorrectly. It's know to affect powerpc64 BE only.

The patch unbreaks FreeBSD powerpc64 installation media, since
bsdinstall can't uncompress the *.txz produced by FreeBSD CI. It's
probably miscompiling other software bas well.

Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=51714

Reviewed by:	dim
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D31804
2021-09-03 13:31:54 -03:00
Cy Schubert
c1d255d3ff wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff
Merge vendor commits 40c7ff83e7,
efec822389, and
2f6c3ea960.

Tested by:	philip
MFC after:	2 months
2021-09-03 06:08:41 -07:00
Cy Schubert
213ceba977 wpa: Enclose FreeBSD specific defines
FreeBSD only defines are specific only to FreeBSD. Document them as such.
It is our intention to push this change to w1.fi.

MFC after:	1 week
2021-08-30 06:59:18 -07:00
Alfredo Dal'Ava Junior
9a4d48a645 llvm/powerpc64*: fix broken binaries generated by clang12
Amends LLVM commit 2518433f861fcb877d0a7bdd9aec1aec1f77505a that
was pointed as the source of regression on LLVM12.

This affects powerpc64*, making binaries crash with segmentation fault
due to bad code generation around "__stack_chk_guard"

Root cause and/or proper fix is under investigation by:
    https://bugs.llvm.org/show_bug.cgi?id=51590

Reviewed by:    dim
MFC after:      2 days
Sponsored by:   Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:  https://reviews.freebsd.org/D31698
2021-08-27 11:47:11 -03:00
Martin Matuska
c577bdfce6 libarchive: import bugfix from upstream
Reworked bugfix for upstream issue #1566:
  Do not follow symlinks when processing the fixup list

MFC after:	2 weeks
2021-08-27 12:51:01 +02:00
Martin Matuska
ddce862ad8 libarchive: import changes from upstream
Libarchive 3.5.2

New features:
  PR #1502: Support for PWB and v7 binary cpio formats
  PR #1509: Support of deflate algorithm in symbolic link decompression
            for ZIP archives

Important bugfixes:
  IS #1044: fix extraction of hardlinks to symlinks
  PR #1480: Fix truncation of size values during 7zip archive
            extraction on 32bit architectures
  PR #1504: fix rar header skiming
  PR #1514: ZIP excessive disk read - fix location of central directory
  PR #1520: fix double-free in CAB reader
  PR #1521: Fixed leak of rar before ending with error
  PR #1530: Handle short writes from archive_write_callback
  PR #1532: 7zip: Use compression settings from file also for file header
  IS #1566: do not follow symlinks when processing the fixup list

MFC after:	2 weeks
Relnotes:	yes
2021-08-23 03:07:36 +02:00
Martin Matuska
9aa5476184 Update vendor/libarchive/dist to libarchive/libarchive@1b2c437b9
Libarchive 3.5.2

New features:
  PR #1502: Support for PWB and v7 binary cpio formats
  PR #1509: Support of deflate algorithm in symbolic link decompression
            for ZIP archives

Important bugfixes:
  IS #1044: fix extraction of hardlinks to symlinks
  PR #1480: Fix truncation of size values during 7zip archive
            extraction on 32bit architectures
  PR #1504: fix rar header skiming
  PR #1514: ZIP excessive disk read - fix location of central directory
  PR #1520: fix double-free in CAB reader
  PR #1521: Fixed leak of rar before ending with error
  PR #1530: Handle short writes from archive_write_callback
  PR #1532: 7zip: Use compression settings from file also for file header
  IS #1566: do not follow symlinks when processing the fixup list

Obtained from:		libarchive
Libarchive commit:	1b2c437b99b361c7692538fa373e99955e9b93ae
Libarchive tag:		v3.5.2
2021-08-23 02:24:04 +02:00
Dimitry Andric
efa485d5c3 Apply clang fix for assertion failure compiling multimedia/minitube
Merge commit 79f9cfbc21e0 from llvm git (by Yaxun (Sam) Liu):

  Do not merge LocalInstantiationScope for template specialization

  A lambda in a function template may be recursively instantiated. The recursive
  lambda will cause a lambda function instantiated multiple times, one inside another.
  The inner LocalInstantiationScope should not be marked as MergeWithParentScope
  since it already has references to locals properly substituted, otherwise it causes
  assertion due to the check for duplicate locals in merged LocalInstantiationScope.

  Reviewed by: Richard Smith

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

Reported by:	yuri
PR:		257978
MFC after:	3 days
2021-08-21 23:03:50 +02:00
Cy Schubert
5469a99530 unbound: Vendor import 1.13.2
Merge commit '625f1c1312fb7defbd148c8ba121a0cf058707ef'

MFC after:	1 month
2021-08-17 02:32:56 -07:00
Cy Schubert
625f1c1312 unbound: Vendor import 1.13.2 2021-08-16 16:57:03 -07:00
Dimitry Andric
c1a540709a Apply upstream lldb fix for unhandled Error causing abort
Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric):

  [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage

  When assertions are turned off, the `llvm::Error` value created at the
  start of this function is overwritten using the move-assignment
  operator, but the success value is never checked. Whenever a TypeSystem
  cannot be found or created, this can lead to lldb core dumping with:

      Program aborted due to an unhandled Error:
      Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Fix this by not creating a `llvm::Error` value in advance, and directly
  returning the result of `llvm::make_error` instead, whenever an error is
  encountered.

  See also: <https://bugs.freebsd.org/253881> and
  <https://bugs.freebsd.org/257829>.

  Reviewed By: teemperor

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

Reported by:	dmgk, ota@j.email.ne.jp
PR:		253881, 257829
MFC after:	3 days
2021-08-16 18:57:24 +02:00
Stefan Eßer
44d4804d19 usr.bin/ghä-bc, contrib/bc: update to version 5.0.0
Merge commit 2f57ecae4b

This is a new major release with a number of changes and extensions:

- Limited the number of temporary numbers and made the space for them
  static so that allocating more space for them cannot fail.
- Allowed integers with non-zero scale to be used with power, places,
  and shift operators.
- Added greatest common divisor and least common multiple to lib2.bc.
- Made bc and dc UTF-8 capable.
- Added the ability for users to have bc and dc quit on SIGINT.
- Added the ability for users to disable prompt and TTY mode by
  environment variables.
- Added the ability for users to redefine keywords.
- Added dc's modular exponentiation and divmod to bc.
- Added the ability to assign strings to variables and array elements
  and pass them to functions in bc.
- Added dc's asciify command and stream printing to bc.
- Added bitwise and, or, xor, left shift, right shift, reverse,
  left rotate, right rotate, and mod functions to lib2.bc.
- Added the functions s2u(x) and s2un(x,n), to lib2.bc.

MFC after:	1 week
2021-08-13 11:28:06 +02:00
Cy Schubert
ce92f5a91b wpa: Add wpa_cli action file event
Yan Zhong at FreeBSD Foundation is working on a wireless network
configuratior for an experimental FreeBSD installer. The new installer
requires an event to detect when connecting to a network fails due to a
bad password. When this happens a WPA-EVENT-TEMP-DISABLED event is
triggered. This patch passes the event to an action file provided by
the new experimental installer.

Submitted by:	Yang Zhong <yzhong () freebsdfoundation.org>
Reviewed by:	assumed to be reviewed by emaste (and cy)
MFC after:	1 week
2021-08-12 07:13:25 -07:00
Mark Johnston
b2da103239 ncurses: Apply a tputs() fix from patch 20210403
From the (substantially larger) upstream commit:
+ call delay_output_sp to handle BSD-style padding when tputs_sp is
  called, whether directly or internally, to ensure that the SCREEN
  pointer is passed correctly (reports by Henric Jungheim, Juraj
  Lutter).

This fixes bison segfaults observed when colourized output is enabled.
Thanks to jrtc27@ for identifying the upstream fix.

PR:		256731
MFC after:	3 days
2021-08-11 13:08:23 -04:00
Dimitry Andric
d69d07569e Apply upstream lld fix for compressed input sections on BE targets
Merge commit c6ebc651b6fa from llvm git (by Simon Atanasyan):

  [LLD] Support compressed input sections on big-endian targets

  This patch enables compressed input sections on big-endian targets by
  checking the target endianness and selecting an appropriate `Chdr`
  structure.

  Fixes PR51369

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

Reported by:	emaste
MFC after:	3 days
2021-08-07 13:14:11 +02:00
Alex Richardson
31ba4ce889 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
2021-08-02 14:36:03 +01:00
Warner Losh
fd2a4a31d9 awk: document updating
Fill in all the details to the standard process so they are hand in one
place and don't need to be re-remembered or rediscovered for the next
import.

Sponsored by:		Netflix
2021-08-01 11:31:50 -06:00
Warner Losh
23f24377b1 awk: Merge 20210729 from One True Awk upstream (0592de4a)
July 27, 2021:
	As per IEEE Std 1003.1-2008, -F "str" is now consistent with
	-v FS="str" when str is null. Thanks to Warner Losh.

July 24, 2021:
	Fix readrec's definition of a record. This fixes an issue
	with NetBSD's RS regular expression support that can cause
	an infinite read loop. Thanks to Miguel Pineiro Jr.

	Fix regular expression RS ^-anchoring. RS ^-anchoring needs to
	know if it is reading the first record of a file. This change
	restores a missing line that was overlooked when porting NetBSD's
	RS regex functionality. Thanks to Miguel Pineiro Jr.

	Fix size computation in replace_repeat() for special case
	REPEAT_WITH_Q. Thanks to Todd C. Miller.

Also, included the tests from upstream, though they aren't yet connected
to the tree.

Sponsored by:		Netflix
2021-08-01 10:22:39 -06:00
Warner Losh
4e52f5db35 awk: Flag -Ft as deprecated behavior
Upstream is poised to deprecate the -Ft wart in one true awk. None of
the other awks do this, and the gawk maintainer says that he's had no
requests for it in gawk in 30 years maintaining it. github can find a
few instances of it in the wild. As such, warn that it's deprecated and
will go away in the future.

MFC After:		3 days
Sponsored by:		Netflix
2021-07-30 23:33:37 -06:00
Jilles Tjoelker
0c47338023 libc/tests: Correctly compare si_status from wait6()
Fix erroneous = that was meant to be ==.

Revision 1.10 from NetBSD t_wait.c

Obtained from:	NetBSD
2021-07-25 22:19:18 +02:00
Warner Losh
a2e3e11873 awk: Make -F '' and -v FS="" behave the same
IEEE Std 1003.1-2008 mandates that -F str be treated the same as -v
FS=str. For a null string, this was not the case. Since awk(1) documents
that a null string for FS has a specific behavior, make -F '' behave
consistently with -v FS="".

PR:			241441
Upstream issue:		https://github.com/onetrueawk/awk/issues/127
Upstream pull request:	https://github.com/onetrueawk/awk/pull/128
MFC After:		2 weeks
Sponsored by:		Netflix
2021-07-24 09:08:16 -06:00
Warner Losh
5ab82b00cc awk: Remove last markings we have on awk
We normally don't add $FreeBSD$ to contrib software. However, these
changes date back to the CVS era of source code management and have been
overlooked. Now that all these files are back to the same as the
upstream bsd-features branch, remove the FreeBSD specific changes, which
are now just $FreeBSD$ and the (FreeBSD) in the version string.

MFC After:		2 weeks
Sponsored by:		Netflix
2021-07-21 20:24:57 -06:00
Warner Losh
628bd30ab5 awk: revert to upstream behavior for ranges for gawk compatibility
In 2005, FreeBSD changed one-true-awk to honor the locale's collating
order. This was billed as a temporary patch. It was also compatible with
the then-current behavior of gawk. That temporary patch has lasted 16
years now.

However, IEEE Std 1003.1-2008 changed the behaivor of ranges in regular
expressions outside of the "C" and "POSIX" locales to be undefined.

Starting in 2011, gawk 4.0 stopped using the locale for the range
regular expressions and used the traditional behavior only. The
maintainer had grown weary of answering why '[A-Z]' would sometimes
match lower-case expressions. The details about are explained here:
https://www.gnu.org/software/gawk/manual/html_node/Ranges-and-Locales.html

To restore compatibility with other implementaitons of awk, revert this
patch. FreeBSD is the odd-system out. It also has the nice side effect
of eliminating the last of our differences with upstream one-true-awk.

Reviewed by:		cy, rgrimes
MFC After:		2 weeks
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31114
2021-07-21 20:22:43 -06:00
Warner Losh
2929813c4f Revert "awk: Issue a warning for old hex behavior."
This reverts commit acf9cf323f. It warns
about too many false positive cases.

Sponsored by:		Netflix
2021-07-21 20:17:50 -06:00
Warner Losh
acf9cf323f awk: Issue a warning for old hex behavior.
Since FreeBSD has allowed "0x" hex strings to be converted to integers
for a long time, and since upstream has killed that behavior, warn about
this issue. This will allow us to deprecate this behavior for 14.0 while
giving our users of 12.x and 13.x fair warning.

Sponsored by:		Netflix
2021-07-21 20:03:35 -06:00
Warner Losh
0c92d88c91 awk: remove proctab.c
proctab.c is a generated file and never should have been committed to
the tree. This file has been added and removed a couple of times, most
recently added by me in my 2019 updates.

Sponsored by:		Netflix
2021-07-19 22:34:37 -06:00
Alex Richardson
8ef98a8045 Allow building usr.bin/vi with MK_ASAN
We have to namespace the regex functions to avoid duplicate symbol errors.
This also ensures that vi doesn't define the libc reg* functions with
mismatched signatures.

ld: error: duplicate symbol: regcomp
>>> defined at sanitizer_common_interceptors.inc:7519 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7519)
>>>            asan_interceptors.o:(__interceptor_regcomp) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a
>>> defined at regcomp.c
>>>            .../regex/regcomp.c.o:(.text+0x0)

ld: error: duplicate symbol: regerror
>>> defined at sanitizer_common_interceptors.inc:7543 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7543)
>>>            asan_interceptors.o:(__interceptor_regerror) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a
>>> defined at regerror.c
>>>            .../regex/regerror.c.o:(.text+0x0)

ld: error: duplicate symbol: regexec
>>> defined at sanitizer_common_interceptors.inc:7530 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7530)
>>>            asan_interceptors.o:(__interceptor_regexec) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a
>>> defined at regexec.c
>>>            .../regex/regexec.c.o:(.text+0x0)

ld: error: duplicate symbol: regfree
>>> defined at sanitizer_common_interceptors.inc:7553 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7553)
>>>            asan_interceptors.o:(__interceptor_regfree) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a
>>> defined at regfree.c
>>>            .../regex/regfree.c.o:(.text+0x0)

Committed upstream as https://github.com/lichray/nvi2/pull/92

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D31050
2021-07-19 15:04:19 +01:00
Xin LI
30a1828c51 less: upgrade to v590.
MFC after:	2 weeks
2021-07-17 22:20:44 -07:00
Dimitry Andric
4652422eb4 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
MFC after:	6 weeks
2021-07-16 18:29:42 +02:00
Warner Losh
d4d252c499 awk: revert upstream's attempt to disallow hex strings
Upstream one-true-awk decided to disallow hex strings as numbers. This
is in line with awk's behavior prior to C99, and allowed by the POSIX
standard. The standard, however, allows them to be treated as numbers
because that's what the standard said in the 2001 through 2004 editions.
Since 2001, the nawk in FreeBSD has treated them as numbers, so restore
that behavior, allowed by the standard.

A number of scripts in the FreeBSD tree depend on this interpretation,
including scripts to build the kernel which had mysteriously started
failing for some people and not others. By re-allowing 0x hex numbers,
this fixes those scripts and restores POLA.

Upstream issue:		https://github.com/onetrueawk/awk/issues/126
Sponsored by:		Netflix
Reviewed by:		kevans
MFC After:		asap due to regression alrady merged to stable
Differential Revision:	https://reviews.freebsd.org/D31199
2021-07-15 17:08:03 -06:00
Luiz Otavio O Souza
3f240bdf36 tcpdump: decode packets on pfsync interfaces
Reviewed by:	kp, scottl
Obtained from:	pfsense
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31153
2021-07-13 13:29:52 +02:00
Warner Losh
f68a53dba9 awk: Reduce diffs with upstream to almost nothing.
In the merge of 20210215, I left two merge conflicts #if 0'd by mistake
to check later rather than resolve them as part of the merge.  This code
turns out to be from the original one-true-awk import and not FreeBSD
specific, so remove them.

Remove a extra definition of HAT.

Remove a stylistic change that also appears to be a mismerge along the
way.

Remove FREEBSD-upgrade. Nobody has updated it since the original 2007
cvs import. It talks about old CVS branches that never made it into svn,
let alone git. New imports will follow the standard practices now, so
there's nothing left to document.

Move README to README.md and copy the README.md from upstream over.

This leaves just the $FreeBSD$ lines (which remain for the stable/12
merge) and the strcoll part of ru@'s r201989/d98dd8e5f94c as the only
diffs with upstream. FreeBSD also still has its own man page, which I
don't plan on changing. Once this commit is merged to stable/12, I plan
no further merges to stable/12. Sometime after that I'll remove the
$FreeBSD$ lines to reduce the diffs even more (though i want to make
sure plans won't change first). I also plan to talk to upstream about
this change...

MFC After:		2 weeks
Sponsored by:		Netflix
2021-07-08 23:05:13 -06:00
Warner Losh
f39dd6a978 one-true-awk: import 20210221 (1e4bc42c53a1) which fixes a number of bugs
Import the latest bsd-features branch of the one-true-awk upstream:

o Move to bison for $YACC
o Set close-on-exec flag for file and pipe redirects that aren't std*
o lots of little fixes to modernize ocde base
o free sval member before setting it
o fix a bug where a{0,3} could match aaaa
o pull in systime and strftime from NetBSD awk
o pull in fixes from {Net,Free,Open}BSD (normalized our code with them)
o add BSD extensions and, or, xor, compl, lsheift, rshift (mostly a nop)

Also revert a few of the trivial FreeBSD changes that were done slightly
differently in the upstreaming process. Also, our PR database may have
been mined by upstream for these fixes, and Mikolaj Golub may deserve
credit for some of the fixes in this update.

Suggested by:		Mikolaj Golub <to.my.trociny@gmail.com>
PR:			143363,143365,143368,143369,143373,143375,214782
Sponsored by:		Netflix
2021-07-07 19:25:43 -06:00
Alex Richardson
31914882fc Import Arm Optimized Routines v21.02
This is the new replacement for the existing cortex-strings code which will
be replaced in a follow-up commit.
We should also be able to use some of the math functions to allow the
tests to pass on AArch64 (and other architectures) instead of just x86.
We might also be able to reuse some of the tests for the kyua testsuite.

Imported using
```
curl -L e823e3abf5 | tar --strip-components=1 -xvzf -
git add .
```

Differential Revision: https://reviews.freebsd.org/D29035
git-subtree-dir: contrib/arm-optimized-routines
git-subtree-mainline: e34c713b0e
git-subtree-split: f9f37c002a
2021-07-06 11:05:34 +01:00
Dimitry Andric
5866c369e4 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
2021-07-03 00:35:49 +02:00
Kristof Provost
8923ea6c86 ftp-proxy: Revert incorrect migration to libpfctl
libpfctl supports creating rules, but not (yet) adding addresses to a
pool. Adding addresses certainly does not work through adding a rule.

PR:		256917
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-01 21:34:40 +02:00
Ed Maste
b762974cf4 clang: stop linking _p libs for -pg as of FreeBSD 14
In FreeBSD 14 we will stop providing _p libraries (compiled with -pg).

Reviewed by:	dim (upstream)
Obtained from:	LLVM 699d47472c3f
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30861
2021-06-27 13:12:12 -04:00
Simon J. Gerraty
68c4481aac Update to bmake-20210621
MFC after:	1 week
2021-06-25 16:02:40 -07:00
Simon J. Gerraty
b0c40a00a6 Merge commit 'ee914ef902ae018bd4f67192832120f9bf05651f' into new_merge 2021-06-25 14:31:14 -07:00
Dimitry Andric
014a40f8f6 Disable llvm generating 128-bit multiply libcalls on 32-bit ARM
Merge commit 789708617d20 from llvm git (Koutheir Attouchi):

  Do not generate calls to the 128-bit function __multi3() on 32-bit ARM

  Re-applying this patch after bots failures. Should be fine now.

  The function __multi3() is undefined on 32-bit ARM, so a call to it should
  never be emitted. Instead, plain instructions need to be generated to
  perform 128-bit multiplications.

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

Reported by:	mmel
MFC after:	3 days
2021-06-22 22:26:13 +02:00
Warner Losh
15fccd86b9 Merge tag 'vendor/NetBSD/vis/20210621' into vis
Bring in NetBSD's vis as of 2021-06-21

Man page fixes, -M, -N and -S support for shell meta characters (all or some)
and no locale.

Discussed with:		emaste@
Differential Revision:	https://reviews.freebsd.org/D25358
2021-06-21 18:04:17 -06:00
Dimitry Andric
e7e517981a Fix clang assertion while building recent www/chromium
Merge commit c8227f06b335 from llvm git (by Arthur Eubanks):

  [clang] Don't assert in EmitAggregateCopy on trivial_abi types

  Fixes PR42961.

  Reviewed By: rnk

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

PR:		256721, 255570
Reported by:	jbeich
MFC after:	3 days
2021-06-21 20:48:37 +02:00
Edward Tomasz Napierala
224c772ca5 telnet(1): add quiet mode ("telnet -Q")
Reviewed By:	imp, phk
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#54
Differential Revision:	https://reviews.freebsd.org/D30819
2021-06-21 17:11:57 +01:00
Dimitry Andric
23408297fb 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
MFC after:	6 weeks
2021-06-19 20:09:28 +02:00
Alex Richardson
1a2f06d0f2 vis(3): avoid out-of-bounds stack buffer reads
I found this while running kdump(1) on a CheriBSD system due to a
capability length violation when printing the /etc/libmap.conf read()
system call: it crashed immediately after printing the first line.

Found by:	CHERI
Reviewed By:	jhb
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D30771
2021-06-16 16:27:13 +01:00
Dimitry Andric
d099db2546 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
MFC after:	6 weeks
2021-06-14 20:44:09 +02:00
Dimitry Andric
715df83abc 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
MFC after:	6 weeks
2021-06-14 18:10:03 +02:00
Dimitry Andric
d409305fa3 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
MFC after:	6 weeks
2021-06-13 22:01:15 +02:00
Dimitry Andric
e8d8bef961 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
MFC after:	6 weeks
2021-06-13 21:37:19 +02:00
John Baldwin
0333fad1b7 Remove svnlite.
Reviewed by:	bcr, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D30737
2021-06-11 14:56:41 -07:00
Warner Losh
bf26ea7755 t_getgroups: No longer expected to fail
Sponsored by:		Netflix
2021-06-02 13:24:47 -06:00
Tim McNamara
d912068ad8 Remove duplicated lines in contrib/tzcode/stdtime/private.h
Note by imp: this is clearly a mis-merge from the vendor branch which
doesn't have this stutter in it.

Reviewed by:		imp@,ngie@
Pull Request:		https://github.com/freebsd/freebsd-src/pull/154
2021-05-31 16:03:37 -06:00
Hans Petter Selasky
16fa3dcba0 ibstat: Include prototype for sysctlbyname().
Fixes the following compile warning:
      implicit declaration of function 'sysctlbyname' is invalid in C99
      [-Wimplicit-function-declaration]

Found by:	J87
Differential Revision:	https://reviews.freebsd.org/D30484
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-05-27 09:42:30 +02:00
Baptiste Daroussin
6680e5a52f import nvi 2.2.0-3bbdfe4 2021-05-21 22:51:21 +02:00
Dmitry Chagin
6560ac57ce tcsh: update to version 6.22.04.
Merge commit '174d8b60324d7e8754709f7155e13ca95220b48c' into main.

MFC After:	2 weeks
2021-05-20 00:12:27 +03:00
Dmitry Chagin
6190ff6104 tcsh: cleanup source tree to reduce diff size.
Remove makefiles, configure files and unused at build time files
to reduce the diff size. Otherwise the diff contains a lot of
unnecessary lines what makes reviewing and merging proccess so hard,
especially for re@.

MFC after:	2 weeks
2021-05-20 00:08:25 +03:00
Cyril Zhang
f9e565abca sort: Make NetBSD sort tests compatible with our sort
This diff primarily adds/removes flags to make the tests compatible with
sort.  Two tests are removed.  One test is changed to expect fail due to
a bug.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30217
2021-05-13 09:33:47 -04:00
Stefan Eßer
8c39e25220 contrib/bc: update to version 4.0.2
Merge commit '2858419a0ee2b8f5827de72c00618bcd69ebc5fc'

This update fixes the initialization of "scale" to 20 if started with
-l and the initial statement leads to an error (e.g. contains a syntax
error). Scale was initialized to 0 in that case.

Another change is the support of job control in interactive mode with
line editing enabled. The control characters have been interpreted as
editing commands only, prior to this version.

MFC after:	3 days
2021-05-12 07:50:59 +02:00