Commit Graph

18977 Commits

Author SHA1 Message Date
Enji Cooper
f2381beb2c MFhead@r322021 2017-08-03 17:43:26 +00:00
Phil Shafer
fd5e3f3ec6 Update from libxo-0.8.1 to 0.8.4:
0.8.4:
    - void anchor width optimization when we have a custom formatter (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130)
    - make "{[:/18}" do the right thing (also allows "{[:/%s}", wide ? 40 : 10)
    - Can't skip anchor formatting in non-display styles
    - add test case for {[:/18}
    - add upload-xohtml-files to 'make upload'
  0.8.3:
    - xohtml: Add "-w" option to pull support files from gh_pages
    - Add "upload-xohtml-files" target to publish support files in gh_pages/
    - add HISTORY/AUTHORS section to man pages
  0.8.2:
    - xohtml: Add div.units as standard CSS text
    - Don't treat values as format strings; they are not
    - add "-p" to "mkdir -p build" in setup.sh
    - add test case for {U:%%} (from df.c)
    - detect end-of-string in '%' and '' escaping
    - make xo_simple_field, for common simple cases
    - xohtml: nuke "n" in "echo" commands
    - rename "format" to "fmt" for consistency; same for "str" to "value"

Submitted by:	phil
2017-08-03 15:47:42 +00:00
Enji Cooper
3a8b7649ce MFhead@r321916 2017-08-02 09:00:59 +00:00
Enji Cooper
c119e4a444 Remove bogus bsd.subdir.mk .include
bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk.

MFC after:	3 days
2017-08-02 08:54:18 +00:00
Enji Cooper
d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper
46b37aa2c4 MFhead@r321912 2017-08-02 08:38:36 +00:00
Enji Cooper
4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Enji Cooper
8c09935728 Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiom 2017-08-02 08:14:06 +00:00
Cy Schubert
01da25af6b Remove redundant include directories which expand to a noop,
"-I/lib/krb5 -I -I".

Reviewed by:	ngie@, markm@
MFC after:	1 month
Differential Revision:	D11769
2017-07-31 19:07:45 +00:00
Dimitry Andric
37cd60a321 Upgrade our copies of clang, llvm, lld and lldb to r309439 from the
upstream release_50 branch.  This is just after upstream's 5.0.0-rc1.

MFC after:	2 months
X-MFC-with:	r321369
2017-07-30 18:01:34 +00:00
Enji Cooper
b9c6d356b2 libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)
Neither libcall takes a fourth argument (`char *errbuf`).

PR:		217884
Submitted by:	tobik
MFC after:	1 month
2017-07-29 22:25:45 +00:00
Enji Cooper
45805bd715 libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
procstat_getargv(3)

PR:		217884
MFC after:	1 month
Submitted by:	tobik
2017-07-29 22:19:00 +00:00
Enji Cooper
e504201ea7 Add sys/socket.h to SYNOPSIS for libprocstat(3)
sys/socket.h is required for procstat_get_socket_info(3), added in
r221807.

MFC after:	1 month
PR:		217884
Submitted by:	tobik
2017-07-29 22:16:05 +00:00
Dimitry Andric
9e3ca9b3ba Vendor import of lld release_50 branch r309439:
https://llvm.org/svn/llvm-project/lld/branches/release_50@309439
2017-07-29 21:30:27 +00:00
Dimitry Andric
104a02fb6c Vendor import of clang release_50 branch r309439:
https://llvm.org/svn/llvm-project/cfe/branches/release_50@309439
2017-07-29 21:28:13 +00:00
Dimitry Andric
3ad6a4b447 Vendor import of llvm release_50 branch r309439:
https://llvm.org/svn/llvm-project/llvm/branches/release_50@309439
2017-07-29 21:25:18 +00:00
Konstantin Belousov
d00ed7642f Simplify flow control.
Also add explicit comment why libc cannot simply rely on open(2)
failure in capability mode.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-07-28 12:22:32 +00:00
Konstantin Belousov
9a3083660d Use MFENCE to serialize RDTSC on non-Intel CPUs.
Kernel already used the stronger barrier instruction for AMDs, correct
the userspace fast gettimeofday() implementation as well.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D11728
2017-07-27 08:37:07 +00:00
Enji Cooper
9f27375481 Re-add #endif accidentally deleted in r321484
MFC after:	1 month
MFC with:	r321455, r321484
2017-07-25 16:57:25 +00:00
Enji Cooper
db92647731 Only test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build
The empty (unimplemented) test inputs for sparc64 trigger a -Wtype-limits build
failure because nitems of an empty array is always false, i.e., deadcode.

MFC after:	1 month
MFC with:	r321455
Reported by:	Jenkins (sparc64 job)
2017-07-25 16:21:22 +00:00
Enji Cooper
82482c7c1f Mask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
i386 by ignoring -Wmacro-redefined.

