Commit graph

14923 commits

Author SHA1 Message Date
Dimitry Andric
7224d4125a 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

(cherry picked from commit 28a41182c0)
2021-12-06 17:30:07 +01:00
Alex Richardson
47bd07c981 Fix a syntax error in 1b85b68da0
Reported by:	Michael Butler, jenkins

(cherry picked from commit 367ec75323)
2021-12-06 17:30:06 +01:00
Cameron Katri
e52de8a915 llvm-readobj: Attach to buildsystem
Also install it as readelf when MK_LLVM_BINUTILS is set.

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

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

PR:		258209

(cherry picked from commit fe6060f10f)
2021-12-06 17:30:02 +01:00
Alex Richardson
5814e2ba97 Don't build and install {llvm,clang,lldb}-tblgen for the target
The tablegen binaries are only needed to build software that uses
LLVM's infrastructure for command line options,
disassembler tables, etc. They are not user-facing binaries and
should therefore not be installed by default.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D31058

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

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

Reviewed By:	emaste

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

(cherry picked from commit 021385aba5)
2021-12-05 21:42:14 +01:00
Gordon Bergling
fcece3a9f5 elf(3): Fix a typo in a sysctl description
- s/segement/segment/

(cherry picked from commit c8ca80e223)
2021-12-03 16:52:02 +01:00
Rick Macklem
b61ed46880 nfsstat: Add output for counts of new RPCs to the "-E" option
Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

(cherry picked from commit 75c666197c)
2021-11-28 15:58:03 -08:00
Ed Maste
2104a80649 mkimg: zero entry in vhdx_write_metadata
Otherwise _reserved might contain uninitialized data.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 036af1053a)
2021-11-27 19:29:30 -05:00
Mateusz Piotrowski
51f4d6a6bc top.1: Use the Dq macros instead of \*lq and \*rq
MFC after:	3 days

(cherry picked from commit 01e3140571)
2021-11-24 17:10:31 +01:00
Mateusz Piotrowski
745ffe0ee8 top.1: Improve description of -m
Describe -m argument as "mode" instead of "display".

MFC after:	3 days

(cherry picked from commit c947fc5fae)
2021-11-24 17:10:04 +01:00
Mateusz Piotrowski
5f3b6ce64f top.1: Fix a typo in description of H interactive command
B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes:		9d6cce02a7
MFC after:	3 days

(cherry picked from commit b8135ed67c)
2021-11-24 17:09:31 +01:00
Mateusz Piotrowski
cd66a1b1c8 top.1: Sort options alphabetically
While here, add a short sentence introducing the options.

MFC after:	3 days

(cherry picked from commit 1125390415)
2021-11-24 17:07:02 +01:00
Mateusz Piotrowski
615b3385c9 top: Sort flags in usage message
While here, fix the indentation of the second line in the message.

MFC after:	3 days

(cherry picked from commit 82d0f865ee)
2021-11-24 17:03:37 +01:00
Konstantin Belousov
e8b954f136 ldd: also use exec mode for -a
PR:	259069

(cherry picked from commit 7d20a08076)
2021-11-19 06:25:28 +02:00
Konstantin Belousov
e631f3e04e procstat auxv: print out FXRNG
(cherry picked from commit 0864ab3d32)
2021-11-19 06:25:27 +02:00
Felix Johnson
de5334c8c9 sockstat(1): Update Synopsis section
Update sockstat(1) manpage so the Synopsis section includes q (silent
mode) and the -j argument name is consistent.

PR:		256795
Reported by:	Nick Reilly <nreilly@blackberry.com>

(cherry picked from commit 5504d83942)
2021-11-13 01:14:51 -05:00
Hans Petter Selasky
af21e0057a beep(1): Initial version of utility to create terminal beep via soundcard.
Reviewed by:	imp@, emaste@ and pstef@
Differential Revision:	https://reviews.freebsd.org/D32672
Sponsored by:	NVIDIA Networking

(cherry picked from commit 8abfbe5a79)
2021-11-12 15:33:10 +01:00
Felix Johnson
c702a2897e find(1): Update date format reference and remove cvs(1) references
cvs(1) is not installed by default. Change the date format reference to
note that find(1) understands ISO8601 and RFC822 date formats. Also
remove references to cvs(1).

PR:		254894
Reported by:	danielsh@apache.org

(cherry picked from commit 52dbe1a0f4)
2021-11-10 19:34:15 -05:00
Andriy Gapon
df838c5406 fuser: restore functionality by fixing fsid type
Use types from sys/stat.h for the filesystem and inode numbers for extra
safety.

PR:		259504
Reported by:	Markus Wild <freebsd-bugs@virtualtec.ch>
MFC after:	1 week

(cherry picked from commit e18fbe6f19)
2021-11-08 07:55:30 +02:00
Mateusz Piotrowski
e41e2d5866 dpv: Fix synopsis formatting & sort options
MFC after:	3 days

