Commit Graph

9015 Commits

Author SHA1 Message Date
Dimitry Andric
86d2671e3e Update contrib/llvm-project/FREEBSD-Xlist for llvmorg-11.0.1-rc2.
MFC after:	4 weeks
X-MFC-With:	r364284
2021-01-03 14:21:54 +01:00
Dimitry Andric
eaeb601bd6 Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.1-rc2-0-g43ff75f2c3f (aka 11.0.1 rc2).

MFC after:	4 weeks
X-MFC-With:	r364284
2021-01-03 13:54:24 +01:00
Toomas Soome
80aa931900 contrib: setup pnglite 2021-01-02 21:29:24 +02:00
Toomas Soome
72c59f1728 Add 'contrib/pnglite/' from commit 'a70c2a23d0d84dfc63a1d9413a7f4aaede7313aa'
git-subtree-dir: contrib/pnglite
git-subtree-mainline: 5bcd0b860c
git-subtree-split: a70c2a23d0
2021-01-02 21:27:29 +02:00
Toomas Soome
5bcd0b860c contrib: setup terminus 2021-01-02 21:03:28 +02:00
Toomas Soome
eb1e8a8296 Add 'contrib/terminus/' from commit 'cee3932f8c02a220d70e48949c7c5ca6e98dfef4'
git-subtree-dir: contrib/terminus
git-subtree-mainline: 51a9b978e7
git-subtree-split: cee3932f8c
2021-01-02 20:57:12 +02:00
Kyle Evans
8929690a63 contrib: remove libgnuregex
This should have been a part of 47d1ad2413, but it was overlooked. All of
the build bits have been previously removed, and nothing references this
anymore.
2021-01-02 00:00:58 -06:00
Dimitry Andric
543478be75 Merge commit 4f568fbd2 from llvm git (by Nemanja Ivanovic):
[PowerPC] Do not emit HW loop when TLS var accessed in PHI of loop
  exit

  If any PHI nodes in loop exit blocks have incoming values from the
  loop that are accesses of TLS variables with local dynamic or general
  dynamic TLS model, the address will be computed inside the loop.
  Since this includes a call to __tls_get_addr, this will in turn cause
  the CTR loops verifier to complain. Disable CTR loops in such cases.

  Fixes: https://bugs.llvm.org/show_bug.cgi?id=48527

This should fix building ceph 12.2.12 on powerpc64, powerpc, powerpcspe
and powerpc64le.

Requested by:	pkubaj
MFC after:	3 days
2021-01-01 15:35:13 +01:00
Ed Maste
f492599d7b Remove unused contrib/gdb
As of 1c0ea326aa in-tree gdb is not used.  Clean up the contrib
directory.

Reported by:	kib
Sponsored by:	The FreeBSD Foundation
2020-12-31 13:41:17 -05:00
Kyle Evans
9e1281eaba libc: tests: hook CPUSET(9) test up to the build
Add shims to map NetBSD's API to CPUSET(9). Obviously the invalid input
parts of these tests are relatively useless since we're just testing the
shims that aren't used elsewhere, there's still some amount of value in
the parts testing valid inputs.

Differential Revision:	https://reviews.freebsd.org/D27307
2020-12-31 12:26:01 -06:00
Philip Paeps
e35a01eec6 contrib/tzdata: import tzdata 2020f
Merge commit '96b88ac701b35ce68425046d4be8f51cb75b5d5b' into main

Changes: https://github.com/eggert/tz/blob/2020f/NEWS

MFC after:    1 day
2020-12-30 12:50:26 +08:00
Poul-Henning Kamp
3db1b221ed Set stdout & stderr unbuffered, so that the "telnet>" prompt
also shows up when output is redirected:

	telnet |& tee _log
2020-12-29 21:05:48 +00:00
Edward Tomasz Napierala
f53120073b Revert "bsnmpclient(3): make it thread-safe"
This reverts commit 89e3d5671b.

