Commit Graph

8776 Commits

Author SHA1 Message Date
Conrad Meyer
134a253edc clang: Reject %n for __attribute__((format(__freebsd_kprintf__)))
A follow-up to r360849.

Reported by:	imp
Reviewed by:	emaste, imp
X-MFC-With:	r360849
Differential Revision:	https://reviews.freebsd.org/D24786
2020-05-09 19:26:44 +00:00
Ed Maste
c7d9dfe810 Merge commit 21e5e1724b75 from llvm git:
getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

  Once we hit AT_NULL, we need to bail out of the loop; not just the
  enclosing switch.  This fixes basic usage (e.g. `cc --version`) when
  AT_EXECPATH isn't present on older branches (e.g. under
  emu-user-static, at the moment), where we would previously run off
  the end of ::environ.

  Patch By: kevans

  Reviewed By: arichardson

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

MFC after:	3 days
2020-05-07 21:18:37 +00:00
Dimitry Andric
e86cf8ada1 Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):
[PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by:	jhibbits
MFC after:	3 days
2020-05-06 19:10:39 +00:00
Dimitry Andric
95512cda91 In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
unsupported relocation on symbol" when assembling arm 'adr' pseudo
instructions. However, the upstream commit did not take big-endian arm
into account.

Applying the same changes to the big-endian handling is straightforward,
thanks to Andrew Turner and Peter Smith for the hint. This will also be
submitted upstream.

MFC after:	immediately, since this fix is meant for stable/11
2020-05-06 18:13:00 +00:00
Ed Maste
6fd36c3b7a GNU as: print a deprecation warning on program start
GNU as 2.17.50 will be removed before FreeBSD 13.
2020-05-06 01:08:19 +00:00
Conrad Meyer
6b1e5fae2c pwcache.3: Explicitly document OOM condition
The pwcache functions allocate memory, and may return NULL pointers if that
allocation fails and the corresponding uid or gid was not found in the local
password database.  Document this behavior.

Sponsored by:	Dell EMC Isilon
2020-05-05 17:55:45 +00:00
Brooks Davis
ea69bf7f5d Set LG_VADDR to 48 on RISC-V.
The Sv48 PTE format is the largest currently defined address space for
RISC-V. It makes no sense to define a larger size and doing so (at
least for 64-bits) forces rtrees down a slow path.

Reviewed by:	vangyzen, jhb, mhorne
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24658
2020-05-04 17:16:30 +00:00
Dimitry Andric
702995b2a5 Tentatively apply https://reviews.llvm.org/D78877 (by Dave Green):
[ARM] Only produce qadd8b under hasV6Ops

  When compiling for a arm5te cpu from clang, the +dsp attribute is
  set. This meant we could try and generate qadd8 instructions where we
  would end up having no pattern. I've changed the condition here to be
  hasV6Ops && hasDSP, which is what other parts of ARMISelLowering seem
  to use for similar instructions.

  Fixed PR45677.

This fixes "fatal error: error in backend: Cannot select: t37: i32 =
ARMISD::QADD8b t43, t44" when compiling sys/dev/sound/pcm/feeder_mixer.c
for armv5. For some reason we do not encounter this on head, but this
error popped up while building universes for stable/12.

MFC after:	3 days
2020-04-26 19:17:45 +00:00
Philip Paeps
dd5f96c48d Import tzdata 2020a
Changes: https://github.com/eggert/tz/blob/2020a/NEWS

MFC after:	3 days
2020-04-24 05:05:58 +00:00
Eric van Gyzen
c5ad81420c Update jemalloc to version 5.2.1
Revert r354606 to restore r354605.

Apply one line from jemalloc commit d01b425e5d1e1 in hash_x86_128()
to fix the build with gcc, which only allows a fallthrough attribute
to appear before a case or default label.

Submitted by:	jasone in r354605
Discussed with:	jasone
Reviewed by:	bdrewery
MFC after:	never, due to gcc 4.2.1
Relnotes:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24522
2020-04-23 23:57:43 +00:00
Cy Schubert
1c2fa9150d Fix PowerPC segfault.
The segfault fix was originally developed by our upstream, sqlite.org,
to address S/390 and Sparc segfaults, both of which are big endian.
Our PowerPC is also big endian, which this patch also fixes.

Reported by:	Mark Millard <marklmi at yahoo.com>
Tested by:	Mark Millard <marklmi at yahoo.com>
Obtained from:	https://www.sqlite.org/src/vinfo/04885763c4cd00cb?diff=1
		https://sqlite.org/forum/forumpost/672291a5b2
MFC after:	1 month
X-MFC with:	r360221, 360221
2020-04-23 14:08:40 +00:00
Cy Schubert
74a6cddade MFV r360158:
Update sqlite3-3.31.0 (3310000) --> sqlite3-3.31.1 (3310100)

Tested by:	Mark Millard <marklmi at yahoo.com>
		With to be committed PowerPC patch
MFC after:	1 month
X-MFC with:	r360221
2020-04-23 13:58:11 +00:00
Cy Schubert
0e2816f50a In preparation for update to sqlite3-3.31.1 (3310100),
recommit r357201: MFV r357163, which was reverted by r357522
due to segfault under PowerPc.

Update sqlite3-3.30.1 (3300100) --> sqlite3-3.31.0 (3310000)

MFC after:	1 month
2020-04-23 13:46:34 +00:00
Ed Maste
c027e8cf48 blacklistd.8: fix db file path
PR:		245781
Submitted by:	Jose Luis Duran
MFC after:	3 days
2020-04-21 13:30:00 +00:00
Gleb Smirnoff
ee2e9f4dbc Fix immediate crash when snmpd is bound to a specific IP address.
The code that sets up msghdr must first fully fill in the msghdr
itself, and only then use CMSG_xxx() macros.

Silence from:	harti, one week
2020-04-20 23:32:49 +00:00
Dimitry Andric
5c94a87341 Merge commit 64b31d96d from llvm git (by Nemanja Ivanovic):
[PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without
  FPCVT

  We call the function that attempts to reuse the conversion without
  checking whether the target matches the constraints that the callee
  expects. This patch adds the check prior to the call.

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

  Differential revision: https://reviews.llvm.org/D77564

This should fix 'Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT
|| Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with
FPCVT"), function LowerFP_TO_INTForReuse, file
/usr/src/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7276'
when building the devel/libslang2 port (and a few others) for PowerPC64.

Requested by:	pkubaj
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-20 19:16:10 +00:00
Dimitry Andric
3788a439e9 Merge commit ce5173c0e from llvm git (by Reid Kleckner):
Use FinishThunk to finish musttail thunks

  FinishThunk, and the invariant of setting and then unsetting
  CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't
  exist when I added this musttail codepath in ab2090d10765 (2014).
  Recently in 28328c3771, I started using this codepath on non-Windows
  platforms, and users reported problems during release testing
  (PR44987).

  The issue was already present for users of EH on i686-windows-msvc,
  so I added a test for that case as well.

  Reviewed By: hans

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

This should fix 'Assertion failed: (!empty() && "popping exception stack
when not empty"), function popTerminate, file
/usr/src/contrib/llvm-project/clang/lib/CodeGen/CGCleanup.h, line 583'
when building the net-p2p/libtorrent-rasterbar

PR:		244830
Reported by:	jbeich, yuri
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-20 17:39:51 +00:00
Alan Somers
72a600a7a1 libauditd: make it a PRIVATELIB
According to the upstream man page (which we don't install), none of
libauditd's symbols are intended to be public. Also, I can't find any
evidence for a port that uses libauditd. Therefore, we should treat it like
other such libraries and use PRIVATELIB.

Reported by:	phk
Reviewed by:	cem, emaste
MFC after:	2 weeks
2020-04-19 02:20:39 +00:00
Dimitry Andric
5df2af0809 Revert commit b6cf400aa fro llvm git (by Nemanja Ivanovic):
Fix bots after a9ad65a2b34f

  In the last commit, I neglected to initialize the new subtarget
  feature I added which caused failures on a few bots. This should fix
  that.

This unbreaks the build after r359981, which reverted upstream commit
a9ad65a2b34f.

Reported by:	jhibbits (and jenkins :)
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-15 21:06:38 +00:00
Dimitry Andric
f64e2fac5d Revert commit a9ad65a2b from llvm git (by Nemanja Ivanovic):
[PowerPC] Change default for unaligned FP access for older subtargets

  This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40554

  Some CPU's trap to the kernel on unaligned floating point access and
  there are kernels that do not handle the interrupt. The program then
  fails with a SIGBUS according to the PR. This just switches the
  default for unaligned access to only allow it on recent server CPUs
  that are known to allow this.

  Differential revision: https://reviews.llvm.org/D71954

This upstream commit causes a compiler hang when building certain ports
(e.g. security/nss, multimedia/x264) for powerpc64.  The hang has been
reported in https://bugs.llvm.org/show_bug.cgi?id=45186, but in the mean
time it is more convenient to revert the commit.

Requested by:	jhibbits
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-15 18:43:44 +00:00
Dimitry Andric
c3ca3130e2 Merge commit 30588a739 from llvm git (by Erich Keane):
Make target features check work with ctor and dtor-

  The problem was reported in PR45468, applying target features to an
  always_inline constructor/destructor runs afoul of GlobalDecl
  construction assert when checking for target-feature compatibility.

  The core problem is fixed by using the version of the check that
  takes a FunctionDecl rather than the GlobalDecl. However, while
  writing the test, I discovered that source locations weren't properly
  set for this check on ctors/dtors. This patch also fixes constructors
  and CALLED destructors.

  Unfortunately, it doesn't seem too possible to get a meaningful
  source location for a 'cleanup' destructor, so those are still
  'frontend' level errors unfortunately. A fixme was added to the test
  to cover that situation.

This should fix 'Assertion failed: (!isa<CXXConstructorDecl>(D) && "Use
other ctor with ctor decls!"), function Init, file
/usr/src/contrib/llvm-project/clang/include/clang/AST/GlobalDecl.h, line
45' when compiling the security/botan2 port.

PR:		245550
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-12 16:06:59 +00:00
Kyle Evans
302ab0eb27 ntpd: fix build with -fno-common
Only a small nit here: psl should be declared extern and defined exactly
once.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
2020-04-06 23:11:43 +00:00
Ed Maste
2b99119f6d lldb: use lua as the default script language
In the FreeBSD base system we do not have Python support in lldb, but
will have Lua support.  Make Lua the default.

This needs to be made into a configure-time option; that is being
discussed upstream and will appear in a future lldb import.  For now
carry this change as a tiny patch to our copy of lldb.
2020-04-02 21:08:28 +00:00
Dimitry Andric
130d950caf Merge once more from ^/vendor/llvm-project/release-10.x, to get the
lldb/bindings directory, which will be used to provide lua bindings for
lldb.

Requested by:	emaste
MFC after:	6 weeks
X-MFC-With:	358851
2020-04-02 19:56:43 +00:00
Hartmut Brandt
0bf56da32d Merge release 1.14 of bsnmp. 2020-04-01 15:25:16 +00:00
Ed Maste
1176bc823f lldb: stop excluding bindings/ subdir
With liblua in the tree we should be able to enable lldb's lua
scripting.  We'll need the files in bindings/, so start by allowing them
to come in with the next import.

Approved by:	dim
Sponsored by:	The FreeBSD Foundation
2020-04-01 13:18:01 +00:00
Edward Tomasz Napierala
568f01f6c3 Make jemalloc(3) default to retain:true on 64-bit platforms,
like it already does on Linux and OSX.  This results in significantly
fewer calls to mmap(2).  This should result in a small reduction
in system CPU time and improved superpage usage.

Reviewed by:	markj
Tested by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23874
2020-03-31 13:48:06 +00:00
Kyle Evans
b766b8bf1a MFV r359442: bmake: import -fno-common fix build back from upstream
sjg@ committed the local patch previously committed upstream; pull it in to
vendor/ to ease any potential stress of future imports.
2020-03-30 16:22:16 +00:00
Kyle Evans
661a2cb802 bmake: fix -fno-common build
debug was declared extern, but debug_file was not; correct this and define
debug_file in main.c (as debug is) to fix the -fno-common build.

-fno-common will become the default with GCC10/LLVM11.

MFC after:	3 days
2020-03-30 00:06:56 +00:00
Enji Cooper
09ae09a9eb Revert r359385-r359387
As noted by brooks/emaste, this is the wrong approach to take.
Revert the changes so brooks can apply a more proper change.

Requested by:	brooks, emaste
2020-03-29 02:40:03 +00:00
Kyle Evans
0690ee732a ipfilter: remove duplicate definition of 'thishost'
thishost is already defined in lib/initparse.c; no need for this one. This
fixes the ipfilter build with -fno-common.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
2020-03-29 02:26:58 +00:00
Kyle Evans
103d3266eb telnet: kill off remaining duplicate definition 2020-03-28 20:43:15 +00:00
Kyle Evans
fb1bc03eee Re-apply r359399: telnet -fno-common fix
line and auth_level's redefinitions are just extraneous

telnetd will #define extern and then include ext.h to allocate storage for
all of these extern'd vars; however, two of them are actually defined in
libtelnet instead. Instead of doing an #ifdef extern dance around those
function pointers, just add an EXTERN macro to make it easier to
differentiate by sight which ones will get allocated in globals.c and which
ones are defined elsewhere.

MFC after:	3 days
2020-03-28 19:43:45 +00:00
Kyle Evans
42b4e3fb5e Revert 359399: telnet -fno-common bits
There was a large misfire from my local diff that I need to investigate, and
this version committed did not build.
2020-03-28 17:57:36 +00:00
Kyle Evans
71f8f48356 MFV r359401: OpenBSM: import ee79d73e8df5: auditreduce: add a zone filter
This allows one to select audit records that match a -z zone glob.

MFC after:	1 week
Sponsored by:	Modirum MDPay, Klara Systems
2020-03-28 17:36:39 +00:00
Kyle Evans
c1b2af731b telnet: remove some duplicate definitions, mark terminaltype extern
Most of these were already properly declared and defined elsewhere, this is
effectively just a minor cleanup that fixes the -fno-common build.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
2020-03-28 17:06:34 +00:00
Kyle Evans
688f58d2da MFV r359393: tcsh: import 6974bc35a5cd
This removes an extra variable definition that causes the -fno-common build
to fail, which will be a new default in GCC10/LLVM11.

MFC after:	3 days
2020-03-28 15:00:55 +00:00
Kyle Evans
d1df43288e gas: mark dwarf2_loc_mark_labels as extern
Compiling with -fno-common complains as this header's included in multiple
compilation units. In fact, the proper definition of dwarf2_loc_mark_labels
already exists in dwarf2dbg.c, so simply mark this declaration with extern.
2020-03-28 03:58:57 +00:00
Enji Cooper
dc60c91821 Follow up to r359385
Actually add the generated manpages to unbreak the build.

MFC with:	r359385
2020-03-28 01:14:37 +00:00
Ed Maste
e4c8ad744a objdump: emit a deprecation notice at program start
PR:		212319
2020-03-27 19:39:14 +00:00
Dimitry Andric
aec4c088fd Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-0-gd32170dbd5b (aka 10.0.0 release).

PR:		244251
MFC after:	6 weeks
X-MFC-With:	358851
2020-03-26 17:46:32 +00:00
Dimitry Andric
6dce2be1c7 Merge commit 459e8e948 from llvm git (by Justin Hibbits):
[PowerPC]: Don't allow r0 as a target for LD_GOT_TPREL_L/32

  Summary:
  The linker is free to relax this (relocation R_PPC_GOT_TPREL16)
  against R_PPC_TLS, if it sees fit (initial exec to local exec). If r0
  is used, this can generate execution-invalid code (converts to 'addi
  %rX, %r0, FOO, which translates in PPC-lingo to li %rX, FOO). Forbid
  this instead.

  This fixes static binaries using locales on FreeBSD/powerpc (tested
  on FreeBSD/powerpcspe).

  Reviewed By: nemanjai
  Differential Revision: https://reviews.llvm.org/D76662

Requested by:	jhibbits
MFC after:	6 weeks
X-MFC-With:	358851
2020-03-26 17:28:54 +00:00
Dimitry Andric
5b5f869e87 Merge commit f0990e104 from llvm git (by Justin Hibbits):
[PowerPC]: e500 target can't use lwsync, use msync instead

  The e500 core has a silicon bug that triggers an illegal instruction
  program trap on any sync other than msync. Other cores will typically
  ignore illegal sync types, and the documentation even implies that
  the 'illegal' bits are ignored.

  Address this hardware deficiency by only using msync, like the PPC440.

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

Requested by:	jhibbits
MFC after:	6 weeks
X-MFC-With:	358851
2020-03-26 17:27:41 +00:00
Brooks Davis
b0d29bc47d Import the kyua test framework.
Having kyua in the base system will simplify automated testing in CI and
eliminates bootstrapping issues on new platforms.

The build of kyua is controlled by WITH(OUT)_TESTS_SUPPORT.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24103
2020-03-23 19:01:23 +00:00
Brooks Davis
c697fb7f7c Add liblutok a lightweight C++ API for lua.
It is added an INTERNALLIB and not installed.  It will be used by kyua.

This is a preparatory commit for D24103.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
2020-03-23 18:26:23 +00:00
Xin LI
a8675d927b MFV r359197: xz 5.2.5.
MFC after:	2 weeks
Relnotes:	yes
2020-03-22 01:27:38 +00:00
Ed Maste
e982f6f935 readelf: simplify Xen string note printing
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24140
2020-03-21 00:08:33 +00:00
Mark Johnston
c364ccf9ce libelftc: Fix a memory leak in cpp_demangle_read_type().
CID:		1305425
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-03-20 16:25:06 +00:00
Mark Johnston
d5e7add6b5 readelf: Fix another instance of the leak mentioned in r357542.
CID:		1292493
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-03-20 16:24:53 +00:00
Mark Johnston
c37c6b38b6 readelf: Avoid leaking ELF descriptors for archive entries.
CID:		1292494
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-03-20 16:24:40 +00:00