Commit Graph

8969 Commits

Author SHA1 Message Date
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
Dimitry Andric
7b7921b47e Make vector-related functions in libcxxrt's demangler static
Follow-up to r367323 by re-adding static to a number of the functions
copied from elftc's libelftc_vstr.c. This was requested by upstream.

PR:		250702
MFC after:	3 days
2020-11-04 17:51:09 +00:00
Dimitry Andric
a7941b3326 Update libcxxrt's private copy of elftoolchain demangler
This updates the private copy of libelftc_dem_gnu3.c in libcxxrt with
the most recent version from upstream r3877. Similar to r367322, this
fixes a number of possible assertions, and allows it to correctly
demangle several names that it could not handle before.

PR:		250702
MFC after:	3 days
2020-11-04 11:13:36 +00:00
Dimitry Andric
c2bffd0a97 Merge elftoolchain r3877 (by jkoshy):
Incorporate fixes from Dimitry Andric:

  - Use a BUFFER_GROW() macro to avoid rounding errors in capacity
    calculations.
  - Fix a bug introduced in [r3531].
  - Fix handling of nested template parameters.

  Ticket:	#581

This should fix a number of assertions on elftoolchain's cxxfilt, and
allow it to correctly demangle several names that it could not handle
before.

Obtained from:	https://sourceforge.net/p/elftoolchain/code/3877/
PR:		250702
MFC after:	3 days
2020-11-04 11:02:05 +00:00
Brandon Bergren
d4fba56212 Fix 32-bit build after r367209
Fix build on systems with a 32-bit size_t.

Since it's being passed as a pointer, a 64-bit write to it will overflow.

MFC with:	r367209
2020-10-31 22:14:37 +00:00
Ed Maste
e128bd0ff9 readelf: Add -z decompression support
Compatible with GNU readelf, -z decompresses sections displayed by
-x or -p.

ELF Tool Chain ticket #555
https://sourceforge.net/p/elftoolchain/tickets/555/

Submitted by:	Tiger Gao <tig@FreeBSDFoundation.org>
Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:    https://reviews.freebsd.org/D26909
2020-10-31 15:27:45 +00:00
Cy Schubert
c0caa2e24e MFV r367082:
Update unbound 1.11.0 --> 1.12.0.

MFC after:	1 month.
2020-10-27 23:03:15 +00:00
Cy Schubert
4cb89f2eee Vendor import of Unbound 1.12.0. 2020-10-27 15:09:16 +00:00
Cy Schubert
b85540d0a3 Remove a random equal sign from the example. It should not be there.
It's a syntax error.

PR:		210303
Reported by:	leventelist at gmail.com
MFC after:	3 days
2020-10-27 04:35:47 +00:00
Cy Schubert
bbd1103c30 Continued ipfilter #ifdef cleanup. The r343701 log entry contains a
complete description.

MFC after:	3 days
2020-10-27 04:35:36 +00:00
Brooks Davis
f61a22193c Key decleration of union semun on src version
__FreeBSD__ is defined by the compiler derived from the triple. When
building FreeBSD 11 on a FreeBSD 12 with a CROSS_TOOLCHAIN=llvm10,
__FreeBSD__ was set to 12 when building lib32 (for some reason no triple
is being passed which seems to mean that we're taking default values
from the build system).  This in turn meant we end up with a double
decleration of union semun which is a build error.

Reviewed by:	gshapiro, dim
Differential Revision:	https://reviews.freebsd.org/D26902
2020-10-26 17:52:28 +00:00
Ryan Moeller
73577bf01d flua: Add a libjail module
libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.

* Introduce 3lua section for man pages
* Add libjail module

Reviewed by:	kevans, manpages
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D26080
2020-10-24 17:08:59 +00:00
Xin LI
6f26c71d76 MFV r366990: less v563.
MFC after:	2 weeks
Relnotes:	yes
2020-10-24 15:58:42 +00:00
Ed Maste
573456a931 libelf: add compression header support
GNU and Oracle libelf implementations added support for section
compression, intended to reduce the size of DWARF debug info (which
might be an order of magnitude larger than the code).

There are two compressed ELF section formats:

1. Old GNU - sections are renmaed to start with 'z'.  Section contains
   a magic number, uncompressed size, and compressed data.

