Commit Graph

14964 Commits

Author SHA1 Message Date
Warner Losh
d780a23a99 tabs: a hacky version of tabs appeared in 1st edition Unix
First edition Unix had an /etc/tabs file. It contained the escape
sequences to set tabs to every 8 stops on an old Teletype Model 37 and
compatible terminals. One would 'cat /etc/tabs' to reset them.  Unix at
the time effectively mandated this because the delays in the tty driver
assumed this and tabs didn't work when they were too different from '8'.
Document this historical niggle in HISTORY after it was brought to my
attention on a Hacker News thread.

Sponsored by: Netflix
2021-09-09 17:11:18 -06:00
John Grafton
4ccbbe5f06 top(1): indicate how to reset grep string
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/536/files
2021-09-07 20:56:45 -06:00
Emmanuel Vadot
b5be5c35db pkgbase: Create a FreeBSD-ftp package
ftp tools aren't that useful nowadays but some might want them.
Create a FreeBSD-ftp package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31794
2021-09-07 10:25:23 +02:00
Emmanuel Vadot
a30235a4c3 pkgbase: Create a FreeBSD-kerberos package
This allows users to install or not kerberos related utilities
and libs.

Differential Revision:	https://reviews.freebsd.org/D31801
2021-09-07 10:23:14 +02:00
Emmanuel Vadot
cab6a39d7b pkgbase: Create a FreeBSD-rdma package
Put all the rdma related tools into this package.

Differential Revision:	 https://reviews.freebsd.org/D31799
2021-09-07 10:22:16 +02:00
Emmanuel Vadot
c7fd29f0f2 pkgbase: Create a FreeBSD-telnet package
both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31791
Reviewed by: emaste
2021-09-07 10:18:11 +02:00
Alex Richardson
021385aba5 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
2021-09-06 09:49:49 +01:00
Alex Richardson
8e1c989abb 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
2021-09-06 09:32:41 +01:00
Mitchell Horne
4d0dc60f14 xinstall: fix invocation of llvm-strip
When executing strip(1), '--' is passed as an argument to explicitly
terminate the getopt(3) loop. The option parsing in llvm-strip doesn't
support this however, so setting XSTRIPBIN=llvm-strip results in an
unsupported argument error. llvm-strip(1) is otherwise
commandline-compatible with FreeBSD's strip(1), so just use the
documented argument format that is common to both.

Special care needs to be taken for filenames beginning with a '-'.

Reviewed by:	arichardson, eugen (earlier version, both)
Discussed with:	jilles
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30614
2021-08-30 11:56:10 -03:00
Konstantin Belousov
17fc43bc01 ldd: Remove non-functional -v option
It seems -v only worked for a.out.  Remove it, not even keeping the current
nop for compat.  Also remove more mentions of a.out format from the man
page.

Reviewed by:	dim, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31708
2021-08-28 23:39:16 +03:00
Gordon Bergling
5bdf58e196 Fix some common typos in source code comments
- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

MFC after:	3 days
2021-08-28 18:57:23 +02:00
Piotr Pawel Stefaniak
9f7a81b133 diff3: document and test -T
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D31650
2021-08-25 18:20:59 +02:00
Jessica Clarke
c8edd05426 clang: Support building with GCC and DEBUG_FILES disabled
If MK_DEBUG_FILES=no then the Clang link rule has clang as .TARGET,
rather than clang.full, causing the implicit ${CFLAGS.${.TARGET:T}} to
be CFLAGS.clang, and thus pull in flags intended for when your compiler
is Clang, not when linking Clang itself. This doesn't matter if your
compiler is in fact Clang, but it breaks using GCC as, for example,
bsd.sys.mk adds -Qunused-arguments to CFLAGS.clang. This is seen when
trying to build a bootstrap toolchain on Linux where GCC is the system
compiler.

Thus, introduce a new internal NO_TARGET_FLAGS variable that is set by
Clang to disable the addition of these implicit flags. This is a bigger
hammer than necessary, as flags for .o files would be safe, but that is
not needed for Clang.

Note that the same problem does not arise for LDFLAGS when building LLD
with BFD, since our build produces a program called ld.lld, not plain
lld (unlike upstream, where ld.lld is a symlink to lld so they can
support multiple different flavours in one binary).