As pointed out, there are several problems with that commit:

1. The new semantics, while useful for clients where multiple
   threads use separate contexts, breaks clients which correctly
   share a single one
2. Change in semantics would require a library version bump
3. It doesn't build with GCC
2020-12-29 19:55:05 +00:00
Edward Tomasz Napierala
89e3d5671b bsnmpclient(3): make it thread-safe
Reviewed By:	harti
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27336
2020-12-29 14:59:37 +00:00
Martin Matuska
69a18c5826 contrib/libarchive: Import libarchive 3.5.1
Merge commit '8be2bb3d35e232080b4e39244020e650bbe31562' into main
2020-12-28 00:34:06 +01:00
Stefan Eßer
e458944cf9 Import bc 3.2.4 2020-12-27 22:32:22 +01:00
Philip Paeps
dc505d53dc contrib/tzdata: import tzdata 2020e
Changes: https://github.com/eggert/tz/blob/2020e/NEWS

MFC after:    insta-MFC
2020-12-25 23:16:38 +08:00
Cy Schubert
7d8ff32452 Sync ippool.8 man page synopsis with reality and the rest of the
man page..

MFC after:	3 days
2020-12-23 17:04:34 -08:00
Marcin Wojtas
b62ae61446 Fix abort in jemalloc extent coalescing.
Fix error in extent_try_coalesce_impl(), which could cause abort
to happen when trying to coalesce extents backwards. The error could
happen because of how extent_before_get() function works. This function
gets address of previous extent, by subtracting page size from current
extent address. If current extent is located at PAGE_SIZE offset, this
address resolved to 0x0000. An assertion in rtree_leaf_elm_lookup
then caused the running program to abort.

This problem was discovered when trying to build world on 32-bit
machines with ASLR and PIE enabled. The problem was encountered
on armv7 and i386 machines, but most likely other 32-bit
architectures are affected as well.

While this patch fixes one problem with buildworld on 32-bit platforms
with ASLR, the build still fails, however it happens much later
and due to lack of memory.