2. Oracle and New GNU - compressed sections use the SHF_COMPRESSED flag.
   The compression header contains the compression type, uncompressed
   size, and uncompressed alignment.

The second style is preferred and this change implements only that one.

Submitted by:	Tiger Gao <tig@FreeBSDFoundation.org>
Reviewed by:	markj
MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24566
2020-10-23 16:35:23 +00:00
Philip Paeps
3611c2d809 Import tzdata 2020c
Changes: https://github.com/eggert/tz/blob/2020d/NEWS

MFC after:	1 day
2020-10-22 01:05:34 +00:00
Adrian Chadd
d061adc48d [libcxx] Fix atomic type for mips32 on gcc to work w/out needing libatomic
When compiling this for mips32 on gcc-6.x, we'd hit issues where we
don't have 64 bit atomics on mips32.

gcc implements this using libatomic, which we don't currently include
in our freebsd-gcc compiler packages.

So for now add this work around so mips32 works.  It's also fine for
mips64.  We can fix this later once we get libatomic included.

Approved by:	dim
Differential Revision:	https://reviews.freebsd.org/D26774
2020-10-18 17:31:10 +00:00
Philip Paeps
e7e2d659af Import tzdata 2020c
Changes: https://github.com/eggert/tz/blob/2020c/NEWS

MFC after:	1 day
2020-10-17 00:44:04 +00:00
Kyle Evans
bf9580a118 MFC r366760: lua: update to 5.3.6
This release contains some minor bugfixes; notably:
- 2x minor Makefile fixes (not used in base)
- Long brackets with a huge number of '=' overflow some internal buffer
  arithmetic.
- Joining an upvalue with itself can cause a use-after-free crash.

See here for examples: http://www.lua.org/bugs.html#5.3.5

MFC after:	2 weeks
2020-10-16 17:03:27 +00:00
Adrian Chadd
d00afbaea9 This fixes some fun type size truncation that shows up giving errors like
" changes value from '287948901175001088' to '0' "

.. which turns out is a known issue with later gcc's.

eg - https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00154.html

It was fixed up upstream corelib/gnulib in commit hash
252b52457da7887667c036d18cc5169777615bb0
(eg in 252b52457d)

