Commit graph

21003 commits

Author SHA1 Message Date
Jessica Clarke
712920c3c7 Revert "Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now"
The fixes for this have now been committed so we can re-enable these.

This reverts commit d9f25575a2.

MFC after:	1 week

(cherry picked from commit 83ec48b792)
2021-09-07 13:08:20 +01:00
Jessica Clarke
523f2486d5 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

(cherry picked from commit c8edd05426)
2021-09-07 13:08:19 +01:00
Jessica Clarke
902a992ffa gpio.4: Mention new sifive_gpio driver
Suggested by:	mhorne
MFC after:	1 week

(cherry picked from commit 5668a155cb)
2021-09-07 13:08:14 +01:00
Philip Paeps
783ace2264 tcp: document TCP Fast Open (RFC 7413) in tcp(4)
Adds documentation for the TCP_FASTOPEN socket option
and related MIB variables to the tcp(4) manual page.

PR:		257907
Reviewed by:	gbe
Differential Revision:	https://reviews.freebsd.org/D31764

(cherry picked from commit 71611b0c68)
2021-09-06 09:06:09 +08:00
Dimitry Andric
87addf6610 Remove -simplifycfg-dup-ret from CLANG_OPT_SMALL flags for clang 13
After llvm/clang 13.0.0, the -simplifycfg-dup-ret backend flag is no
longer supported. This was part of CLANG_OPT_SMALL, which is only still
used for stand/i386/boot2 and stand/i386/isoboot, to achieve the very
small binary size required. Luckily clang 13.0.0 does not need any
additional flags for this (I get 240 bytes available when building
boot2).

(cherry picked from commit 22b8ab15c4)
2021-09-02 23:53:18 +02:00
Gordon Bergling
aa9d47d9de Fix a common typo in man pages and src comments
- s/desciptor/descriptor/

(cherry picked from commit b1603638e3)
2021-09-02 08:13:48 +02:00
Ka Ho Ng
6f89edcd83 pmap_extract.9: Fix pmap_extract_and_hold()'s function type
pmap_extract_and_hold() returns a vm_page_t instead of a physical page
address.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D31691

(cherry picked from commit 6e1df1d14c)
2021-08-31 14:47:24 +08:00
Mitchell Horne
706df48aed arm: enable stack-smashing protection
With current generation clang/llvm it can pass all of our tests in
libc/ssp.

While here, remove the extra MACHINE_CPUARCH check for mips. SSP is
included in BROKEN_OPTIONS for this architecture in src.opts.mk, which
is enough to ensure normal builds won't set SSP_CFLAGS.

Reviewed by:	kevans, imp, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31400

(cherry picked from commit 1b8db4b4e3)
2021-08-30 12:53:59 -03:00
Mark Johnston
9d3454e1e1 pci: Add an ioctl to perform I/O to BARs
This is useful for bhyve, which otherwise has to use /dev/io to handle
accesses to I/O port BARs when PCI passthrough is in use.

Reviewed by:	imp, kib
Discussed with:	jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7e14be0b07)
2021-08-29 12:39:42 -04:00
Piotr Pawel Stefaniak
e5db193a65 style.9: remove an outdated comment about indent(1)
(cherry picked from commit f49931c142)
2021-08-28 10:16:33 +02:00
Goran Mekić
e899971b81 sound: Add an example of basic sound application
This is an example demonstrating the usage of the OSS-compatible APIs
provided by the sound(4) subsystem. It reads frames from a dsp node and
writes them to the same dsp node.

Reviewed by:	hselasky, bcr
Differential revision:	https://reviews.freebsd.org/D30149

(cherry picked from commit 21d8546588)
2021-08-27 16:50:44 +08:00
Adam Fenn
e70e1b132e malloc(9): Document/complete aligned variants
Comments on a pending kvmclock driver suggested adding a
malloc_aligned() to complement malloc_domainset_aligned(); add it now,
and document both.

(cherry picked from commit 6162cf885c)
(cherry picked from commit 04cc0c393c)
2021-08-26 12:28:38 -05:00
Vladimir Kondratyev
8f559509a2 bitstring(3): Add bitstring traversal macros.
The macro bit_foreach() traverses all set bits in the bitstring in the
forward direction, assigning each location in turn to variable.