The change is aligned with accepted fix in the upstream Jemalloc
repository (https://github.com/jemalloc/jemalloc/pull/1973).
As it doesn't apply on top of Jemalloc tree, its updated version
was eventually merged: https://github.com/jemalloc/jemalloc/pull/2003

PR: 249937
Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D27025
2020-12-18 10:09:21 +00:00
Xin LI
7341cb0cd1 MFV r368746:
Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:

Fix error cases when udp-connect is set and send() returns an error

Obtained from:	unbound git
MFC after:	3 days
2020-12-18 04:23:20 +00:00
Ed Maste
546114d08e Remove contrib/binutils, unused after r368667 2020-12-16 14:01:04 +00:00
Martin Matuska
87c1ec0a31 MFV r368607:
Sync libarchive with vendor.

Vendor changes:
  Issue #1461: Unbreak build without lzma
  Issue #1462: warc reader: Fix build with gcc11
  Issue #1463: Fix code compatibility in test_archive_read_support.c
  Issue #1464: Use built-in strnlen on platforms where not available
  Issue #1465: warc reader: fix undefined behaviour in deconst() function

MFC after:	3 days
X-MFC-With:	368234
2020-12-13 16:26:37 +00:00
Martin Matuska
bcd2ffcdc2 Update vendor/libarchive/dist to b2c3ee7e2907511533eeb2a0f2ceecc1faa73185
Vendor changes:
  Issue #1461: Unbreak build without lzma
  Issue #1462: warc reader: Fix build with gcc11
  Issue #1463: Fix code compatibility in test_archive_read_support.c
  Issue #1464: Use built-in strnlen on platforms where not available
  Issue #1465: warc reader: fix undefined behaviour in deconst() function
2020-12-13 15:29:19 +00:00
Gordon Bergling
6580cc162d ee(1): Whitespace cleanup
This is a direct commit to -CURRENT since the upstream went away.

MFC after:	1 week
2020-12-10 10:58:30 +00:00
Dimitry Andric
6813f2420b Merge commit 28de0fb48 from llvm git (by Luís Marques):
[RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines

  The RISCV target did not set the GCC atomic compare and swap defines,
  unlike other targets. This broke builds for things like glib on
  RISCV.

  Patch by Kristof Provost (kprovost)

  Differential Revision: https://reviews.llvm.org/D91784

This should fix building glib20 on RISC-V and unblock a number of
dependent ports.

Requested by:	kp
MFC after:	3 days
2020-12-09 18:37:43 +00:00
Cy Schubert
369c692350 MFV r368464:
Update unbound from 1.12.0 to 1.13.0

MFC after:	1 week
Security:	CVE-2020-28935
2020-12-09 02:59:24 +00:00
Bryan Drewery
2dfa4b66b3 fts_read: Handle error from a NULL return better.
This is addressing cases such as fts_read(3) encountering an [EIO]
from fchdir(2) when FTS_NOCHDIR is not set.  That would otherwise be
seen as a successful traversal in some of these cases while silently
discarding expected work.

As noted in r264201, fts_read() does not set errno to 0 on a successful
EOF so it needs to be set before calling it.  Otherwise we might see
a random error from one of the iterations.

gzip is ignoring most errors and could be improved separately.

Reviewed by:	vangyzen
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D27184
2020-12-08 23:38:26 +00:00
Cy Schubert
c1dbcbf2d1 Vendor import of Unbound 1.13.0.
Security:	CVE-2020-28935
2020-12-08 21:23:03 +00:00
Stefan Eßer
c6bfc8968d Upgrade to version 3.2.3 2020-12-06 11:49:21 +00:00
Kyle Evans
4f1efa309c libc: regex: partial revert of r368358
Part of the libregex functionality leaked into the tests it shares with
the standard regex(3). Introduce a P flag to set the REG_POSIX cflag to
indicate that libc regex should effectively do nothing while libregex should
specifically run it in non-extended mode.

This unbreaks the libc/regex test run.

Reported by:	Jenkins
2020-12-05 14:38:46 +00:00
Kyle Evans
6b986646d4 libregex: implement \b and \B (word boundary, not word boundary)
This is the last of the needed GNU expressions before we can unleash bsdgrep
by default. \b is effectively an agnostic equivalent of \< and \>, while
\B will match every space that isn't making a transition from
nonchar -> char or char -> nonchar.
2020-12-05 03:16:05 +00:00
Dimitry Andric
c3f7be36e8 Merge commit d989ffd10 from llvm git (by Dimitry Andric):
Implement computeHostNumHardwareThreads() for FreeBSD

  This retrieves CPU affinity via FreeBSD's cpuset(2) API, and makes
  LLVM respect affinity settings configured by the user via the
  cpuset(1) command.

  In particular, this allows to reduce the number of threads used on
  machines with high core counts, which can interact badly with
  parallelized build systems. This is particularly noticable with lld,
  which spawns lots of threads even for linking e.g. hello_world!

  This fix is related to PR48193, but does not adress the more
  fundamental problem, which is that LLVM by default grabs as many CPUs
  and/or threads as possible.

  Reviewed By: MaskRay

  Differential Revision: https://reviews.llvm.org/D92271

Originally by:	mjg
MFC after:	1 week
2020-12-03 19:29:18 +00:00
Dimitry Andric
5cc6cb2645 Revert r367815, so we can apply the slightly different version that
landed upstream:

For llvm's internal function which retrieves the number of available
"hardware threads", use cpuset_getaffinity(2) on FreeBSD, so it will
honor processor sets configured by the cpuset(1) command.

This should make it possible to avoid e.g. lld creating a huge number of
threads on a machine with many cores, even for linking simple programs.

This will also be submitted upstream.

Submitted by:	mjg
2020-12-03 19:26:21 +00:00
Ed Maste
67b94fc58e addr2line: fix allocation leak in error path
CID:		1437677
Reported by:	Coverity Scan
Sponsored by:	The FreeBSD Foundation
2020-12-03 14:41:11 +00:00
Ed Maste
f4d6ed9a5c addr2line: rework check_range conditions
Simplify logic and reduce indentation for DW_AT_low_pc case.

Reviewed by:	Tiger Gao, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27426
2020-12-02 17:22:29 +00:00
Martin Matuska
c3afd20f13 MFV r368207:
Update libarchive to 3.5.0

Relevant vendor changes:
  Issue #1258: add archive_read_support_filter_by_code()
  PR #1347: mtree digest reader support
  Issue #1381: skip hardlinks pointing to itself on extraction
  PR #1387: fix writing of cpio archives with hardlinks without file type
  PR #1388: fix rdev field in cpio format for device nodes
  PR #1389: completed support for UTF-8 encoding conversion
  PR #1405: more formats in archive_read_support_format_by_code()
  PR #1408: fix uninitialized size in rar5_read_data
  PR #1409: system extended attribute support
  PR #1435: support for decompression of symbolic links in zipx archives
  Issue #1456: memory leak after unsuccessful archive_write_open_filename

MFC after:	1 week
2020-12-01 15:53:12 +00:00
Ed Maste
a36179937e addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used
Check label's ranges for address we want to translate if a CU doesn't
have usable DW_AT_range or DW_AT_low_pc.

Use more appropriate names: "struct CU" -> "struct range"

Developed as part of upstream ELF Tool Chain bug report
https://sourceforge.net/p/elftoolchain/tickets/552/ although this does
not address the specific case reported there.

Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23782
2020-11-27 21:38:03 +00:00
Stefan Eßer
50696a6e8c Update to version 3.2.0 2020-11-26 17:39:51 +00:00
Alex Richardson
371f152c7f Significantly speed up libthr/mutex_test and make more reliable
Instead of using a simple global++ as the data race, with this change we
perform the increment by loading the global, delaying for a bit and then
storing back the incremented value. If I move the increment outside of the
mutex protected range, I can now see the data race with only 100 iterations
on amd64 in almost all cases. Before this change such a racy test almost
always passed with < 100,000 iterations and only reliably failed with the
current limit of 10 million.

I noticed this poorly written test because the mutex:mutex{2,3} and
timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins.
Writing good concurrency tests is hard so I won't attempt to do so, but this
change should make the test more likely to fail if pthread_mutex_lock is not
implemented correctly while also significantly reducing the time it takes to
run these four tests. It will also reduce the time it takes for QEMU RISC-V
testsuite runs by almost 40 minutes (out of currently 7 hours).

Reviewed By:	brooks, ngie
Differential Revision: https://reviews.freebsd.org/D26473
2020-11-26 13:31:57 +00:00
Alan Somers
01f3f35447 ping: fix some man pages and tests after r368045
MFC-with:	r368045
2020-11-26 04:55:02 +00:00
Ed Maste
3063e1e56b clang: allow -fstack-clash-protection on FreeBSD
-fstack-clash-protection was added in Clang commit e67cbac81211 but was
enabled only on Linux.  It should work fine on FreeBSD as well, so
enable it.

To be discussed and upstreamed with a test.  The OS test should probably
just be removed.

Reviewed by:	dim
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27366
2020-11-25 14:26:13 +00:00
Simon J. Gerraty
e2eeea75eb Merge bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o More code cleanup and refactoring.

o More unit tests

MFC after:	1 week
2020-11-20 06:02:31 +00:00
Ed Maste
65c207758a addr2line: swap if conditions for diff reduction in upcoming change
No functional change intended.
2020-11-19 21:10:36 +00:00
Dag-Erling Smørgrav
a90c7d9aa8 Merge upstream r948: fix race condition in openpam_ttyconv(3). 2020-11-19 05:46:59 +00:00
Dimitry Andric
991f6e7534 For llvm's internal function which retrieves the number of available
"hardware threads", use cpuset_getaffinity(2) on FreeBSD, so it will
honor processor sets configured by the cpuset(1) command.

This should make it possible to avoid e.g. lld creating a huge number of
threads on a machine with many cores, even for linking simple programs.

This will also be submitted upstream.

Submitted by:	mjg
MFC after:	1 week
2020-11-18 19:55:24 +00:00
Dimitry Andric
1e4896b176 When elftoolchain's objcopy (or strip) is rewriting a file in-place,
make it create the temporary file in the same directory as the source
file by default, instead of always using $TMPDIR or /tmp. If creating
that file fails because the directory is not writable, also fallback to
$TMPDIR or /tmp.

This has also been submitted upstream as:
https://sourceforge.net/p/elftoolchain/tickets/597/

Reported by:	cem
PR:		250872
MFC after:	2 weeks
2020-11-18 18:40:58 +00:00
Dimitry Andric
2418469b60 Merge commit 8df4e6094 from llvm git (by Fangrui Song):
[ELF] Don't consider SHF_ALLOC ".debug*" sections debug sections

  Fixes PR48071

  * The Rust compiler produces SHF_ALLOC `.debug_gdb_scripts` (which
    normally does not have the flag)
  * `.debug_gdb_scripts` sections are removed from `inputSections` due
    to --strip-debug/--strip-all
  * When processing --gc-sections, pieces of a SHF_MERGE section can be
    marked live separately

  `=>` segfault when marking liveness of a `.debug_gdb_scripts` which
  is not split into pieces (because it is not in `inputSections`)

  This patch circumvents the problem by not treating SHF_ALLOC
  ".debug*" as debug sections (to prevent --strip-debug's stripping)
  (which is still useful on its own).

  Reviewed By: grimar

  Differential Revision: https://reviews.llvm.org/D91291

This should fix lld segfaulting when linking the rust-based parts of the
devel/py-maturin port.

Reported by:	Nick Venenga <nijave@gmail.com>
PR:		250783
MFC after:	3 days
2020-11-12 19:25:31 +00:00
Dimitry Andric
1ee2434eb5 Merge commit 354d3106c from llvm git (by Kai Luo):
[PowerPC] Skip combining (uint_to_fp x) if x is not simple type

  Current powerpc64le backend hits
  ```
  Combining: t7: f64 = uint_to_fp t6
  llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291:
  llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() &&
  "Expected a SimpleValueType!"' failed.
  ```
  This patch fixes it by skipping combination if `t6` is not simple
  type.
  Fixed https://bugs.llvm.org/show_bug.cgi?id=47660.

  Reviewed By: #powerpc, steven.zhang

  Differential Revision: https://reviews.llvm.org/D88388

This should fix the llvm assertion mentioned above when building the
following ports for powerpc64le:

* audio/traverso
* databases/percona57-pam-for-mysql
* databases/percona57-server
* emulators/citra
* emulators/citra-qt5
* games/7kaa
* graphics/dia
* graphics/mandelbulber
* graphics/pcl-pointclouds
* net-p2p/libtorrent-rasterbar
* textproc/htmldoc

Requested by:	pkubaj
MFC after:	3 days
2020-11-08 12:47:35 +00:00
Simon J. Gerraty
956e45f6fb Update to bmake-20201101
Lots of new unit-tests increase code coverage.

Lots of refactoring, cleanup and simlpification to reduce
code size.

Fixes for Bug 223564 and 245807

Updates to dirdeps.mk and meta2deps.py
2020-11-07 21:46:27 +00:00
Enji Cooper
ae41709ab4 snmpmod(3): fix typo under the COMMUNITIES section
"recipte" should be spelled like "receipt".

.Dd is intentionally not being bumped for the change.

MFC after:	1 week
Sponsored by:	DellEMC
2020-11-05 21:37:24 +00:00