TEST PLAN
  - compiled/run for gcc-6.4 on amd64

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26804
2020-10-16 14:28:13 +00:00
Adrian Chadd
cdd9aa250e [tests] Fix itimer test warning-errors on gcc-6.4
This fixes a "suggested parens" compile warning-into-error
that shows up on gcc-6.4.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D26789
2020-10-15 14:55:07 +00:00
Dimitry Andric
f845673b24 Merge commit 35ecc7fe4 from llvm git (by Hubert Tong):
[clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast

  Fix premature decision in the presence of type-dependent expression
  operands on whether AltiVec vector initializations from single
  expressions are "splat" operations.

  Verify that the instantiation is able to determine the correct cast
  semantics for both the scalar type and the vector type case.

  Note that, because the change only affects the single-expression case
  (and the target type is an AltiVec-style vector type), the
  replacement of a parenthesized list with a parenthesized expression
  does not change the semantics of the program in a program-observable
  manner.

  Reviewed By: aaron.ballman

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

This should fix 'Assertion failed: (isScalarType()), function
getScalarTypeKind, file /usr/src/contrib/llvm-project/clang/lib/AST
/Type.cpp, line 2146', when building the graphics/opencv-core port for
powerpc64le.

Requested by:	pkubaj
MFC after:	4 weeks
X-MFC-With:	r364284
2020-10-13 19:42:22 +00:00
Dimitry Andric
f91b0c1c18 Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-0-g176249bd673 (aka 11.0.0 release).

MFC after:	4 weeks
X-MFC-With:	r364284
2020-10-12 21:35:29 +00:00
Alex Richardson
5ce117c698 Fix buildworld on Linux/macOS after nvi update
This re-applies r365941 which was lost in the nvi update.
2020-10-12 10:42:24 +00:00
Philip Paeps
12a899b632 Import tzdata 2020b
Changes: https://github.com/eggert/tz/blob/2020b/NEWS

MFC after:	3 days
2020-10-08 00:35:36 +00:00
Li-Wen Hsu
85a6f8076f Revert r358001 in favor of r366509
Sponsored by:	The FreeBSD Foundation
2020-10-07 07:55:55 +00:00
Jakub Wojciech Klama
067bb8206d Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c.
Approved by:	trasz (mentor)
Sponsored by:	Conclusive Engineering Sp. z o. o.
2020-10-03 18:52:54 +00:00
Mitchell Horne
6955543a88 tmpfs tests: check for built-in tmpfs module
As of r363471, tmpfs is included in all GENERIC kernel configs. This
results in a warning being emitted for each call to kldload(8):

module_register: cannot register tmpfs from tmpfs.ko; already loaded from kernel

Check for the presence of the module via kldstat first to quiet this
warning.

Reviewed by:	asomers, arichardson
Differential Revision:	https://reviews.freebsd.org/D26632
2020-10-02 00:52:31 +00:00
Eric van Gyzen
01348ccda2 fix setitimer test for returned it_value
An old it_value of {4,3} is valid. Allow it.

Reviewed by:	bdrewery
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26445
2020-10-01 21:52:57 +00:00
Eric van Gyzen
63c8336d4d zgrep: fix exit status with multiple files
zgrep should exit with success when given multiple files and the
pattern is found in at least one file.  Prior to this change,
it would exit with success only if the pattern was found in _every_ file.

Reviewed by:	dab ngie
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26616
2020-10-01 21:48:22 +00:00
Dimitry Andric
8833aad7be Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d.

MFC after:	4 weeks
X-MFC-With:	r364284
2020-10-01 19:06:07 +00:00
Stefan Eßer
d213476d1c Upgrade to version 3.1.6
This upgrade addresses one (benign) compiler warning when building with
LLVM-12.
2020-10-01 15:45:07 +00:00
Baptiste Daroussin
755cc40c21 Update nvi to 2.2.0-05ed8b9
This version incorporates many fixes in particular a fix for vi -w
Another approach was proposed to merge those fixes (see review), I find
it easier to track changes if we keep importing snapshot on regular
basis

PR:		241985
Reported by:	fernape
Differential Revision:	https://reviews.freebsd.org/D26158
2020-10-01 04:46:23 +00:00
Cy Schubert
6dbd2fb858 ipfilter getifname ifdef cleanup.
MFC after:	2 months
2020-09-30 08:26:22 +00:00
Cy Schubert
2c1685f369 Resurrect ipfilter's getifname, replacing the stub with the real
function.

MFC after:	2 months
2020-09-30 08:26:00 +00:00
Cy Schubert
15dc17b8d5 Remove Linux and IRIX specific files.
MFC after:	1 week
2020-09-27 18:39:12 +00:00
Cy Schubert
2e93aaa766 Continuing the effort started in r343701, #ifdef cleanup, remove
never to be used again checks.

MFC after:	1 week
2020-09-27 18:39:09 +00:00
Fernando Apesteguía
f1cba2b70c vi(1): Add URL to the vi/ex reference manual in the man page
Reported in PR 241985

The manual page references the "vi/ex reference manual" but there is no
information about where to find that document. Add a reference to the manual in
the SEE ALSO section since the Project hosts a copy of it[1].

Change sent upstream[2]

If D26158 gets reviewed and committed, we could close that PR.

[1] https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf).
[2] https://github.com/lichray/nvi2/pull/85

Submitted by:	freebsd@tim.thechases.com
Approved by:	manpages (gbe@)
Differential Revision:	https://reviews.freebsd.org/D26163
2020-09-25 10:20:12 +00:00
Alex Richardson
d1e106f262 byacc: fix UBSan signed shift range error
I've submitted this patch upstream, so apply this to contrib/ until a new
version containing this change has been released.

Reviewed By:	jkim
Differential Revision: https://reviews.freebsd.org/D26505
2020-09-23 12:54:42 +00:00
Alex Richardson
1116946093 Fix another UBSan error in awk
This applies my upstreamed fix: ad9bd2f40a
Found By:	UBSan
2020-09-21 19:03:12 +00:00
Alex Richardson
ae692c42cb awk: Fix subobject out-of-bounds access
When matching a regex with ^, it would attempt to access
gototab[NSTATES][NCHARS+2], and therefore access the state for the \002
character instead. This change is required to run awk under CHERI (with
sub-object bounds) and when running with UBSan instrumentation.