The macro bit_foreach_at() traverses all set bits in the bitstring in
the forward direction at or after the zero-based bit index, assigning
each location in turn to variable.

The bit_foreach_unset() and bit_foreach_unset_at() macros which
traverses unset bits are implemented for completeness.

Reviewed by:	asomers, dougm

(cherry picked from commit 14a4d6d013)
2021-08-24 01:23:10 +03:00
Kyle Evans
8a206a2265 kern: ether_gen_addr: randomize on default hostuuid, too
Currently, this will still hash the default (all zero) hostuuid and
potentially arrive at a MAC address that has a high chance of collision
if another interface of the same name appears in the same broadcast
domain on another host without a hostuuid, e.g., some virtual machine
setups.

Instead of using the default hostuuid, just treat it as a failure and
generate a random LA unicast MAC address.

Reviewed by:	bz, gbe, imp, kbowling, kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29788

(cherry picked from commit 2d741f33bd)
2021-08-20 14:32:31 -07:00
Kyle Evans
32294ca073 man: document ether_gen_addr(9)
This KPI is used to assign a MAC address to an interface that doesn't
already have one assigned.

Reviewed by:	bcr, gnn, imp, kbowling, kp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29787

(cherry picked from commit e58a65ccda)
2021-08-20 14:32:23 -07:00
Cy Schubert
13f32ff71e wpa: Restructure wpa build
The current WPA build assumes a flat namespace. However the latest sources
from w1.fi now have a duplicate config.c, in two separate subdirectories.
The flat namespace will overwrite config.o with the output from the most
recently modified config.c, of which there are two of them.

This commit resolves this problem by building each component in
wpa's src subdirectory tree into its own .a archive, just as the w1.fi
upstream build as used by the port does. The advantages of this approach
are:

1. Duplicate source file names, i.e. config.c in the wpa_supplicant
   direcory and another config.c in src/utils in the next wpa
   will result in both compiles writing to the same .o file.

2. This restructure simplifies maintanence. A develper needs only to add
   new files as identified by git status in the vendor branch to the
   appropriate Makefile within the usr.sbin/wpa tree. This also reduces
   time required to prepare a new import and should reduce error.

3. The new wpa build structure more closely represents the build as
   performed by the upstream tarball.

This is in preparation for the next wpa update from w1.fi.

Reviewed by:	philip
Tested by:	philip
Differential Revision:	https://reviews.freebsd.org/D30372

(cherry picked from commit 25ecdc7d52)
2021-08-20 08:24:54 -07:00
Gordon Bergling
f296898fb7 Fix a common typo in source code comments
- s/aligment/alignment/

(cherry picked from commit a1581cd735)
2021-08-19 09:18:35 +02:00
Emmanuel Vadot
c432a00752 pkgbase: Fix cherry-pick conflict
17fe7de111 was supposed to remove the option from src.opts.mk
2021-08-19 09:09:39 +02:00
Jung-uk Kim
17fe7de111 pkgbase: Fix building out-of-tree manual pages
c7e6cb9e08 introduced MK_MANSPLITPKG but it was not available for
building out-of-tree manual pages.  For example, x11/nvidia-driver fails
with the following error:

===> doc (all)
make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no")
make[3]: Fatal errors encountered -- cannot continue

Move the definition from src.opts.mk to bsd.opts.mk to make it visible.

(cherry picked from commit 6827435548)
2021-08-19 09:08:06 +02:00
Alex Richardson
64f6c8d616 Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now
I enabled these options again in 31ba4ce889,
but unfortunately only my specific build configuration worked whereas the
build with default options is still broken.

(cherry picked from commit d9f25575a2)
2021-08-18 09:34:19 +01:00
Mark Johnston
72a8cdd322 build.7: Describe the default value for LOCAL_MODULES
Suggested by:	jhb

(cherry picked from commit 805c3af898)
2021-08-17 09:56:15 -04:00
Mark Johnston
1ee912e80e build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR
Reviewed by:	0mp, imp
Sponsored by:	The FreeBSD Foundation

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

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

(cherry picked from commit c7e6cb9e08)
2021-08-16 18:13:51 +02:00
Mateusz Piotrowski
c8faaf3787 ports.7: Document DEBUG_FLAGS and the process of debugging ports
Loosely based on https://wiki.freebsd.org/BenWoods/DebuggingPorts.