This is a bandaid until the code is fixed and will be reverted before MFC.
2017-07-25 16:11:36 +00:00
Konstantin Belousov
4f969e10d1 Fix indent.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-07-25 09:48:33 +00:00
Enji Cooper
bc82a381be Mark :reduction as an expected failure
It fails with clang 5.0+.

PR:	220989
MFC after:	2 months
MFC with:	r321369
Reported by:	Jenkins
2017-07-25 03:56:42 +00:00
Enji Cooper
4580a78efd Convert lib/msun/trig_test from TAP to ATF format
Only expose :accuracy and :reduction if !i386, similar to before,
but more holistically to avoid future -Wunused issue with the unused
functions.

MFC after:	1 month
2017-07-25 03:55:44 +00:00
Enji Cooper
fd5e9c331e Raise WARNS to 1
This will enable warnings with the msun tests.

MFC after:	1 month
2017-07-25 03:54:35 +00:00
Bryan Drewery
cd2831005b Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.
The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation.  So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after:	2 months
X-MFC-With:	r321369
2017-07-24 23:32:24 +00:00
Warner Losh
4c69a17ff9 fix typo 2017-07-24 18:10:42 +00:00
Dimitry Andric
0cc9e150fb Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases.  In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by:	Shawn Webb, Mark Millard
MFC after:	2 months
X-MFC-With:	r308421
2017-07-24 16:33:06 +00:00
Kristof Provost
a342f43571 Handle WITH/WITHOUT_PF in libsysdecode
Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

Differential Revision:	https://reviews.freebsd.org/D11629
2017-07-22 12:51:19 +00:00
Dimitry Andric
90a5403fea Merge ^/head r321307 through r321350. 2017-07-21 18:54:34 +00:00
Bryan Drewery
9f4bf11e12 Properly set userid for truncate_test.
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-07-21 16:14:06 +00:00
Alan Somers
18ddf67c64 Implement SIGEV_THREAD notifications for lio_listio(2)
Our man pages have always indicated that this was supported, but in fact the
feature was never implemented for lio_listio(2).

Reviewed by:	jhb, kib (earlier version)
MFC after:	20 days
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11680
2017-07-21 15:09:24 +00:00
Dimitry Andric
7a0f27890a Merge ^/head r321239 through r321306. 2017-07-20 20:37:23 +00:00
Alan Somers
1bf9ff7603 Remove some private symbols from librt
Private functions like __aio_read and _aio_read were exposed in
FBSDprivate_1.0 by r169090, even though they've never been used outside of
librt. Also, remove some weak references from r156136 that have never
resolved.

Reviewed by:	kib
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11649
2017-07-20 16:24:29 +00:00
Dimitry Andric
2fef18f836 Merge ^/head r320994 through r321238. 2017-07-19 19:43:10 +00:00
Dimitry Andric
b40b48b876 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and update
build glue.
2017-07-19 19:41:41 +00:00
Ed Maste
e6db6692e5 enable pidfile tests on arm64
Pidfile tests were disabled on arm64 (in r286863) because they hung.
They have been fixed (r306098) and so can be enabled now.

PR:		202304
Sponsored by:	The FreeBSD Foundation
2017-07-19 14:07:38 +00:00
Dimitry Andric
97a708bebc Vendor import of libc++ trunk r308421:
https://llvm.org/svn/llvm-project/libcxx/trunk@308421
2017-07-19 07:02:49 +00:00
Dimitry Andric
462d72ec21 Vendor import of compiler-rt trunk r308421:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@308421
2017-07-19 07:02:40 +00:00
Dimitry Andric
de51d67148 Vendor import of clang trunk r308421:
https://llvm.org/svn/llvm-project/cfe/trunk@308421
2017-07-19 07:02:30 +00:00
Dimitry Andric
93c91e39b2 Vendor import of llvm trunk r308421:
https://llvm.org/svn/llvm-project/llvm/trunk@308421
2017-07-19 07:02:10 +00:00
John Baldwin
ad6b4a346f Remove special handling for 'disk*.h'
This was originally added so that only one of diskmbr.h or diskpc98.h
was chosen and is no longer needed after PC98's removal.  However, the
special handling was also broken as it effectively prevented the decoding
of ioctls declared in other headers such as <sys/disk.h> or
<sys/disklabel.h>.
2017-07-18 21:09:29 +00:00
Pedro F. Giffuni
1c9158aabe libthr: check for possible overflow in the pthread_barrier_init() count.
Following up on r320900, where the check for negative count values was
removed, add a check to prevent integer overflow. This is to account that
b_count, b_waiters but most importantly the total number of threads in
the system are signed values.