Suggested by:	sjg
Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week
Reviewed by:	dim, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D31532
2021-08-24 15:04:25 +01:00
Piotr Pawel Stefaniak
3cbf98e2be diff: read whole files to determine if they are ASCII text
Before this change, only the first BUFSIZE bytes were checked.

Reviewed by:	bapt (previous version)
Differential Revision:	https://reviews.freebsd.org/D31639
2021-08-23 16:09:05 +02:00
Gordon Bergling
72a92f91f4 nfsstat(1): Fix a typo in an error message
- s/priviledged/privileged/

MFC after:	1 week
2021-08-23 09:21:28 +02:00
Piotr Pawel Stefaniak
54a3415cb6 diff3: implement --strip-trailing-cr
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D31626
2021-08-23 07:04:28 +02:00
Piotr Pawel Stefaniak
e8ff95356c diff3.1: update manual page to match code 2021-08-23 07:04:28 +02:00
Piotr Pawel Stefaniak
702dda4368 diff3: improve style 2021-08-23 07:04:28 +02:00
Piotr Pawel Stefaniak
7f7b03f389 diff3: sync with upstream
* replace realloc calls with reallocarray calls
 * fix merging of files that lack newlines

Obtained from:	OpenBSD
2021-08-23 07:04:28 +02:00
Piotr Pawel Stefaniak
af2f016431 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.
2021-08-23 07:04:28 +02:00
Thomas Munro
f30a1ae8d5 lio_listio(2): Allow LIO_READV and LIO_WRITEV.
Allow multiple vector IOs to be started with one system call.
aio_readv() and aio_writev() already used these opcodes under the
covers.  This commit makes them available to user space.

Being non-standard extensions, they're only visible if __BSD_VISIBLE is
defined, like the functions.

Reviewed by:    asomers, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D31627
2021-08-22 23:00:42 +12:00
Ka Ho Ng
ce71a0fa99 truncate(1): Update tests' golden output
After commit 5ee2c35751 truncate(1)'s usage output was extended.
Update the golden output in test cases to match the changes made.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	lwhsu
Differential Revision:	https://reviews.freebsd.org/D31628
2021-08-21 17:04:21 +08:00
Ka Ho Ng
a54abe119e truncate(1): Fix missing -d option manpage
Mention that either one of the -r, -s and -d options must be specified.

Sponsored by:	The FreeBSD Foundation
2021-08-19 18:45:25 +08:00
Ka Ho Ng
5ee2c35751 truncate(1): Add hole-punching support
This commit adds hole-punching support to the truncate(1) utility. If
the option -d is specified, truncate(1) performs zeroing, and if
possible hole-punching in case the operation is supported by the
underlying file system of the specified files.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D31556
2021-08-19 18:30:41 +08:00
Ka Ho Ng
89c0d2b190 truncate(1): main() return statement style fix
Sponsored by:	The FreeBSD Foundation
2021-08-18 23:45:59 +08:00
Mark Johnston
58b1a126b9 tail: Add regression tests for -f and -F
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31055
2021-08-14 11:19:42 -04:00
Mark Johnston
7e11889959 tail: Fix -f with stdin
Based on a patch from swills@.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31113
2021-08-14 11:19:32 -04:00
Gordon Bergling
288e553623 Fix a few typos in source code comments
- s/procesing/processing/

MFC after:	5 days
2021-08-14 10:08:49 +02:00
Ed Maste
866c807472 ar: remove duplicate function declaration in header
Sponsored by:	The FreeBSD Foundation
2021-08-13 16:58:18 -04:00
Ed Maste
57aaefdcec ar: diff reduction against ELF Tool Chain
Remove ar_mode_* wrappers and call ar_read_archive / ar_write_archive
directly.

(This was originally committed in d20e9e02db but reverted due to a
regression, now fixed with an update from cy@.)

Obtained from:	ELF Tool Chain
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31496
2021-08-13 11:17:46 -04:00
Ed Maste
086f090877 ar: diff reduction against ELF Tool Chain
Drop exit status from bsdar_errc.  ELF Tool Chain always returns
EXIT_FAILURE in bsdar_errc.

Recommit of one part of d20e9e02db / review D31496.

Obtained from:	ELF Tool Chain
Sponsored by:	The FreeBSD Foundation
2021-08-13 10:39:44 -04: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
Ed Maste
c5bf58add0 Revert "ar: diff reduction against ELF Tool Chain"
This reverts commit d20e9e02db.
It caused port build failures.

