Commit graph

21603 commits

Author SHA1 Message Date
Mike Karels
1ab4b70db5 res_init: remove unused inet_makeaddr with IN_LOOPBACKNET
Remove code that is ifdefed out on USELOOPBACK, which uses historical
class.  No functional change intended.

(cherry picked from commit 0bf7f99b2a)
2021-12-10 10:26:14 -06:00
Mike Karels
d98a0edb26 man pages: deprecate Internet Class A/B/C
Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as
deprecated, as they assume Class A/B/C.  inet_makeaddr() mostly works
when networks are a multiple of 8 bits, but warn for anything other
than historical classes.  Reduce other mentions of network classes.

(cherry picked from commit 12bd931d8c)
2021-12-10 10:25:45 -06:00
Michael Tuexen
4bf3c8ea0d libc sctp: improve conformance of sctp_getpaddrs()
When there is no association, don't return -1 and indicate ENOENT,
but return 0 instead. This is specified in RFC 6458.

PR:		260117
MFC after:	1 week

(cherry picked from commit 83a103ec42)
2021-12-10 11:39:15 +01:00
Michael Tuexen
6a5487e34b libc sctp: fix sctp_getladdrs() when reporting no addresses
Section 9.5 of RFC 6458 (SCTP Socket API) requires that
sctp_getladdrs() returns 0 in case the socket is unbound. This
is the cause of reporting 0 addresses. So don't indicate an
error, just report this case as required.

PR:		260117
MFC after:	1 week

(cherry picked from commit 071966e874)
2021-12-10 11:38:31 +01:00
Michael Tuexen
4749d55fb3 libc sctp: improve error reporting of sctp_getladdrs()
Do not hide errno from getsockopt() called internally.

MFC after:	1 week

(cherry picked from commit 6e9309bd3b)
2021-12-10 11:26:31 +01:00
Michael Tuexen
30e6da1149 libc sctp: fix sctp_getladdrs() for 64-bit BE platforms
When calling getsockopt() with SCTP_GET_LOCAL_ADDR_SIZE, use a
pointer to a 32-bit variable, since this is what the kernel
expects.
While there, do some cleanups.

MFC after:	1 week

(cherry picked from commit dabd8bf914)
2021-12-10 11:25:21 +01:00
Konstantin Belousov
ed43c7ac0a procstat_getfiles_sysctl: do not require non-null ki_fd
PR:	260174

(cherry picked from commit 7a9423d6f3)
2021-12-09 02:23:29 +02:00
Konstantin Belousov
0ab5452ca3 Style
(cherry picked from commit 0ea3e4a27b)
2021-12-09 02:23:28 +02:00
Konstantin Belousov
bc663f746e Document posix_spawn_file_actions_addclosefrom_np(3)
(cherry picked from commit 78963d796d)
2021-12-07 02:25:55 +02:00
Konstantin Belousov
54cdfdf12a posix_spawn: add closefrom non-portable action
(cherry picked from commit a18ddf7757)
2021-12-07 02:25:55 +02:00
Konstantin Belousov
ef39284e94 Document posix_spawn_file_actions_addchdir_np(3)
(cherry picked from commit bd44dce5b3)
2021-12-07 02:25:55 +02:00
Konstantin Belousov
c7b624979a posix_spawn: add chdir-related non-portable actions
(cherry picked from commit 25cda42a49)
2021-12-07 02:25:53 +02:00
Konstantin Belousov
4529cb3db2 posix_spawn(3), posix_spawn_file_actions_addopen(3): use .Fo/.Fc
(cherry picked from commit 8ed1e4a5c1)
2021-12-07 02:25:01 +02:00
Konstantin Belousov
94f97c0424 posix_spawn: style, use return ()
(cherry picked from commit b239cc204a)
2021-12-07 02:25:01 +02:00
Konstantin Belousov
198932fd77 posix_spawn.c: format fae_action anon enum more stylish
(cherry picked from commit adbaf1b443)
2021-12-07 02:25:01 +02:00
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
Dimitry Andric
37ce25d2c0 llvm-readobj: Add missed source file
In some configurations (e.g. powerpc64) the llvm-readobj tool also needs
contrib/llvm-project/llvm/BinaryFormat/MsgPackWriter.cpp, so add it to
libllvm.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Fixes:		1b85b68da0

(cherry picked from commit 79239b5b47)
2021-12-06 17:30:07 +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
18baa99126 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

(cherry picked from commit 8c6f6c0c80)
2021-12-06 17:30:05 +01:00
Dimitry Andric
c77c1b5c48 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

(cherry picked from commit 69ade1e033)
2021-12-06 17:30:04 +01:00
Dimitry Andric
2e2f8eac75 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