(cherry picked from commit a85aa7f9d3)
2021-11-07 18:50:23 +01:00
Mateusz Piotrowski
69a40537eb dpv.1: Do not use mdoc macros for Bl width
Macros do not expand there.

MFC after:	3 days

(cherry picked from commit 3693250e8a)
2021-11-07 18:50:13 +01:00
Mateusz Piotrowski
01144e8cef dpv.1: Fix an example
dpv(1) requires a label to be specified.

MFC after:	3 days

(cherry picked from commit f7c7a6ac00)
2021-11-07 18:49:10 +01:00
Mark Johnston
946a297fbd sort: Fix random sort
bwsrawdata() is supposed to return the string buffer.

PR:		259451
Reported by:	sigsys@gmail.com
Fixes:		d053fb22f6 ("usr.bin/sort: Avoid UBSan errors")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e9bfb50d5e)
2021-11-01 09:10:54 -04:00
Michael Reifenberger
59821002f7 systat: Handle SIGWINCH to properly window resizing and adjust -swap disk stat based on new size.
(cherry picked from commit 6648383803)
2021-11-01 03:26:53 +02:00
Konstantin Belousov
f33a9999e2 Augment systat(1) -swap to display large swap space processes
(cherry picked from commit 57e5da2c98)
2021-11-01 02:44:51 +02:00
Konstantin Belousov
7a3d7b9efc ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified
PR:	259069

(cherry picked from commit 2c7a6dad4d)
2021-10-28 03:35:54 +03:00
Konstantin Belousov
d53274be0d ldd: style
(cherry picked from commit ca8c576d10)
2021-10-28 03:35:54 +03:00
Ed Maste
7a78903113 lorder: process read-only data symbols
Previously they were skipped.  lorder(1) serves no functional purpose
today but we might as well address this longstanding bug while it is
still in the tree.

PR:		133860
MFC after:	1 week
Submitted by:	John Hein

(cherry picked from commit e1d6d6f924)
2021-10-24 20:37:05 -04:00
Mateusz Piotrowski
c1c3ef8ef8 timeout.1: Fix typos in examples
MFC after:	3 days

(cherry picked from commit 12615938c6)
2021-10-24 18:33:37 +02:00
Kyle Evans
b6aec78847 cmp: initialize limit to avoid stack garbage limits
Pointy hat:	kevans
Fixes:	4e380e8474 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by:	Klara, Inc.

(cherry picked from commit f1f7f31366)
2021-10-23 14:01:00 -05:00
Yoshihiro Takahashi
3bfe213143 unzip: Fix segmentation fault if a zip file contains buggy filename.
PR:             259011
Reported by:    Robert Morris
Submitted by:   ak

(cherry picked from commit 2c614481fd)
2021-10-18 20:16:02 +09:00
Stefan Eßer
e84a97439b 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

(cherry picked from commit 44d4804d19)

vendor/bc: update to upstream version 5.0.2

(cherry picked from commit a60ef1802a)
(cherry picked from commit 662087dfd0)

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.

(cherry picked from commit ea31d1a5c4)

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.

(cherry picked from commit d6c323eda2)

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'

(cherry picked from commit d43fa8ef53)

contrib/bc: update to version 5.1.1

Merge commit '6f49f5cdde1c62c4e5a743e895f3afe592b5c0e5'

(cherry picked from commit a30efc5ca7)

contrib/bc: temporarily disconnect the tests for 5.0.2

The tests that come with version 5.0.2 have been extended to cover the
line editing functions. It has been found that these tests generate
false negative results in FreeBSD, most likely due to an issue in the
pexpect functionality used.

These history tests are skipped on systems that do not have python and
py-pexpect installed (and thus are unlikely to cause CI test failures),
but in order to not cause irritating failures on systems were these
packages are in fact installed, I temporarily disconnect them.

I had planned to skip this version due to the issue with the history
tests, but some committer has asked me to go ahead since the currently
used version 5.0.0 contains a macro name that collides with a project
he is working on.

No MFC of this version is planned. A version 5.0.3 is expected to be
released soon, and that version will allow to reconnect the tests and
will be MFCed.

(cherry picked from commit f774652b0e)

Add back Windows only VCXProj files

(cherry picked from commit ded0d3d486)

contrib/bc: re-enable tests after the import of version 5.1.0

The tests have been fixed to not write any data outside of the
temporary work directory provided by the test framework.

MFC after:	3 days

(cherry picked from commit b8d895faf4)

Revert erroneous commit ded0d3d486

These files came from a prior commit to contrib/bc and seem to have
been placed in the top of the source tree by a failed git rebase.

Reported by:	markj

(cherry picked from commit f902ca97bd)
2021-10-12 16:18:26 +02:00
Jessica Clarke
2bfc7f7b75 llvm-objcopy: Install llvm-strip link
Just as elftoolchain's objcopy doubles as strip, so does LLVM's. Note
that we do not currently have a committed copy of the manpage generated
from the rST source so no manpage is installed for llvm-strip.