Reported by:	cy
2021-08-12 14:26:37 -04:00
Ed Maste
d20e9e02db ar: diff reduction against ELF Tool Chain
- Drop exit status from bsdar_errc.  ELF Tool Chain always returns
  EXIT_FAILURE in bsdar_errc.

- Remove ar_mode_* wrappers and call ar_read_archive / ar_write_archive
  directly.

Obtained from:	ELF Tool Chain
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31496
2021-08-11 19:12:46 -04:00
Ed Maste
09319f7d3f ar: remove invalid extra param in bsdar_warnc calls
A number of warnings passed an exit status code to bsdar_warnc, but it
does not take exit status (as a warning, it does not exit).

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-08-11 13:27:19 -04:00
Ed Maste
38911b3c2c 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
2021-08-10 17:08:10 -04:00
Gordon Bergling
6bddade611 mkimg(1): Correct a typo in the usage output
- s/partion/partition/

MFC after:  5 days
2021-08-09 13:53:30 +02:00
Gordon Bergling
04389c855e Fix some common typos in comments
- s/configuraiton/configuration/
- s/specifed/specified/
- s/compatiblity/compatibility/

MFC after:	5 days
2021-08-08 10:16:06 +02:00
Ed Maste
a0d701f614 vtfontcvt: minor style(9) fixes from clang-format
Found during clang-format experiments (in D26340).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30237
2021-08-04 15:08:21 -04:00
Warner Losh
aaccfdde3d awk: Enable tests again
Since we now pass all 24 of the NetBSD awk tests, re-enable these tests.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31370
2021-08-02 15:53:26 -06: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
Alex Richardson
2de949cf85 Remove mkcsmapper_static and mkesdb_static from build-tools
Build them as part of the bootstrap-tools phase instead.

Reviewed by:	emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181
2021-08-02 14:33:25 +01:00
Warner Losh
a226a9cf8e awk: use awkgram.tab.h consistently
yacc makes awkgram.h. However, one true awk includes awkgram.tab.h, so
we link to for the builds. Make sure that we consistently link to it.
Also, restore the awkgram.tab.h dependency to maketab. It should not
have been deleted, despite apparently making meta build on stable/12
work. The important missing arc was proctab.c's dependence on
awkgram.tab.h.

MFC After:	1 day (build breakage)
Fixes:		c50c8502cb
Sponsored by:	Netflix
2021-07-31 16:24:12 -06:00
Warner Losh
c50c8502cb awk: Fix dependencies
proctab.c is generated from awktab.h, so needs to depend on it.
maketab does not depend on awktab.h, and gets the maketab.c dependency
automatically, so remove them both.

Normally, these don't matter. However, for a meta build, they can cause
us to build maketab twice (once host, once for target) resulting in a
binary that can't run on the host due to proctab.c racing maketab in
parallel legs. In stable/12, this was a reliably lost race, while in
main I've been unable to trigger the race at all (maybe due to dirdep
changes making main more robust).

MFC After:	1 day (build breakage)
Reported by:	kp
Sponsored by:	Netflix
2021-07-31 15:48:26 -06:00
Warner Losh
f7f76c200a awk: Document deprecated behavior of hex constants and locales.
FreeBSD will convert "0x12" from hex and print it as 18. Other awks will
convert it to 0. This extension has been removed upstream, and will be
removed in FreeBSD 14.0.

FreeBSD used to set the locale on startup, and make the ranges use that
locale. This lead to weird results like "[A-Z]" matching lower case
characters in some locales. This bug has been fixed.

MFC After:		3 days
Sponsored by:		Netflix
2021-07-30 23:41: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
Poul-Henning Kamp
272144ab41 hexdump: Flush stdout after '*' (repeat) lines.
The canonical annoying example being:   hexdump < /dev/zero | less
2021-07-29 06:40:57 +00:00
Baptiste Daroussin
fe787aa3b2 calendars: fix tabs vs space indentation 2021-07-27 18:55:31 +02:00
Robert Wing
0626b0a89c Add myself to the calendar 2021-07-24 16:12:17 -08:00
Pedro F. Giffuni
c384a27805 patch: cleanup variable initialization a bit.
musl libc fgetln is a bit more pickier.

Hinted by:	chimera-linux (git 31491e1de2e1241885984cd9e4b978965f14eda4)
2021-07-22 14:23:22 -05:00