Reviewed by:	crees
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27296

(cherry picked from commit d25f7d324a)
2021-08-15 23:02:08 +02:00
Peter Grehan
d7388d33b4 MFC 517904de5c: igc(4): Introduce new driver for the Intel I225 Ethernet controller.
This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by:	bcr (manpages), kbowling, scottl, erj
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30668

(cherry picked from commit 517904de5c)
2021-08-15 20:33:54 +10:00
Konstantin Belousov
0896bbff7f ip(4): Mention IP_IPSEC_POLICY ip-level socket option
(cherry picked from commit 4a5a67fe67)
2021-08-13 12:34:42 +03:00
Alex Richardson
c65dab7dd2 Allow bootstrapping llvm-tblgen on macOS and Linux
This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.

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

(cherry picked from commit 31ba4ce889)
2021-08-05 10:01:08 +01:00
Alex Richardson
1d7c196d11 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

(cherry picked from commit 2de949cf85)
2021-08-05 10:00:56 +01:00
Alex Richardson
e2e533bdcc bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR
Recent versions of homebrew's LLD are built with PACKAGE_VENDOR (since
e7c972b606).
This means that the -v output is now
`Homebrew LLD 12.0.1 (compatible with GNU linkers)` and bsd.linker.mk no
longer detects it as LLD since it only checks whether the first word is
LLD. This change allow me to build on macOS again and should unbreak the
GitHub actions CI.

Reviewed By:	imp, uqs
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D31224

(cherry picked from commit f8147dad44)
2021-08-05 10:00:36 +01:00
Alex Richardson
22548a3b80 Simplify and speed up the kyua build
Instead of having multiple kyua libraries, just include the files as part
of usr.bin/kyua. Previously, we would build each kyua source up to four
times: once as a .o file and once as a .pieo. Additionally, the kyua
libraries might be built again for compat32. As all the kyua libraries
amount to 102 C++ sources the build time is significant (especially when
using an assertions enabled compiler). This change ensures that we build
306 fewer .cpp source files as part of buildworld.

Reviewed By:	brooks
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30967

Remove lib/kyua from the build

I forgot to include this line in 2eb9ad4274.

Reported by:	Jenkins CI
MFC after:	1 week
Fixes:		2eb9ad427475190ei ("Simplify and speed up the kyua build")

Revert "Remove lib/kyua from the build"

Accidentally removed it from the wrong file...

This reverts commit 8ec4ba8a76.

Remove lib/kyua from the build

I forgot to include this line in 2eb9ad4274.

Reported by:    Jenkins CI
MFC after:      1 week
Fixes:          2eb9ad427475190ei ("Simplify and speed up the kyua build")

(cherry picked from commit 2eb9ad4274)
(cherry picked from commit 8ec4ba8a76)
(cherry picked from commit 89da04fcaa)
(cherry picked from commit c951566915)
2021-08-05 09:56:47 +01:00
Ed Maste
5f27244beb src.conf.5: regen after 3f244aace2 2021-08-04 13:24:02 -04:00
Konstantin Belousov
dfda6a71e7 /dev/pci: clarify meaning of writeable file descriptor
(cherry picked from commit 85ae35ef37)
2021-08-03 12:52:36 +03:00
Luiz Otavio O Souza
50ecd99be5 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263

(cherry picked from commit 1e7fe2fbb9)
2021-08-02 16:50:32 +02:00
Tom Jones
a77a6a049e inet6_option_space is deprecated, refer to inet6_opt_init instead
Reviewed by:	bz, hrs
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26273

(cherry picked from commit 0943200b13)
2021-08-02 13:58:51 +01:00
Kristof Provost
7408fb55f0 pf.conf.5: Document new 'match' keyword
Reviewed by:	bcr
Obtained from:	pfSense
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31117

(cherry picked from commit 0351b9875a)
2021-07-31 10:12:10 +02:00
Mark Johnston
3afad070bd man9: Update guarantees for userspace fetch/store operations
Platforms may either silently handle unaligned accesses or return an
error.  Atomicity is not guaranteed in this case, however.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fd5827b178)
2021-07-29 08:11:39 -04:00
Mark Johnston
c2edab507e man9: Remove stray .In macros
Fixes:		9c11d8d483