Discussed with:	kib
MFC after:	2 weeks
2017-07-15 15:00:13 +00:00
Dimitry Andric
03f072d13d Merge ^/head r320971 through r320993. 2017-07-14 17:38:44 +00:00
Brad Davis
a9796f9d2b Follow up to r320992, properly escape the backslash so it renders properly.
MFC after:	1 week
Forgotten by:	brd
X-MFC-With:	r320992
2017-07-14 17:27:15 +00:00
Brad Davis
d29193055b Add a complete example to tsearch(3)
Reviewed by:	wblock, sevan, bruffer
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11053
2017-07-14 17:07:28 +00:00
Kenneth D. Merry
683b025ade Add IBM TS1155 density codes to libmt and the mt(1) man page.
These are taken directly from the density report from a TS1155
tape drive.  (Using mt getdensity)

lib/libmt/mtlib.c:
	Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
	values.  The bpmm/bpi values are the same as TS1150, but
	there are 50% more tracks.

usr.bin/mt/mt.1:
	Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
	values and number of tracks.  Bump the man page date.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-07-14 16:45:46 +00:00
Pedro F. Giffuni
97c3a994e4 libthr: 'count' is unsigned so don't check for negative values.
Obtained from:	DragonFlyBSD (git e7db8139)
2017-07-14 16:05:54 +00:00
Dimitry Andric
d2043ca373 Merge ^/head r320573 through r320970. 2017-07-13 22:01:38 +00:00
Dimitry Andric
c439438675 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and update
build glue.
2017-07-13 21:58:45 +00:00
Dimitry Andric
2678297743 Vendor import of lld trunk r307894:
https://llvm.org/svn/llvm-project/lld/trunk@307894
2017-07-13 19:26:06 +00:00
Dimitry Andric
289ae9e3ac Vendor import of libc++ trunk r307894:
https://llvm.org/svn/llvm-project/libcxx/trunk@307894
2017-07-13 19:25:57 +00:00
Dimitry Andric
1992b790c2 Vendor import of compiler-rt trunk r307894:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@307894
2017-07-13 19:25:48 +00:00
Dimitry Andric
8746d127c0 Vendor import of clang trunk r307894:
https://llvm.org/svn/llvm-project/cfe/trunk@307894
2017-07-13 19:25:38 +00:00
Dimitry Andric
ca089b24d4 Vendor import of llvm trunk r307894:
https://llvm.org/svn/llvm-project/llvm/trunk@307894
2017-07-13 19:25:18 +00:00
Mark Johnston
7f48d6a486 Don't dlclose NSS modules from nss_atexit().
As hinted in the commit log message for r259042, this is unnecessary.
Moreover, as a result of that change we may invoke a DSO's atexit handler
after it has been unmapped.

Reviewed by:	bdrewery, cem
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-07-11 17:59:15 +00:00
Bryan Drewery
1671f70652 DIRDEPS_BUILD: Connect more libraries.
Sponsored by:	Dell EMC Isilon
2017-07-11 00:32:48 +00:00
Konstantin Belousov
99ac8154ff Provide libdl.
Create libdl.so.1 as a filter for libc.so.7 which exports public dl*
functions. The functions are resolved from the rtld instead, the goal
of creating library is to avoid errors from the static linker due to
missed libdl. For static binaries, an empty .o is compiled into
libdl.a so that static binaries still get dl stubs from libc.a.

Right now lld cannot create filter objects, disable libdl on arm64
when binutils are not used.

Reviewed by:	bdrewery, dim (previos version); emaste
Exp run:	PR 220525, done by antoine
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D11504
2017-07-10 14:59:21 +00:00
Konstantin Belousov
7bd5b9f365 Fix warnings, adjust style.
Reviewed by:	bdrewery, dim, emaste (as part of D11504)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-07-10 08:10:45 +00:00
Warner Losh
a94a63f0a6 An MMC/SD/SDIO stack using CAM
Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's
flexible queueing will make it easier to write non-storage drivers
than the legacy stack. SDIO drivers from both the kernel and as
userland daemons are possible, though much of that functionality will
come later.

Some of the CAM integration isn't complete (there are sleeps in the
device probe state machine, for example), but those minor issues can
be improved in-tree more easily than out of tree and shouldn't gate
progress on other fronts. Appologies to reviews if specific items
have been overlooked.

Submitted by: Ilya Bakulin
Reviewed by: emaste, imp, mav, adrian, ian
Differential Review: https://reviews.freebsd.org/D4761

merge with first commit, various compile hacks.
2017-07-09 16:57:24 +00:00
Konstantin Belousov
dd5ef26e97 Simplify language.
Submitted by:	wblock
MFC after:	3 days
2017-07-08 07:33:30 +00:00
Kyle Evans
79c9a695c3 Correctly ignore branch operators in the top-level parser when applicable.
An oversight in r320742 caused BREs to become sensitive to the branching operator prematurely, which caused
breakage in some limited situations -- namely, those that tried to use branching in a BRE. Most of these scenarios
had already been corrected beforehand to properly use gsed or grep for GNU extensions, so the damage is
slightly mitigated.