This was committed upstream as cbf924342b

Found by:	CHERI (with subobject bounds enabled)
Obtained from:	CheriBSD
Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D26509
2020-09-21 19:03:07 +00:00
Poul-Henning Kamp
895a7e604d Pull in fix from upstream NetBSD rev. 1.5:
If Unwind_Backtrace is broken, ctx.n will still contain ~0, and we will
    return that which poor behavior for the user, so return 0 instead.
    We could document ~0 to be an error, but that would deviate from the
    Linux behavior which is not desirable. Noted by Poul-Henning Kamp

PR:		209842
2020-09-21 16:43:38 +00:00
Alex Richardson
2bd2b11335 Fix vi build on Linux/macOS
This absolute include causes a build failure on Linux for me:
.../cheri/freebsd/contrib/nvi/cl/../common/common.h:10:10: fatal error: '/usr/include/db.h' file not found

This change patches the file to use #include <db.h> instead until a
solution has been found upstream. See also https://github.com/lichray/nvi2/issues/69

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D26480
2020-09-21 09:03:42 +00:00
Dimitry Andric
82bf979d53 Merge commit 46673763f from llvm git (by Craig Topper):
[X86] Place new constant node in topological order in
  X86DAGToDAGISel::matchBitExtract

  Fixes PR47482

This should fix 'Assertion failed: (Op->getNodeId() != -1 && "Node has
already selected predecessor node"), function DoInstructionSelection,
file
/usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp,
line 1149' when compiling part of the project_painter project, while
targeting the bdver2 (or higher) CPU.

Reported by:	jkim
MFC after:	6 weeks
X-MFC-With:	r364284
2020-09-17 19:47:41 +00:00
Dimitry Andric
927c847d5f Merge commit e09107ab8 from llvm git (by Raul Tambre):
[Sema] Introduce BuiltinAttr, per-declaration builtin-ness

  Instead of relying on whether a certain identifier is a builtin,
  introduce BuiltinAttr to specify a declaration as having builtin
  semantics.

  This fixes incompatible redeclarations of builtins, as reverting the
  identifier as being builtin due to one incompatible redeclaration
  would have broken rest of the builtin calls.
  Mostly-compatible redeclarations of builtins also no longer have
  builtin semantics. They don't call the builtin nor inherit their
  attributes.
  A long-standing FIXME regarding builtins inside a namespace enclosed
  in extern "C" not being recognized is also addressed.

  Due to the more correct handling attributes for builtin functions are
  added in more places, resulting in more useful warnings.
  Tests are updated to reflect that.

  Intrinsics without an inline definition in intrin.h had `inline` and
  `static` removed as they had no effect and caused them to no longer
  be recognized as builtins otherwise.

  A pthread_create() related test is XFAIL-ed, as it relied on it being
  recognized as a builtin based on its name.
  The builtin declaration syntax is too restrictive and doesn't allow
  custom structs, function pointers, etc.
  It seems to be the only case and fixing this would require reworking
  the current builtin syntax, so this seems acceptable.

  Fixes PR45410.

  Reviewed By: rsmith, yutsumi

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

This should fix 'Assertion failed: (i < getNumParams() && "Illegal
param #"), function getParamDecl, file
/usr/src/contrib/llvm-project/clang/include/clang/AST/Decl.h, line 2430'
when building the graphics/pgplot port.

Note that there may also have been other ports which triggered this
assertion, if they redeclare standard functions with incompatible
arguments.

Reported by:	zeising
MFC after:	6 weeks
X-MFC-With:	r364284
2020-09-17 19:43:25 +00:00
Li-Wen Hsu
4653454ee8 Revert r249362, atime update in tmpfs is fixed in r365810
PR:		249362
Sponsored by:	The FreeBSD Foundation
2020-09-17 07:13:41 +00:00
Dimitry Andric
16d6b3b3da Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30.

MFC after:	6 weeks
X-MFC-With:	r364284
2020-09-16 16:58:29 +00:00
Li-Wen Hsu
6132212808 Temporarily skip sys.fs.tmpfs.times_test.{empty,non_empty} in CI
PR:		249362
Sponsored by:	The FreeBSD Foundation
2020-09-16 09:58:15 +00:00