(cherry picked from commit 18c696c001)
2021-07-29 08:11:30 -04:00
Li-Wen Hsu
f61cd3dbe4
man7: Update FreeBSD.org URLs
MFC after:	3 days

(cherry picked from commit 8dfb002457)
2021-07-28 03:22:25 +08:00
Li-Wen Hsu
5201006cf9
share/misc: Update FreeBSD.org URLs
MFC after:	3 days

(cherry picked from commit 89c0640c70)
2021-07-28 03:21:19 +08:00
Mark Johnston
268b034fbc Add some missing osd.9 MLINKs
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5d40fb677a)
2021-07-23 07:49:39 -04:00
Emmanuel Vadot
a402f80395 an: Deprecate the driver
Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision:	https://reviews.freebsd.org/D30678
Reviewed by:		imp (earlier version), adrian (earlier version)
MFC after:		3 days
Sponsored by:		Diablotin Systems

(cherry picked from commit ab30bb8270)
2021-07-22 19:18:56 +02:00
Oskar Holmund
5c11eddf95 share/man/man9/pwmbus.9 fix types in arguments
Fix the types of period and duty in share/man/man9/pwmbus.9 to match the one in sys/dev/pmw/pwmbus.c.

Reviewed By: rpokala
Differential Revision: https://reviews.freebsd.org/D29139
MFC after:   3 days

(cherry picked from commit 7d4a5de84d)
2021-07-22 18:39:56 +02:00
Warner Losh
9148a80a65 mk: LZMA_SUPPORT is unused
Retire LZMA_SUPPORT. It's unused since r332995.

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

(cherry picked from commit d8514fa6f1)
2021-07-16 12:28:44 -06:00
Michael Tuexen
c5ba872129 tcp: tolerate missing timestamps
Some TCP stacks negotiate TS support, but do not send TS at all
or not for keep-alive segments. Since this includes modern widely
deployed stacks, tolerate the violation of RFC 7323 per default.

Reviewed by:		rgrimes, rrs, rscheff
Differential Revision:	https://reviews.freebsd.org/D30740
Sponsored by:		Netflix, Inc.

(cherry picked from commit 870af3f4dc)
2021-07-13 20:24:09 +02:00
Warner Losh
d765d5c2c3 config_intrhook: provide config_intrhook_drain
config_intrhook_drain will remove the hook from the list as
config_intrhook_disestablish does if the hook hasn't been called.  If it has,
config_intrhook_drain will wait for the hook to be disestablished in the normal
course (or expedited, it's up to the driver to decide how and when
to call config_intrhook_disestablish).

This is intended for removable devices that use config_intrhook and might be
attached early in boot, but that may be removed before the kernel can call the
config_intrhook or before it ends. To prevent all races, the detach routine will
need to call config_intrhook_train.

Sponsored by:		Netflix, Inc
Reviewed by:		jhb, mav, gde (in D29006 for man page)
Differential Revision:	https://reviews.freebsd.org/D29005

(cherry picked from commit e52368365d)
2021-07-12 13:30:55 -06:00
Ceri Davies
f00dd44f0a devmatch: improve naming of devmatch config variable
Accept the old rc.conf variable if the new one is not present for
compatability.

Approved by:	imp
Differential Revision:	https://reviews.freebsd.org/D30806

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

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

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

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 175841285e)

Clarify notice for profiled libraries in FreeBSD 14

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

(cherry picked from commit f94360971e)
2021-07-07 09:17:06 -04:00
Alan Somers
d6e8b20898 vn_fullpath.9: update args after rev 364633
Sponsored by:	Axcient
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D30779

(cherry picked from commit fcb5a0a2ad)
2021-07-03 17:39:03 -06:00
Emmanuel Vadot
e39af9beda pkgbase: Put the mibs and defs in the bnsmp package
Differential Revision:	https://reviews.freebsd.org/D30756
Sponsored by:	Diablotin Systems
2021-06-30 09:24:33 +02:00
Emmanuel Vadot
9e4940840d pkgbase: Put dtrace in its own package
While dtrace is usefull some people might not want it.

Differential Revision:	https://reviews.freebsd.org/D30752
Sponsored by:	Diablotin Systems
2021-06-30 09:24:32 +02:00