(cherry picked from commit 6e75b2fbf9)
2021-12-06 17:30:03 +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
Mark Johnston
d0bcdb3e10 libelf: Link gelf_getchdr.3 to the build
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9ff084f0fa)
2021-12-06 09:04:03 -05:00
Konstantin Belousov
f457e04994 citrus_prop.c: do not ignore sign
(cherry picked from commit 181751a8b6)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
c20c7a3122 libc/tests/stdlib/dynthr_mod/dynthr_mod.c: mark dummy as used
(cherry picked from commit a64a3b7988)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
f19aa58ee6 libc/stdio/vfwscanf.c::convert_wstring(): wcp0 is write-only
(cherry picked from commit c8a4a49d58)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
f894975dda libc/x86/__vdso_gettc.c::tsc_selector_idx(): cpu_id is calculated but not used
(cherry picked from commit 4b6f4db341)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
f4669d7064 acl_delete_entry(): remove write-only variable
(cherry picked from commit 959c7ab51e)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
065166c76a setproctitle_internal(): remove kbuf local, it is write-only
(cherry picked from commit 412fd7a34c)
2021-12-06 02:23:45 +02:00
Konstantin Belousov
5298739f2d libc/rpc/getrpcent.c: Mark write-only variables as unused
(cherry picked from commit 16b238b740)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
9cb9ecafac libc/net/nscachedcli.c: remove write-only variables
(cherry picked from commit 0e00befcaf)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
9e8f0f6934 libc/net/getservent.c: Mark write-only variables as unused
(cherry picked from commit 346eaa41f8)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
75f8750524 libc/net/getprotoent.c: Mark write-only variables as unused
(cherry picked from commit f6d403743c)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
4914a141fb libc/net/getnetnamadr.c: Mark write-only variables as unused
(cherry picked from commit 1c4f305d21)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
20e0f16d35 libc/net/gethostnamadr.c: mark write-only variables as __unused
(cherry picked from commit 024547c9bd)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
0c80653b16 libc/gen/getpwent.c: plug warnings about write-only variables
(cherry picked from commit 701473ef94)
2021-12-06 02:23:44 +02:00
Konstantin Belousov
81baf3493b libc/gen/getgrent.c: plug warnings about write-only variables
(cherry picked from commit 075fa5a9a8)
2021-12-06 02:23:44 +02: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
Kristof Provost
1019910199 pf tests: Test PR259689
We didn't populate dyncnt/tblcnt, so `pfctl -sr -vv` might not have the
table element count.

PR:		259689
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32893

(cherry picked from commit 2de49deeca)
2021-12-01 16:53:20 +01:00
Kristof Provost
525205b5d2 pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap
PR:		259689
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32892

(cherry picked from commit 218a8a491c)
2021-12-01 16:53:19 +01:00
Ed Maste
7cc6e39cb6 Do not build libatf-c++ when WITHOUT_CXX
libatf-c++ requires C++ support.

From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself
depends on MK_CXX), but this makes sense given the current behaviour.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32732

(cherry picked from commit 6ce99625ca)
2021-11-29 10:10:53 -05:00
Ed Maste
8f02234dbd Don't build sanitizer runtimes under WITHOUT_CXX
In the past we built the sanitizer runtimes when building Clang
(and using Clang as the compiler) but 7676b388ad changed this to
be conditional only on using Clang, to make the runtimes available
for external Clang.

They fail to build when WITHOUT_CXX is set though, so add MK_CXX
as part of the condition.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Fixes:		7676b388ad ("Always build the sanitizer runtimes...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32731

(cherry picked from commit ad09e2c8cf)
2021-11-29 10:10:53 -05:00
Kristof Provost
9aa63a8d13 libpfct: be consistent with u_int vs. uint
Always use uint64_t over u_int64_t, for the sake of consistency.

No functional change.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 7bb3c927f7)
2021-11-26 04:42:04 +01:00
Kristof Provost
cfe9b890d5 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

(cherry picked from commit 76c5eecc34)
2021-11-26 04:39:05 +01:00
Felix Johnson
c834258459 uuid(3): Document return values
PR:		204449
Reported by:	Michael Cress <michael.cress@cress.us>

(cherry picked from commit f6842865d3)
2021-11-21 19:43:31 -05:00
Steve Kargl
4ac2d43111 Implementations of cexpl()
PR:	216862

(cherry picked from commit 046e2d5db1)
2021-11-10 21:36:20 +02:00
Dimitry Andric
188a951735 Partially revert ac76bc1145 because it is no longer necessary
In ac76bc1145, I added a few volatiles to work around ctrig_test
failures with {inf,inf}. This is not necessary anymore now, since in
3b00222f15 we added -fp-exception-behavior=maytrap for clang >= 10 in
libm's Makefile. (The flag tells clang to use stricter floating point
semantics, which libm depends on.)

PR:		244732, 254911
Fixes:		ac76bc1145

(cherry picked from commit e2157cd000)
2021-11-08 22:00:47 +01:00
Steve Kargl
ced974a7b0 cosl(): fix polynomial approximation coefficients for ld128 version
PR:	218514

(cherry picked from commit 6d04e1422e)
2021-11-08 03:49:45 +02:00
Konstantin Belousov
9de9a33050 fexecve(2): allow O_PATH file descriptors opened without O_EXEC
(cherry picked from commit be10c0a910)
2021-11-06 04:12:33 +02:00
Dimitry Andric
344691934f llvm BPF target: add missed source files
Otherwise, linking llvm binaries with this target enabled (which is not
the default) will fail with a number of undefined symbol errors:

  ld: error: undefined symbol: llvm::initializeBPFAdjustOptPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::initializeBPFCheckAndAdjustIRPass(llvm::PassRegistry&)
  ld: error: undefined symbol: llvm::createBPFCheckAndAdjustIR()
  ld: error: undefined symbol: llvm::createBPFAdjustOpt()
  ld: error: undefined symbol: llvm::BPFAdjustOptPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)

Reported by:	Michael Dexter <editor@callfortesting.org>

(cherry picked from commit d30dc78f79)
2021-11-05 17:10:14 +01:00