Commit Graph

9220 Commits

Author SHA1 Message Date
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