Reported by: antoine

Reported by:	antoine
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D11522
2017-07-07 22:00:39 +00:00
Kyle Evans
3ea376f690 Fix sparc64 libc build after r320742.
p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

Reported by:	Jenkins (head-sparc64)
Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC with:	r320742
Differential Revision:	https://reviews.freebsd.org/D11506
2017-07-06 18:21:30 +00:00
Kyle Evans
15ae9efabe The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex changes by
refactoring and combining the top-level parsers for EREs/BREs ahead of time.

Branching functionality has been split out to make it easier to follow the combined
version of the top-level parser. It may also be enabled in the parsing context to make
it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and so that
BREs, for instance, can determine if they're the first expression in a chain of expressions
within the current branch and treat '*' as ordinary if so.

This should have no functional impact and negligible performance impact.

Reviewed by:	cem, emaste, pfg
Approved by:	emaste (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D10920
2017-07-06 17:01:51 +00:00
Alan Somers
eaca103d94 Fix cleanup in lib/libc/gen/setdomainname_test
ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR:		219967
Reviewed by:	ngie
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11188
2017-07-06 14:47:59 +00:00
Ed Maste
d9ad2b357b compiler_rt: provide bswap buildins on sparc64
Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'
2017-07-06 13:27:01 +00:00
Ed Maste
8f99208721 Sort entries in libgcc_s Version.map 2017-07-05 13:13:38 +00:00
Ed Maste
57e129b18c libelftc: bump version, tracking import in r320343 2017-07-05 02:58:46 +00:00
Ed Maste
8fadf6a637 cam: EOL whitespace cleanup and line wrapping changes
NFC. This cleanup simplifies diffs for review of the MMC-CAM work.

Submitted by:	kibab
2017-07-04 18:48:08 +00:00
Dimitry Andric
f6e653bb10 Merge ^/head r320398 through r320572. 2017-07-02 11:48:07 +00:00
Dimitry Andric
a580b01494 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.
2017-07-02 11:41:15 +00:00
Konstantin Belousov
c89a3f0013 Correct signatures of several pthreads stubs.
Most important, use a correct signature for the
__pthread_cleanup_push_imp() stub, which was incorrectly generated
with two-args variant.  The pthread_cleanup_info pointer was corrupted
in the forwarded call to the real libthr implementation, visible on
PowerPC and possibly ARM. [1]

Found and tested by:	Mark Millard <markmi@dsl-only.net> [1]
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-07-02 05:40:22 +00:00
Allan Jude
929b476ae6 Increase loop unrolling for skein hashes
This patch was inspired by an opposite change made to shrink the code
for the boot loader.

On my i7-4770, it increases the skein1024 speed from 470 to 550 MB/s

Reviewed by:	sbruno
MFC after:	1 month
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D7824
2017-07-01 21:18:06 +00:00
Dimitry Andric
0317860f00 Vendor import of lld trunk r306956:
https://llvm.org/svn/llvm-project/lld/trunk@306956
2017-07-01 13:24:45 +00:00
Dimitry Andric
50aa32eff7 Vendor import of compiler-rt trunk r306956:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@306956
2017-07-01 13:24:15 +00:00
Dimitry Andric
cf1b401909 Vendor import of clang trunk r306956:
https://llvm.org/svn/llvm-project/cfe/trunk@306956
2017-07-01 13:24:05 +00:00
Dimitry Andric
9df3605dea Vendor import of llvm trunk r306956:
https://llvm.org/svn/llvm-project/llvm/trunk@306956
2017-07-01 13:22:02 +00:00
Phil Shafer
20a21f671f Fix functional_test.sh to use --libxo options instead of the deprecated
LIBXO_OPTIONS environment variable.

Submitted by:	phil
2017-06-30 23:53:40 +00:00
Konstantin Belousov
b73ac66839 In the stdio cleanup push and pop wrappers, always call libc stubs for
__pthread_cleanup_push/pop_imp instead of symbols also exported from
libthr.

This prevents calls into libthr if libthr is not yet initialized.  The
situation occurs e.g. when an LD_PRELOADed object is not linked
against libthr, but the main binary is.

Reported and tested by:	jbeich
PR:	 220381
Discussed with:	vangyzen
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
2017-06-30 20:27:51 +00:00
Konstantin Belousov
14d1c3b581 Fix typo in the r320472 change to fgetws(). Return proper value.
Reported by:	Oleg Ginzburg <olevole@olevole.ru>
Reviewed by:	vangyzen
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
2017-06-30 20:23:46 +00:00
Xin LI
94c5b2d124 Revert r300385 and r300624 which was false positive
reported by cppcheck.

dup_ncp() tries to allocate a buffer of MAXNETCONFIGLINE
as tmp, which is then assigned to p->nc_netid via strcpy,
so the free(p->nc_netid) would have correctly released
the memory in case nc_lookups() fails, therefore, the
allerged leak never existed.

MFC after:	3 days
2017-06-30 07:04:10 +00:00
Konstantin Belousov
fda0a14f47 Make stdio deferred cancel-safe.
If used with fopen(3)/fdopen(3)-ed FILEs, stdio accurately uses
non-cancellable internal versions of the functions, i.e. it seems to
be fine with regard to cancellation.  But if the funopen(3) and
f{r,w}open(3) functions were used to open the FILE, and corresponding
user functions create cancellation points (they typically have no
other choice), then stdio code at least leaks FILE' lock.

The change installs cleanup handler which unlocks FILE.  Some minimal
restructuring of the code was required to make it use common return
place to satisfy hand-rolled pthread_cleanup_pop() requirements.

Noted by:	eugen
Reviewed by:	eugen, vangyzen
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D11246
2017-06-29 14:44:17 +00:00
Andrew Turner
3ab06e30cb Start to remove _libc_arm_fpu_present checks. We don't support the VFP on
ARMv4 or ARMv5, and only support it when it's present on ARMv6 and later.
As such always store the VFP register in setjmp and restore them in
longjmp when building for armv6.

Reviewed by:	mmel
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11393
2017-06-29 14:00:05 +00:00
Xin LI
80bfc295ef Don't bother to set target for SEEK_END.
While there also collapase SEEK_END into default case in lseek.

MFC after:	2 weeks
2017-06-29 06:28:54 +00:00
Enji Cooper
c45beed8da Add initial documentation for procstat_freeptlwpinfo and procstat_getptlwpinfo
MFC after:	1 month
MFC with:	r316286
2017-06-27 08:49:47 +00:00
Enji Cooper
a2ae08e72e procstat_getptlwpinfo(..): clarify the fact that KVM/SYSCTL support
isn't supported

This will make the error message reported in bug 220023 a bit more
intuitive for end-users that don't have access to the source code to
decode the procstat->type argument.

MFC after:	1 month
MFC with:	r316286
PR:		220023
2017-06-27 08:18:08 +00:00
Dimitry Andric
a3604b95ed Merge ^/head r320042 through r320397. 2017-06-27 06:44:32 +00:00
Dimitry Andric
edd7eaddc8 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.
2017-06-27 06:40:39 +00:00
Dimitry Andric
4ea16835ba Vendor import of lld trunk r306325:
https://llvm.org/svn/llvm-project/lld/trunk@306325
2017-06-26 20:33:45 +00:00
Dimitry Andric
10fcf738d7 Vendor import of compiler-rt trunk r306325:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@306325
2017-06-26 20:33:22 +00:00
Dimitry Andric
ef915aab0a Vendor import of clang trunk r306325:
https://llvm.org/svn/llvm-project/cfe/trunk@306325
2017-06-26 20:33:12 +00:00
Dimitry Andric
08bbd35a80 Vendor import of llvm trunk r306325:
https://llvm.org/svn/llvm-project/llvm/trunk@306325
2017-06-26 20:32:52 +00:00
Konstantin Belousov
19bd0d9c85 Implement address space guards.
Guard, requested by the MAP_GUARD mmap(2) flag, prevents the reuse of
the allocated address space, but does not allow instantiation of the
pages in the range.  It is useful for more explicit support for usual
two-stage reserve then commit allocators, since it prevents accidental
instantiation of the mapping, e.g. by mprotect(2).

Use guards to reimplement stack grow code.  Explicitely track stack
grow area with the guard, including the stack guard page.  On stack
grow, trivial shift of the guard map entry and stack map entry limits
makes the stack expansion.  Move the code to detect stack grow and
call vm_map_growstack(), from vm_fault() into vm_map_lookup().

As result, it is impossible to get random mapping to occur in the
stack grow area, or to overlap the stack guard page.

Enable stack guard page by default.

Reviewed by:	alc, markj
Man page update reviewed by:	alc, bjk, emaste, markj, pho
Tested by:	pho, Qualys
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D11306 (man pages)
2017-06-24 17:01:11 +00:00
Konstantin Belousov
2351218ca8 Remove the description of MAP_HASSEMAPHORE.
The flag is not implemented, all FreeBSD architectures correctly
handle locks on normal cacheable mappings.  On the other hand, the
flag was specified by some software, so it is kept in the header as
nop.  Removal from the man page should discourage its use.

Reviewed by:	alc, bjk, emaste, markj, pho
MFC after:	3 days
X-Differential revision:	https://reviews.freebsd.org/D11306
2017-06-24 16:36:30 +00:00
Konstantin Belousov
287c1c8c13 Fix typo.
Noted by:	alc
MFC after:	3 days
2017-06-24 16:21:34 +00:00
Warner Losh
a639d52309 Be sure to free allocated statfs11 buffer.
Submitted by: Alistair Crooks
2017-06-24 00:28:35 +00:00
Warren Block
6d0f80c921 Remove redundant wording, minor edits for clarity.
MFC after:	1 week
Sponsored by:	iXsystems
2017-06-23 18:38:27 +00:00
Warner Losh
5ab191c42b Forward compatibility for ino64.
Add forward compatibility so that new binaries can run on old
kernels. If the new system call from ino64 isn't available on your
system, then the old one will be used and the results translated.  The
stat and statfs families of functions are fully emulated. While not
required by policy, in this case it is helpful to our users to provide
this compatibility. In this case, it allows rollback of the kernel
after installing a new userland should a problem be discovered. It
also prevents foot-shooting if a user does an install before rebooting
with the new kernel. Finally, it allows the use case where one needs
to run new binaries on an old kernel as part of an upgrade process.

The getdirentries family uses tricks that may not work on remote
filesystems. Specifically, it uses a buffer 1/4 the size requested to
get the data from he old syscall.

The code carefully uses direct syscalls for old system calls to avoid
referencing freebsd11_* symbols, which contaminate ld-elf.so.1's
export table due to its use of stat functions, which causes errno to
be incorrect in client programs due to the wrong *stat* function being
resolved in some cases.

This code should removed sometime after 12 is branched.

Tested on: 12-current binaries on a 10.3-beta kernel run and return
       consistent results. 12-current kernel and userland with
       packages from before ino64 was committed also work.

Differential Revision: https://reviews.freebsd.org/D11185
Reviewed by: kib@, emaste@
2017-06-23 18:06:20 +00:00
Alan Somers
09986d3bd2 Clarify usage of aio(4) with kqueue(2)
Reviewed by:	jhb
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D11299
2017-06-23 00:40:09 +00:00
Xin LI
091867a611 Fix use-after-free introduced in r300388.
In r300388, endnetconfig() was called on nc_handle which would release
the associated netconfig structure, which means tmpnconf->nc_netid
would be a use-after-free.

Solve this by doing endnetconfig() in return paths instead.

Reported by:	jemalloc via kevlo
Reviewed by:	cem, ngie (earlier version)
MFC after:	3 days
Differential Revision:    https://reviews.freebsd.org/D11288
2017-06-22 05:10:16 +00:00
Bryan Drewery
f944e9e208 Tweak r320206: Still create the TABLE but not the .depend entry for missing headers.
X-MFC-With:	r320206
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-06-21 23:28:24 +00:00
Bryan Drewery
87d18efc7b Follow-up r308602: Don't add missing headers to .depend.tables.h.
This also avoids an error from egrep when a header is missing.  This can happen
with something like WITHOUT_BLUETOOTH set when searching for
$include_dir/netgraph/bluetooth/include/ng_btsocket.h.  The warning was
not an error (from set -e) due to being on the left side of a pipe.  Now the
all_headers list is only filled with existing headers.

Reviewed by:	ngie
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-06-21 23:01:18 +00:00
Jason Evans
e46bcb7d38 Decrease relative branch brittleness.
Replace conditional branches with trampolines to unconditional branches when
jumping to labels within other compilation units.  This increases the offset
range from +-1 MiB to +-128 MiB.
2017-06-20 07:25:38 +00:00
Bryan Drewery
c99b67a794 Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.
Since buildenv exports SYSROOT all of these uses will now look in
WORLDTMP by default.

sys/boot/efi/loader/Makefile
        A LIBSTAND hack is no longer required for buildenv.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-06-19 20:47:24 +00:00
Conrad Meyer
a13136cdb7 pdwait4(2): Remove documentation of vaporware
This syscall has never existed and is not at risk of existing any time soon.
Remove documentation referencing it, which has been wrong since FreeBSD 9.

Reported by:	allanjude@
2017-06-17 17:32:40 +00:00
Konstantin Belousov
f3990417c5 Do not leak syslog_mutex on cancellation.
Make syslog(3) resilent to cancellation occuring in supported deferred
mode.  Code must unlock syslog_mutex on cancel, install the cleanup
handler.

Diagnosed and tested by:	eugen
Discussed with:	dchagin
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-06-17 11:29:59 +00:00
Konstantin Belousov
2b34e84335 Add abstime kqueue(2) timers and expand struct kevent members.
This change implements NOTE_ABSTIME flag for EVFILT_TIMER, which
specifies that the data field contains absolute time to fire the
event.

To make this useful, data member of the struct kevent must be extended
to 64bit.  Using the opportunity, I also added ext members.  This
changes struct kevent almost to Apple struct kevent64, except I did
not changed type of ident and udata, the later would cause serious API
incompatibilities.

The type of ident was kept uintptr_t since EVFILT_AIO returns a
pointer in this field, and e.g. CHERI is sensitive to the type
(discussed with brooks, jhb).

Unlike Apple kevent64, symbol versioning allows us to claim ABI
compatibility and still name the new syscall kevent(2).  Compat shims
are provided for both host native and compat32.

Requested by:	bapt
Reviewed by:	bapt, brooks, ngie (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D11025
2017-06-17 00:57:26 +00:00
Dimitry Andric
4198293b25 Merge ^/head r319801 through r320041. 2017-06-17 00:14:54 +00:00
Dimitry Andric
24d58133b7 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and update
build glue.
2017-06-17 00:09:34 +00:00
Konstantin Belousov
d60fa657b2 Move the description of kern.kq_calloutmax sysctl into a new paragraph
for better presentation.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-06-16 23:25:11 +00:00
Konstantin Belousov
17c847c1ff Start a new sentence on the new line.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-06-16 23:17:31 +00:00
Dimitry Andric
8462a49537 Vendor import of libc++ trunk r305575:
https://llvm.org/svn/llvm-project/libcxx/trunk@305575
2017-06-16 21:04:04 +00:00
Dimitry Andric
4658ff5fee Vendor import of compiler-rt trunk r305575:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@305575
2017-06-16 21:03:53 +00:00
Dimitry Andric
325377b573 Vendor import of clang trunk r305575:
https://llvm.org/svn/llvm-project/cfe/trunk@305575
2017-06-16 21:03:44 +00:00
Dimitry Andric
7c7aba6e5f Vendor import of llvm trunk r305575:
https://llvm.org/svn/llvm-project/llvm/trunk@305575
2017-06-16 21:03:24 +00:00
Maxim Sobolev
3d751650c1 Document st_flags in the stat(2).
Approved by:	mckusick,vangyzen,jilles
Differential Revision:	https://reviews.freebsd.org/D10852
2017-06-16 15:09:43 +00:00
Jason Evans
b7eaed250f Update jemalloc to 5.0.0. 2017-06-15 07:15:05 +00:00
Dimitry Andric
5c4e2ac498 Revert r319796 for now, it can cause undefined references when linking
in some circumstances.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2017-06-13 21:01:06 +00:00
Konstantin Belousov
b43ce76c77 Add ptrace(PT_GET_SC_ARGS) command to return debuggee' current syscall
arguments.

Reviewed by:	jhb (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D11080
2017-06-12 21:15:43 +00:00
Enji Cooper
5bf28159df Remove stdlib.h #include added in r319844
A previous iteration of the tests I added in r319844 involved free(3), but
that attempt didn't pan out, so I switched to stack allocated buffers instead
of heap allocated ones, making the #include unnecessary.

MFC after:	1 month
MFC with:	r319844
2017-06-12 02:38:37 +00:00
Enji Cooper
f56f82e00f Add positive and negative testcases for cam_get_device(3)
MFC after:	1 month
Submitted by:	Evan Cramer <evan.cramer@isilon.com>
2017-06-12 02:12:22 +00:00
Enji Cooper
5e3f43f2e0 getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE
gets output via warnx(3)

This helps set expectations for how one might deal with those messages, i.e.,
mute output from /dev/stderr today, since that's where vwarn(3) outputs messages
to today.

MFC after:	1 month
2017-06-12 00:43:14 +00:00
Mark Johnston
df633e60c9 Remove an inaccuracy from socket.2.
SOCK_SEQPACKET is implemented for several protocols.

MFC after:	1 week
2017-06-10 21:07:55 +00:00
Dimitry Andric
db17bf38c5 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305145, and update
build glue.
2017-06-10 19:17:14 +00:00
Dimitry Andric
834210fa5d Remove a few unneeded files from libllvm, libclang and liblldb.
MFC after:	3 days
2017-06-10 18:52:13 +00:00
Dimitry Andric
2079716dfb Vendor import of lld trunk r305145:
https://llvm.org/svn/llvm-project/lld/trunk@305145
2017-06-10 13:44:49 +00:00
Dimitry Andric
7edd24de96 Vendor import of compiler-rt trunk r305145:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@305145
2017-06-10 13:44:32 +00:00
Dimitry Andric
1b08b196ac Vendor import of clang trunk r305145:
https://llvm.org/svn/llvm-project/cfe/trunk@305145
2017-06-10 13:44:22 +00:00
Dimitry Andric
7ab83427af Vendor import of llvm trunk r305145:
https://llvm.org/svn/llvm-project/llvm/trunk@305145
2017-06-10 13:44:06 +00:00
Dimitry Andric
686fb94a00 Merge ^/head r319548 through r319778. 2017-06-10 13:22:49 +00:00
John Baldwin
30b94d0cf4 Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot().
The reboot() system call accepts a mode (RB_AUTOBOOT, RB_HALT, RB_POWEROFF,
or RB_REROOT) as well as zero or more optional flags in 'howto'.
However, RB_AUTOBOOT was only displayed if 'howto' was exactly 0.
Combinations like 'RB_AUTOBOOT | RB_DUMP' were decoded as 'RB_DUMP'.
Instead, imply that RB_AUTOBOOT was specified if none of the other "mode"
flags were specified.
2017-06-10 01:20:08 +00:00
Phil Shafer
2f78413036 Import libxo-0.8.1 with official fix to today's build break.
Submitted by:	phil
2017-06-09 03:32:49 +00:00
Phil Shafer
f2b7bf8afc Import libxo-0.8.0:
- addition of --libxo colors=xxxxx color map (so I never see "blue")
 - fix bugs from -fsanitize=address and =undefined
 - utf-8 changes (remove support fore 6 byte utf-8 values, which are "historical")
 - add comments
 - fix man pages
 - update test cases

Submitted by:	phil
Reviewed by:	sjg
Approved by:	sjg (mentor)
2017-06-08 13:04:01 +00:00
Jilles Tjoelker
e0e0323354 libc: Remove futimens() and utimensat() compat stubs.
The futimens() and utimensat() compat stubs allowed using these functions on
kernels that did not have the system calls yet (10.2, old 11-current).

Also remove the documentation of the [ENOTSUP] error that could occur with
an old kernel.

A -DNO_CLEAN build may fail because the depend files refer to the deleted
files.
2017-06-07 21:21:14 +00:00
Will Andrews
c384464d25 tsearch_test: Test twalk & add some determinism. 2017-06-06 03:40:45 +00:00
Toomas Soome
a87f43927c ANSIfy md5 functions
Update the function declarations.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D11055
2017-06-05 11:55:26 +00:00
Dimitry Andric
a14eb6db99 Merge ^/head r319480 through r319547. 2017-06-03 18:21:50 +00:00
Dimitry Andric
6d97bb297c Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304659, and update
build glue.
2017-06-03 18:18:34 +00:00
Dimitry Andric
25091d6bd0 Vendor import of compiler-rt trunk r304659:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@304659
2017-06-03 15:21:00 +00:00
Dimitry Andric
551c698530 Vendor import of clang trunk r304659:
https://llvm.org/svn/llvm-project/cfe/trunk@304659
2017-06-03 15:20:48 +00:00
Dimitry Andric
d288ef4c17 Vendor import of llvm trunk r304659:
https://llvm.org/svn/llvm-project/llvm/trunk@304659
2017-06-03 15:20:36 +00:00
John Baldwin
ee8aa41dca Decode the 'who' argument passed to getrusage().
Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant
passed as the first argument to getrusage().  Use this function in both
kdump and truss to decode the first argument to getrusage().

PR:		215448
Submitted by:	Anton Yuzhaninov <citrin+pr@citrin.ru>
MFC after:	1 month
2017-06-03 14:22:15 +00:00
John Baldwin
2bdd2e7e61 Add a cross-reference to sysdecode_socket_protocol(3). 2017-06-03 14:10:09 +00:00
John Baldwin
60b67035f2 Remove stale cap_rights_get(2) manpage.
The documentation moved to section 3 several years ago, but
'man cap_rights_get' pulls up cap_rights_limit(2) (which is
MLINKed to cap_rights_get.2) instead of cap_rights_get(3).

MFC after:	1 week
2017-06-02 03:53:34 +00:00
Dimitry Andric
4224465e82 Merge ^/head r319251 through r319479. 2017-06-01 22:59:41 +00:00
Dimitry Andric
f9448bf33f Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304460, and update
build glue.
2017-06-01 22:47:02 +00:00
Dimitry Andric
38d6a62a21 For arm targets, place ABI at the end of the target triple
For some reason, we have been inserting the ABI specification into the
middle of the target triple, when building LLVM, like so:

    armv6-gnueabi-freebsd12.0

This is the wrong way around.  LLVM even auto-canonicalizes it to:

    armv6--freebsd12.0-gnueabi

Let's do this the right way in llvm.build.mk instead.  While here,
define a proper VENDOR macro which can be overridden easily.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D10846
2017-06-01 21:05:56 +00:00
Dimitry Andric
06eabdc027 Vendor import of compiler-rt trunk r304460:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@304460
2017-06-01 20:58:59 +00:00
Dimitry Andric
416ada0f75 Vendor import of clang trunk r304460:
https://llvm.org/svn/llvm-project/cfe/trunk@304460
2017-06-01 20:58:49 +00:00
Dimitry Andric
f382538d47 Vendor import of llvm trunk r304460:
https://llvm.org/svn/llvm-project/llvm/trunk@304460
2017-06-01 20:58:36 +00:00