(Note this is only a partial MFC, as WITH_LLVM_BINUTILS was not MFC'ed)

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Tested by:	Shawn Webb <shawn.webb@hardenedbsd.org>
MFC after:	1 week

(cherry picked from commit f28c1d0c5c)
2021-10-10 14:34:33 +01:00
Kyle Evans
c8d19408fe login: use sizeof(audit_cond) consistently, NFC
The other three instances were already converted to use audit_cond, this
one was just changed from sizeof(long) -> sizeof(int).

(cherry picked from commit 7f4bb50176)
2021-10-08 19:56:53 -05:00
Ed Maste
d71103026d ar: provide error exit status upon failure
Previously ar and ranlib returned with exit status 0 (success) in the
case of a missing file or other error.  Update to use error handling
similar to that added by ELF Tool Chain after that project forked
FreeBSD's ar.

PR:		PR257599 [exp-run]
Reported by:	Shawn Webb, gehmehgeh (on HardenedBSD IRC)
Reviewed by:	markj
Obtained from:	elftoolchain
MFC after:	2 months
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31402

(cherry picked from commit 38911b3c2c)
2021-10-08 20:28:31 -04:00
Kyle Evans
6a1ef178d8 cmp: add -b, --print-bytes
This is compatible with GNU cmp.

Reviewed by:	bapt, markj (earlier version)
Sponsored by:	Klara, Inc.

(cherry picked from commit f66b9b40f4)
2021-10-03 00:15:12 -05:00
Kyle Evans
0ab72f80ab cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args
This is compatible with GNU cmp.

Reviewed by:	markj
Sponsored by:	Klara, Inc.

(cherry picked from commit 8d546b6832)
2021-10-03 00:15:08 -05:00
Kyle Evans
1159a71ad7 cmp: add -n, --bytes to limit number of bytes to compare
This is compatible with GNU cmp.

Reviewed by:	markj
Sponsored by:	Klara, Inc.

(cherry picked from commit 4e380e8474)
2021-10-03 00:15:05 -05:00
Kyle Evans
5d3ac4ddf9 cmp: accept SI suffixes for skip1 and skip2
This is compatible with GNU cmp.

Reviewed by:	bapt (earlier version), markj, imp
Sponsored by:	Klara, Inc.

(cherry picked from commit f6787614fd)
2021-10-03 00:15:01 -05:00
Kyle Evans
0760a2e9a4 man: reset OPTIND before parsing args
From jilles: POSIX requires that a script set `OPTIND=1` before using
different sets of parameters with `getopts`, or the results will be
unspecified.

The specific problem observed here is that we would execute `man -f` or
`man -k` without cleaning up state from man_parse_args()' `getopts`
loop.  FreeBSD's /bin/sh seems to reset OPTIND to 1 after we hit the
second getopts loop, rendering the following shift harmless; other
/bin/sh implementations will leave it at what we came into the loop at
(e.g., bash as /bin/sh), shifting off any keywords that we had.

Input from:	jilles
Reviewed by:	allanjude, bapt, imp
Sponsored by:	Klara, Inc.

(cherry picked from commit f555b39e6b)
2021-10-03 00:14:43 -05:00
Yoshihiro Takahashi
cea130c0b8 unzip: sync with NetBSD upstream to add passphrase support
- Add support for password protected zip archives.
  We use memset_s() rather than explicit_bzero() for more portable
  (See PR).
- Use success/failure macro in exit()
- Mention ZIPX format in unzip(1)

Submitted by:	Mingye Wang and Alex Kozlov (ak@)
PR:		244181
Reviewed by:	mizhka
Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D28892

(cherry picked from commit a4724ff481)
2021-10-02 20:56:19 +09:00
Piotr Pawel Stefaniak
a8446d4124 diff3: document and test -T
(cherry picked from commit 9f7a81b133)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
dbabfd7e26 diff3: implement --strip-trailing-cr
(cherry picked from commit 54a3415cb6)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
000d03450b diff3.1: update manual page to match code
(cherry picked from commit e8ff95356c)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
216bf478e2 diff3: improve style
(cherry picked from commit 702dda4368)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
4bfbc5fbc9 diff3: sync with upstream
* replace realloc calls with reallocarray calls
 * fix merging of files that lack newlines

Obtained from:	OpenBSD

(cherry picked from commit 7f7b03f389)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
bda949b6ef diff: read whole files to determine if they are ASCII text
Before this change, only the first BUFSIZE bytes were checked.

(cherry picked from commit 3cbf98e2be)
2021-09-25 10:34:39 +02:00
Piotr Pawel Stefaniak
ece58f7ada diff: don't output carriage returns that were stripped on input
--strip-trailing-cr worked as intended for comparison between files,
but the characters were still present in final output.

(cherry picked from commit af2f016431)
2021-09-25 10:34:38 +02:00
Konstantin Belousov
492a76bcd6 proccontrol(1): Add wxmap control
(cherry picked from commit ac8af19380)
2021-09-24 03:26:59 +03:00