Commit Graph

19934 Commits

Author SHA1 Message Date
Dimitry Andric
86392292ee Vendor import of llvm release_70 branch r346007:
https://llvm.org/svn/llvm-project/llvm/branches/release_70@346007
2018-11-04 14:41:47 +00:00
Mateusz Piotrowski
6d080f8660 csqrt(3): Fix some typos in the manual page
Submitted by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
Reviewed by:	eadler
Approved by:    krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17831
2018-11-04 14:11:38 +00:00
Matt Macy
dacc43df34 Add aditional counter descriptions to AMD 0x17
Submitted by:	Somalapuram Amaranath
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D17401
2018-11-04 06:24:27 +00:00
Yuri Pankov
32a8ec8bdd strptime: make %k and %l specifiers match their description in
strftime(3), and allow them to process space-padded input.

PR:		230720
Submitted by:	rlittle@inetco.com (original version)
Approved by:	kib (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17761
2018-11-03 23:37:13 +00:00
Eric van Gyzen
77c85705a6 Vendor import of expat 2.2.6
Sponsored by:	Dell EMC Isilon
2018-11-02 22:10:07 +00:00
Conrad Meyer
78c2a9806e kern_poll: Restore explanatory comment removed in r177374
The comment isn't stale.  The check is bogus in the sense that poll(2)
does not require pollfd entries to be unique in fd space, so there is no
reason there cannot be more pollfd entries than open or even allowed
fds.  The check is mostly a seatbelt against accidental misuse or
abuse.  FD_SETSIZE, while usually unrelated to poll, is used as an
arbitrary floor for systems with very low kern.maxfilesperproc.

Additionally, document this possible EINVAL condition in the poll.2
manual.

No functional change.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D17671
2018-11-01 23:46:23 +00:00
Kyle Evans
4635676d25 libbe(3): Don't promote non-cloned BEs
Most easily reproducible by attempting to activate the currently activated
BE, one would get a "not a cloned filesystem" error instead of success or a
sane message.

PR:		232488
MFC after:	3 days
2018-11-01 14:00:56 +00:00
Ed Maste
57706376c6 Add __used to __CTOR_LIST__ and __DTOR_LIST__
Enabling BSD_CRTBEGIN on amd64 resulted in
error: unused variable '__CTOR_LIST__'.

__CTOR_LIST__ is indeed unused in crtbegin.c; it marks the beginning of
the .ctors array and is used in crtend.c.  Annotate __DTOR_LIST__ as
well for consistency.

Discussed with:	andrew
MFC with:	r339738
Sponsored by:	The FreeBSD Foundation
2018-10-31 14:19:58 +00:00
Andrew Turner
8522d140a5 Build the csu tests on all architectures.
The tests haven't been run them, but this is enough to build them so I can
get feedback on if the various crt.h headers are correct.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 14:44:12 +00:00
Andrew Turner
ca34591f29 Disable the .preinit_array test in DSOs, ld.bfd fails to link objects with
the section.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 11:19:47 +00:00
Andrew Turner
bb966f87bc Fix the location of the static keyword.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 10:16:21 +00:00
Andrew Turner
6ec0ee844c Run the csu tests on a DSO. This builds the tests into a shared library,
then runs these from the base test programs. With this we can check
crtbeginS.o and crtendS.o are working as expected.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 09:43:26 +00:00
Andrew Turner
9e26e65c16 The jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 09:36:31 +00:00
Yuri Pankov
281c29899f Connect libc/tests/time to the build, adding test cases for strptime()
issues fixed recently, and disabling the failing ones (mostly due to TZ
parsing differences with NetBSD).

Reviewed by:	ngie
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17546
2018-10-30 02:37:23 +00:00
Konstantin Belousov
1d160e1e9c Convert amd64_get/set_fs/gsbase to ifunc.
Note that this is the first use of ifuncs in our userspace.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2018-10-30 00:11:30 +00:00
Alex Richardson
2fa224b17d Fix get_maxfds() in jevents
If RLIM_INFINITY == -1ULL (such as on macOS) the min() call will result
in a value of less than 1 being returned. This causes nftw() to fail
with EINVAL.

While touching this file also fix includes to work on Linux/macOS and don't
declare snprintf since it may have different attributes in the system
headers there.

Reviewed By:	mmacy
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17682
2018-10-29 21:08:34 +00:00
Andrew Turner
fb7128c25e Make the .ctors, .dtors, and .jcr markers as static. They shouldn't be
accessible from out of the files they are defined in.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-29 17:55:26 +00:00
Andrew Turner
235130433a Check __dso_handle is NULL in non-DSO objects. It should only be non-NULL
when accessed from a shared object.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-29 17:03:20 +00:00
Warner Losh
f64bccc6d9 Bump .Dd forgotten in last commit. 2018-10-28 03:02:09 +00:00
Warner Losh
5669c6748d Note that the kenrel doesn't keep track daylight savings time, nor
timezone offset. These values are generally zero.

While one still theoreticall could set these values, that's almost
never done. Users wishing to have an offset between the time of day
clock hardware and UTC use adjkerntz(8) instead.

localtime(3) should be used to find these values for the current
timezone.
2018-10-28 02:58:22 +00:00
Warner Losh
33b5b3ef75 ftime appeared in 7th Edition Unix to replace gtime.
Note that the timezone and dst entries are always returned as 0.
2018-10-28 02:58:15 +00:00
Dimitry Andric
fda9adafa3 Merge ^/head r339670 through r339812. 2018-10-27 14:44:39 +00:00
Warner Losh
366a7b3d0c Ensure that the device path is sane before trying to decode and print
it.

Sponsored by: Netflix, Inc
2018-10-26 22:49:36 +00:00
Andrew Turner
fd8767bb69 Add __dso_handle to the BSD crtbegin. This is used to identify shared
objects.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-26 11:53:20 +00:00
Andrew Turner
4b48b463ed Drop the csu tests WARNS to 5 to fix the powerpc64 build.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-26 08:12:28 +00:00
Konstantin Belousov
4f77f48884 Implement O_BENEATH and AT_BENEATH.
Flags prevent open(2) and *at(2) vfs syscalls name lookup from
escaping the starting directory.  Supposedly the interface is similar
to the same proposed Linux flags.

Reviewed by:	jilles (code, previous version of manpages), 0mp (manpages)
Discussed with:	allanjude, emaste, jonathan
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D17547
2018-10-25 22:16:34 +00:00
Martin Matuska
b1c91e4b6c MFV r339640,339641,339644:
Sync libarchive with vendor

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time

MFC after:	1 month
2018-10-25 21:44:17 +00:00
Andrew Turner
812c4fa807 Add a missing include for src.opts.mk. Without it MK_TESTS isn't defined.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-25 21:08:15 +00:00
Andrew Turner
31d62a73c2 Implement a BSD licensed crtbegin/crtend
These are needed for .ctors/.dtors and .jcr handling. The former needs
all the function pointers to be called in the correct order from the
.init/.fini section. The latter just needs to call a gcj specific function
if it exists with a pointer to the start of the .jcr section.

This is currently disabled until __dso_handle support is added.

Reviewed by:	emaste
MFC after:	1 month
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17587
2018-10-25 17:39:41 +00:00
Mateusz Piotrowski
4026e1cc68 efivar(3): Fix some typos and improve style
- Fix some typos.
- Remove redundant semicolons from the synopsis section.
- Stylize variable names and types with Vt and Va respectively.
- Use a list to present non-implemented functions.
- Sort the order of the sections.
- Add a history section.
- Use Nm when "libefivar" is mentioned.

PR:		232626
Reported by:	Tiwei Bie <btw@mail.ustc.edu.cn>
Reviewed by:	bcr, imp
Approved by:	krion (mentor, implicit), mat (mentor, implicit)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D17686
2018-10-25 15:41:19 +00:00
Mark Johnston
b8e4cdda35 Clarify slightly the interaction between wait*() and pdfork().
There are multiple ways to wait for any child process to return a
status (e.g., waitpid(-1, ...), waitid(P_ALL, ...)), so don't be so
specific.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-10-24 18:42:13 +00:00
Mark Johnston
e9b1dc32c9 Fix comments.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-10-24 00:17:19 +00:00
Dimitry Andric
c6879c6c14 Merge ^/head r339015 through r339669. 2018-10-23 21:09:37 +00:00
Cy Schubert
3ad12d2782 Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by:	emaste@
MFC after:	3 days
2018-10-23 14:16:02 +00:00
Alex Richardson
60b905ae2f Fix ncurses fallback.c build with a strict build shell
The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to MkFallback.sh and only creating
fallback.c if MKfallback.sh succeeds.

Aproved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16867
2018-10-23 06:31:31 +00:00
Alex Richardson
c5c5072bb0 Fix regex for extracting SHM_* values for libsysdecode
There was an additional + after the {6} which is apparently ignored by the
FreeBSD regex implementation but was giving me an error when compiling on
MacOS.

While changing this also make sure that tables.h is not created if mktables
fails. The current rule would create a partial tables.h which causes following
incremental builds to use that broken file and fail with an unrelated
compilation error or even succeed even though they shouldn't.

Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D17069
2018-10-23 06:31:19 +00:00
Conrad Meyer
0f743729ab Update to Zstandard 1.3.7
Relnotes:	yes
Sponsored by:	Dell EMC Isilon
2018-10-22 18:29:12 +00:00
Glen Barber
91e8ea7f5c Comment -DNDEBUG in head after r339436 when head was switched
from 12.0-ALPHA10 to 13.0-CURRENT.  This edit was a mistake,
and should have been applied to stable/12 upon branching, not
head.

Reported by:	jbeich, dim
Sponsored by:	The FreeBSD Foundation
2018-10-21 15:54:38 +00:00
Poul-Henning Kamp
01652e9c8e Update example to something people less than 40 years old have heard about. 2018-10-21 07:30:26 +00:00
Ed Maste
6492be46b8 ANSIfy libc/quad
Some of these routines exist in both lib/libc/quad/ and sys/libkern/.
r325988 ANSIfied sys/libkern.  Update libc/quad to match.

PR:		223641
Reported by:	bde
Sponsored by:	The FreeBSD Foundation
2018-10-21 00:20:40 +00:00
Ed Maste
05bc9aa78f mcount: tidy up ANSIfication
libc/gmon's mcount was ANSIfied in r124180, with libkern following over
a decade later, in r325988, but some minor discrepancies remained.
Update libc/gmon's mexitcount to an ANSI C function definition, and use
(void) for libkern-only functions that take no arguments.

Reported by:	bde
2018-10-20 22:39:35 +00:00
Mariusz Zaborski
27eff71458 Add link to the setproctitle_fast function.
MFC after:	1 week
2018-10-20 22:25:57 +00:00
Conrad Meyer
243e09430a Embedded chacha: Distinguish via dedicated macro
Set embedding expectations via CHACHA_EMBED macro rather than _KERNEL
definition.

No functional change.

Sponsored by:	Dell EMC Isilon
2018-10-20 22:14:29 +00:00
Conrad Meyer
0a3a36cd94 getentropy(3): Trap non-API errnos from getrandom(2) and abort
Additionally, reconcile our abort behavior with arc4random(3).  Unlike
SIGABRT, SIGKILL cannot be caught by the user program.  These failures
are fatal conditions and should not return to the caller, as they did in
the instance that resulted in D17049.

While here, fix some minor typos in a comment.

Reviewed by:	delphij
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D17050
2018-10-20 21:45:17 +00:00
Yuri Pankov
4644f9bef6 Add -b/-l options to localedef(1) to specify output endianness and use
it appropriately when building share/ctypedef and share/colldef.

This makes the resulting locale data in EL->EB (amd64->powerpc64) cross
build and in the native EB build match.  Revert the changes done to libc
in r308170 as they are no longer needed.

PR:		231965
Reviewed by:	bapt, emaste, sbruno, 0mp
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17603
2018-10-20 20:51:05 +00:00
Mark Johnston
4ac9afdd2c Fix formatting.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-10-20 17:48:05 +00:00
Ed Maste
b0bffd128c Bump LLD_REVISION_STRING for 13-CURRENT 2018-10-20 17:42:38 +00:00
Glen Barber
b958317950 - Update head to 13.0-CURRENT.
- Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER,
  FREEBSD_CC_VERSION, OS_VERSION.
- Update comment in UPDATING regarding debugging options.
- Remove debug.witness.trace=0 from installation media.
- Bump __FreeBSD_version.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-10-19 00:37:47 +00:00
Yuri Pankov
eb144aa007 strptime: fix parsing of tm_year when both %C and %y appear in the
format string in arbitrary order.  This makes the related test cases in
lib/libc/tests/time (not yet connected to the build) pass.

While here, don't error on negative tm_year value based on the
APPLICATION USAGE in
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
(glibc does the same):

tm_year is a signed value; therefore, years before 1900 may be represented.

Approved by:	re (gjb), kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17550
2018-10-17 14:51:43 +00:00
Edward Tomasz Napierala
8bb6c72e63 Get rid unneccessary useless calls to lseek(2) from getgrent(3).
Looks like this:

 fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r-- ,inode=2167001,size=390,blksize=32768 },0x0) = 0 (0x0)
 open("/etc/group",O_RDONLY|O_CLOEXEC,0666)      = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=2166927,size=919,blksize=32768 }) = 0 (0x0)
-lseek(3,0x0,SEEK_CUR)                           = 0 (0x0)
-lseek(3,0x0,SEEK_SET)                           = 0 (0x0)
 read(3,"# $FreeBSD: release/10.0.0/etc/g"...,32768) = 919 (0x397)
 close(3)                                        = 0 (0x0)

Reviewed by:	kib
Approved by:	re (gjb)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17571
2018-10-16 18:17:07 +00:00
Gleb Smirnoff
9004dbddea Avoid OOB reads in memmem(3).
commit 51bdcdc424bd7169c8cccdc2de7cad17f5ea0f70
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Fri Jun 30 00:35:33 2017 +0300

    fix OOB reads in Xbyte_memmem

    Reported by Leah Neukirchen.

Reviewed by:	emaste
Approved by:	re (kib)
2018-10-15 20:20:57 +00:00
Edward Tomasz Napierala
d3450d02c7 Prevent flex(1) from generating calls to isatty(3) - and, in turn,
TIOCGETA ioctls - when parsing nsswitch.conf(5).

Reviewed by:	imp, markj
Approved by:	re (gjb)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17564
2018-10-15 19:48:36 +00:00
Edward Tomasz Napierala
1d7da823b4 Don't call dlopen(3) for built-in NSS types - "cache", "compat",
"dns", "files", "db", and "nis". It saves some path lookups during
binary startup.

Reviewed by:	markj
Approved by:	re (gjb, kib)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17557
2018-10-15 17:50:02 +00:00
Edward Tomasz Napierala
edbedaf4dc Add .Xrs to kqueue(2) from pdfork(2) and procdesc(4), to make EVFILT_PROCDESC
easier to find.

Approved by:	re (rgrimes)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-10-14 18:42:54 +00:00
Konstantin Belousov
bdafb02fcb Process irelocs for statically linked binaries from crt1 on x86.
This makes statically linked binaries with ifuncs operational.

Reported and tested by:	mjg
Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
Approved by:	re (rgrimes)
Differential revision:	https://reviews.freebsd.org/D17363
2018-10-13 23:52:55 +00:00
Mateusz Guzik
9c7d70ee7d amd64: convert libc bcopy to a C func to avoid future bloat
The function is of limited use and is an almost a direct clone of
memmove/memcpy (with arguments swapped). Introduction of ERMS variants
of string routines would mean avoidable growth of libc.

bcopy will get redefined to a __builtin_memmove later on with this
symbol only left for compatibility.

Reviewed by:	kib
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17539
2018-10-13 21:17:28 +00:00
Mateusz Guzik
1e52ba8c62 amd64: import updated kernel memmove to libc
bcopy is left alone as it is expected to be converted to a C func.

Due to header mess ALIGN_TEXT is temporarily defined explicitly in memmove.S

Reviewed by:	kib
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17538
2018-10-13 21:15:47 +00:00
Yuri Pankov
cbc0062992 strptime: disallow zero hour for %I (defined by POSIX as [01,12]) and %l
(extension, defined in strftime(3) as 1-12).

Approved by:	re (gjb), kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17543
2018-10-13 16:25:28 +00:00
Allan Jude
c452913091 Document that sendfile(2) can return ENOTCAPABLE
PR:		232207
Submitted by:	Enji Cooper <yaneurabeya@gmail.com>
Approved by:	re (rgrimes)
2018-10-13 02:20:16 +00:00
Dag-Erling Smørgrav
0ffba31975 Add libssl to libldns for DANE.
Approved by:	re (gjb)
2018-10-12 05:27:58 +00:00
Mateusz Guzik
f38828cbc7 libmemstat: adjust for per-cpu stats after r338899
Reported by:	yuripv
Reviewed by:	kib, markj
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17490
2018-10-11 23:25:14 +00:00
Mateusz Piotrowski
882764c164 libusb(3): Update the link to the libusb homepage.
While here, pet mandoc & igor.

Reviewed by:	bcr, hselasky
Approved by:	re (kib), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17516
2018-10-11 13:58:51 +00:00
Ed Maste
b371a9f082 lld: set sh_link and sh_info for .rela.plt sections
ELF spec says that for SHT_REL and SHT_RELA sh_link should reference the
associated string table and sh_info should reference the "section to
which the relocation applies."  ELF Tool Chain's elfcopy / strip use
this (in part) to control whether or not the relocation entry is copied
to the output.

LLVM PR 37538 https://bugs.llvm.org/show_bug.cgi?id=37538

Approved by:	re (kib)
Obtained from:	llvm r344226 (backported for 6.0)
2018-10-11 13:19:17 +00:00
Dag-Erling Smørgrav
0eb26fa39c Update Makefile for 1.8.0, apologies for the breakage.
Approved by:	re (kib)
2018-10-10 08:19:11 +00:00
Glen Barber
7c32835287 MFH r338661 through r339253.
Sponsored by:	The FreeBSD Foundation
2018-10-09 14:27:55 +00:00
Konstantin Belousov
92cbfb6395 Disallow zero day of month from strptime("%d").
It is required by POSIX, specified in our man page, and followed by
Linux.

PR:	232072
Reported by:	miguel_tete17@hotmail.com
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
MFC after:	1 week
2018-10-08 18:45:40 +00:00
Glen Barber
fc3f42d80f MFH r339206-r339212, r339215-r339239
Sponsored by:	The FreeBSD Foundation
2018-10-08 18:06:40 +00:00
Mateusz Guzik
167374a162 amd64: import updated kernel memset to libc
See r339205 for details.

An unused ERMS support is retained in the macro. It will be activated
after ifunc support lands.

Reviewed by:    kib
Approved by:    re (gjb)
Sponsored by:   The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17405
2018-10-05 19:27:42 +00:00
Glen Barber
01d4e2149e MFH r338661 through r339200.
Sponsored by:	The FreeBSD Foundation
2018-10-05 17:53:47 +00:00
Ed Maste
2284664ef9 crt: switch to standard note type definitions from elf_common.h
This makes it easier to grep the source tree for these notes, and
ensures that they will remain in sync.

Reviewed by:	kib
Approved by:	re (gjb)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17408
2018-10-04 17:35:32 +00:00
Mateusz Guzik
7e02ad0769 amd64: reimplement libc memset and bzero with kernel memset
This is a depessimization, see r334537 for an explanation. Routines
remain significantly slower than they have to be.

bzero was removed from the kernel but remains in libc. Macroify to
accommodate differences to memset (no return value, always setting to 0).

The bzero.S file is left in place due to libc build magic which pulls in
a C variant if a matching .S file is missing.

Reviewed by:	kib
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D17355
2018-10-01 20:39:17 +00:00
Kyle Evans
0cadc427fd libbe(3): Fix BE activation promoting activated BE
This allows older BEs to be destroyed as they become replaced by a BE
created from them: e.g.

bectl create -e brokenworld fixedworld
bectl activate fixedworld
bectl destroy brokenworld

Submitted by:	Shawn Webb
Approved by:	re (gjb)
Obtained from:	HardenedBSD (5948c0581e)
2018-10-01 14:57:33 +00:00
Ed Maste
ea28e71e86 clang: allow ifunc resolvers to accept arguments
Previously Clang required ifunc resolution functions to take no
arguments, presumably because GCC documented ifunc resolvers as taking
no arguments.  However, GCC accepts resolvers accepting arguments, and
our rtld passes CPU ID information (cpuid, hwcap, etc.) to ifunc
resolvers.  Just remove the check from the in-tree compiler for our in-
tree compiler; a different (per-OS) approach may be required upstream.

Reported by:	mjg
Approved by:	re (rgrimes)
MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-09-29 20:01:23 +00:00
Dimitry Andric
ab530bf0dd Merge ^/head r338988 through r339014. 2018-09-29 15:18:18 +00:00
Dimitry Andric
678769a9fc Add compiler-rt's libFuzzer, not connected to buildworld yet.
For now, the libraries can be built and installed using:

cd /usr/src/lib/libclang_rt/fuzzer && \
  make obj && \
  make depend && \
  make && \
  sudo make install
cd /usr/src/lib/libclang_rt/fuzzer_no_main && \
  make obj && \
  make depend && \
  make && \
  sudo make install

See https://llvm.org/docs/LibFuzzer.html for more information.
2018-09-29 15:17:17 +00:00
Mateusz Guzik
275c893dab amd64: remove unnecessary cld from libc memcpy/bcopy
The ABI specifies the direction forward on function call, making
the cld instruction redundant.

Approved by:	re (kib)
2018-09-29 07:40:52 +00:00
Hans Petter Selasky
2682992483 When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of completion events can stop.
This happens if event threads are created and destroyed during runtime.

Found by:		Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR:			231742
MFC after:		1 week
Approved by:		re (kib)
Sponsored by:		Mellanox Technologies
2018-09-28 10:28:22 +00:00
Dimitry Andric
ce44d80853 Merge ^/head r338731 through r338987. 2018-09-27 20:00:07 +00:00
Mateusz Guzik
5bbde333cd amd64: reimplement libc memcmp and bcmp with kernel memcmp
Both are significantly slower than hand-coded loops. See r338963 for
kernel commit.

bcmp differs from memcmp by always returning 1 when a difference is
found, as opposed to going for a value bigger or lower than 0
depending on what it is. This means it can do less work. For now the
code is duplicated and modified. This will get deduplicated after
another round of optimization when memcmp will get a longer-term form.

Both tested with the glibc suite. While the suite does not have a test
for bcmp, I created a wrapper routine which verified that values match
(0 vs 0, 1 vs non-zero).

Reviewed by:	kib
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17336
2018-09-27 17:08:29 +00:00
Ed Maste
2417a95e02 Move libc linker ifunc test to build target only
Targets like 'cleandir' must not depend on toolchain capabilities.

Reported by:	delphij, Shawn Webb
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-09-24 13:42:46 +00:00
Brad Davis
b8fdf58807 Move hosts.allow to lib/libwrap/
This leverages CONFS to handle the install.

Approved by:	re (blanket, pkgbase), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17240
2018-09-22 13:17:30 +00:00
Ed Maste
35d1666cbb libc: require ifunc-capable linker for amd64/i386
We expect to introduce optimized libc routines in the near future,
which requires use of a linker that supports ifuncs.

Approved by:	re (gjb, kib)
Sponsored by:   The FreeBSD Foundation
2018-09-21 17:49:37 +00:00
Brad Davis
27e35a09ef Move nsmb.conf to lib/libsmb/
This leverages CONFS to do the install

Approved by:	re (pkgbase, blanket), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17243
2018-09-20 09:31:27 +00:00
Brad Davis
6999b78550 Move opieaccess to lib/libopie/
This leverages CONFS to do the install

Approved by:	re (blanket, pkgbase), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17241
2018-09-20 09:26:10 +00:00
Brad Davis
f803ec1ef5 Move regdomain.xml to lib/lib80211/
This leverages CONFS to handle the install.  lib80211 was picked because it is
where this file is actually used from.

Approved by:	re (blanket, pkgbase), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17229
2018-09-19 09:29:06 +00:00
Jung-uk Kim
328bbc11c9 Make libradius(3) buildable. 2018-09-19 07:06:20 +00:00
Jung-uk Kim
07f5430d5c Make libmp(3) buildable. 2018-09-19 07:05:31 +00:00
Jung-uk Kim
3fd49fe2d4 Make libfetch buildable. 2018-09-19 07:04:15 +00:00
Brad Davis
02b69379ea Move libalias.conf to lib/libalias/libalias/
This leveages CONFS to handle the install.

Approved by:	re (blanket, pkgbase), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17218
2018-09-18 20:54:37 +00:00
Brad Davis
b6af74d289 Move mac.conf to lib/libc/posix1e/
This leverages CONFS to handle the install of the config file.

Approved by:	re (blanket, pkgbase), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17162
2018-09-18 01:40:37 +00:00
Brad Davis
34da9e3802 Fix CONFS to append the value in this case.
Approved by:	re (blanket, pkgbase), will (mentor)
2018-09-18 01:38:44 +00:00
Brad Davis
77e4a39103 Move rpc and netconfig to lib/libc/rpc/
This uses relative paths to make it more specific to avoid any potential
future problems with .PATH and leverages CONFS.

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by:	re (gjb), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17163
2018-09-17 19:20:50 +00:00
Dimitry Andric
0a13c83028 Merge ^/head r338690 through r338730. 2018-09-17 19:05:32 +00:00
Dimitry Andric
38fb40102a Merge llvm, clang, lld, lldb, compiler-rt and libc++ 7.0.0 release
r342383, and bump version numbers.

PR:		230240, 230355
2018-09-17 19:04:15 +00:00
Brad Davis
03452a498c Move hosts, hosts.equiv, networks, nsswitch.conf, protocols to lib/libc/net/
This uses relative paths to make it more specific to avoid any potential
future problems with .PATH and leverages CONFS.

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by:	re (gjb), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17164
2018-09-17 18:56:47 +00:00
Dimitry Andric
f10971f5ff Vendor import of clang 7.0.0 release r342383:
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final@342383
2018-09-17 15:52:57 +00:00
Mateusz Guzik
23ec0d58bf amd64: depessimize userspace memcpy/memmove/bcopy
The change resembles what was done in r334537 for kernel routines.
While here take care of i386 variants. Note that primitives remain
suboptimal.

Reviewed by:	kib (previous version)
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D17167
2018-09-17 15:49:35 +00:00
Dimitry Andric
c0b5e99154 Merge ^/head r338595 through r338689, and resolve conflicts. 2018-09-14 19:50:36 +00:00
Hans Petter Selasky
5b21ba5c5d Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by:		Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR:			231264
MFC after:		1 week
Approved by:		re (kib)
Sponsored by:		Mellanox Technologies
2018-09-14 13:41:37 +00:00
Matt Macy
0204d85a62 hwpmc: set default rate if event description lacks one / filter rate against misuse
Not all event descriptions have a sample rate (such as inst_retired.any)
this will restore the legacy behavior of using 65536 in that case. It also
prevents accidental API misuse that could lead to panic.

PR:	230985
Reported by:	markj
Reviewed by:	markj
Approved by:	re (gjb)
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D16958
2018-09-14 01:30:05 +00:00
Matt Macy
3b9156971f re-enable pmcstat, pmccontrol, and pmcannotate for gcc4 builds
I had disabled building of the aforementioned targets due to warnings breaking
tinderbox. This silences the warning and restores them to the build.

Reported by:	jhibbits
Reviewed by:	jhibbits
Approved by:	re (gjb)
2018-09-14 01:11:10 +00:00
Brad Davis
becaaa9be9 Really fix pam install. Don't commit late at night or you make simple mistakes.
Reported by:	dumbbell
Approved by:	re (gjb), will (mentor)
2018-09-13 16:14:33 +00:00
Brad Davis
aad4d67d9c Fix build after r338621 by avoiding LINKS and installing the link manually.
Approved by:	re (rgrimes), will (mentor)
2018-09-13 07:48:49 +00:00
Brad Davis
219cf81b4d Move all pam related config to lib/libpam/
Approved by:	re (rgrimes), will (mentor), des
Differential Revision:	https://reviews.freebsd.org/D17122
2018-09-13 04:08:48 +00:00
Hans Petter Selasky
540c72297d Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by:		Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR:			231076
MFC after:		1 week
Approved by:		re (gjb)
Sponsored by:		Mellanox Technologies
2018-09-12 15:06:30 +00:00
Dimitry Andric
c826f0db60 Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch
r341916, resolve conflicts, and bump version numbers.

PR:		230240, 230355
2018-09-11 18:50:40 +00:00
Dimitry Andric
3af64f0311 Merge ^/head r338392 through r338594. 2018-09-11 18:41:00 +00:00
Dimitry Andric
af0fec7cd3 Vendor import of lld release_70 branch r341916:
https://llvm.org/svn/llvm-project/lld/branches/release_70@341916
2018-09-11 10:10:16 +00:00
Dimitry Andric
d2f57ad522 Vendor import of compiler-rt release_70 branch r341916:
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_70@341916
2018-09-11 10:10:03 +00:00
Dimitry Andric
71bf09e840 Vendor import of clang release_70 branch r341916:
https://llvm.org/svn/llvm-project/cfe/branches/release_70@341916
2018-09-11 10:09:57 +00:00
Dimitry Andric
36272db3ca Vendor import of llvm release_70 branch r341916:
https://llvm.org/svn/llvm-project/llvm/branches/release_70@341916
2018-09-11 10:09:45 +00:00
Dag-Erling Smørgrav
3bd4df0a68 Upgrade Unbound to 1.7.2. More to follow.
Approved by:	re (kib@)
2018-09-10 16:56:44 +00:00
Dag-Erling Smørgrav
190cef3d52 Upgrade to OpenSSH 7.8p1.
Approved by:	re (kib@)
2018-09-10 16:20:12 +00:00
Ben Woods
e45068e3c9 geli init with multiple providers - fix init and fix -B "none"
Apply some fixes post rS336659, which allowed multiple provders to be
initialized in a single command.
- Fix issue where second and subsequent providers would fail init.
  This was due to the metadata struct being zeroed after the first
  provider init was completed, despite containing common data required
  for subsequent providers.
- Fix issue where -B "none" would still result in the metadata being
  backed-up if multiple providers had been specified. This was due to
  the backupfile of "none" being incorrectly made unique for each
  provider by appending "-<prov>".

Approved by:	asomers
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D17096
2018-09-10 14:50:34 +00:00
John Baldwin
6a9648b537 bhyve: Use MAP_GUARD when mapping guest memory ranges.
Instead of relying on PROT_NONE mappings with MAP_ANON, use MAP_GUARD
to reserve address space around guest memory ranges including the
guard ranges of address space around mappings.

Submitted by:	Shawn Webb
Reviewed by:	araujo
Approved by:	re (rgrimes)
MFC after:	1 month
Sponsored by:	HardendBSD and G2, Inc
Differential Revision:	https://reviews.freebsd.org/D16822
2018-09-06 20:29:40 +00:00
John Baldwin
9f45c6c124 Add gelf_mips64el.c to the list of files to include in libelf.
Missed in r338478.

Pointy hat to:	jhb
Approved by:	re (rgrimes)
MFC after:	1 month
2018-09-05 21:47:22 +00:00
Dag-Erling Smørgrav
e165d7bc39 For full Linux-PAM compatibility, add a trailing NUL character when
passing the authentication token to the external program.

Approved by:	re (kib)
Submitted by:	Thomas Munro <munro@ip9.org>
MFC after:	1 week
Differential Revision:	D16950
2018-09-04 10:51:41 +00:00
Kyle Evans
162ec56949 libbe(3): Fix error handling with respect to be_exists
Some paths through be_exists will set the error state, others will not
There are multiple reasons that a call can fail, so clean it up a bit: all
paths now return an appropriate error code so the caller can attempt to
distinguish between a BE legitimately not existing and just having the wrong
mountpoint. The caller is expected to bubble the error through to the
internal error handler as needed.

This fixes some unfriendliness with bectl(8)'s activate subcommand, where
it might fail due to a bad mountpoint but the only message output is a
generic "failed to activate" message.

Approved by:	re (gjb)
2018-09-01 02:22:26 +00:00
Dimitry Andric
da2d1e9d25 Merge ^/head r338298 through r338391. 2018-08-29 20:54:56 +00:00
Dimitry Andric
8ba00cf9b7 Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch
r340910, resolve conflicts, and bump version numbers.

PR:		230240, 230355
2018-08-29 20:53:24 +00:00
Dimitry Andric
d6ad2d02b6 Vendor import of compiler-rt release_70 branch r340910:
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_70@340910
2018-08-29 17:50:55 +00:00
Dimitry Andric
fe208f5606 Vendor import of clang release_70 branch r340910:
https://llvm.org/svn/llvm-project/cfe/branches/release_70@340910
2018-08-29 17:50:47 +00:00
Dimitry Andric
8568f9cb5a Vendor import of llvm release_70 branch r340910:
https://llvm.org/svn/llvm-project/llvm/branches/release_70@340910
2018-08-29 17:50:33 +00:00
Sean Bruno
01a9c32322 r338270 had the side effect of no longer installing libmd.so into /lib.
For users who have a seperate zfs mount of /usr or /usr/lib, this will
cause dynamic loading failures when attempting to execute zfs mount on
bootup. E.g. the system won't boot.

Including <src.opts.mk> sets SHLIBDIR, so SHLIBDIR?= has no
effect.  The other lib/ Makefiles solve this problem by moving the
SHLIBDIR  assignment to before .include <src.opts.mk>.

Submitted by:	jilles
Reviewed by:	allanjude
Approved by:	re (rgrimes)
Differential Revision:	https://reviews.freebsd.org/D16910
2018-08-26 17:05:43 +00:00
Kyle Evans
8369ba427a libbe(3)/bectl(8): Make consistent with beadm
vermaden (maintainer of beadm) points out the following inconsistencies:
- "missing command" is not printed prior to usage if the error is simply a
   missing command; this should be obvious from the context
- "bectl rename" isn't using the "don't unmount" flag (zfs rename -u), so
   the active BE can't be renamed. It doesn't make sense in our context to
   *not* use -u, so use it.

Documentation updates reflect the above and note an inconsistency with the
'destroy' command that is consistent with other parts of the base system.

A fix for libbe(3) not properly being installed to /lib is included.
SHLIBDIR should have been added when it was moved in r337995.

Approved by:	re (kib)
2018-08-24 20:44:58 +00:00
Dimitry Andric
7847e04111 Merge ^/head r338026 through r338297, and resolve conflicts. 2018-08-24 18:09:23 +00:00
Alex Richardson
c91575ceec Don't build skein_block_asm.s if we don't have an as binary
This fixes building libmd on MacOS/Linux. The real fix is probably to
build it as a .S file with $CC instead. It might also be better to just
compile the C file in userspace since the compiler can the use SSE/AVX.

Reviewed By:	emaste, brooks
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16844
2018-08-23 18:19:33 +00:00
Warner Losh
2324e9b028 Forgot to bump .Dd in r338233 like I promised in the review. Doh! 2018-08-23 05:08:38 +00:00
Warner Losh
5fa2979791 Create devctl freeze/thaw.
This adds it to devctl, libdevctl, defines the two IOCTLs and
implements the kernel bits. causes any new drivers that are added via
kldload to be deferred until a 'thaw' comes in. These do not stack: it
is an error to freeze while frozen, or thaw while thawed.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:05:47 +00:00
Alex Richardson
24c14ab87e Stop using unifdef to generate bsdxml.h
The current invocation of unifdef causes the build to fail when using a shell
with -o pipefail on by default since unifdef will return a non-zero exit status
if it changes something. The only thing this call to unifdef does is remove 5
lines that will be ignored by the compiler anyway. Furthermore, it is the only
make rule in the source tree that requires unifdef. Removing this call also
makes it slightly easier to build without inhering $PATH (D16815) since we
don't need unifdef anymore.

I also noticed that the sed call to replace the include guard has been broken
for over 10 years since the import of expat 2.0.1 changed it from
`XmlParse_INCLUDED` to `Expat_INCLUDED`. I could also fix this but since it's
been broken for so long and no one noticed, it's probably not necessary.

Reviewed By:	emaste
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14317
2018-08-22 11:56:42 +00:00
Brad Davis
c8e7055577 Move all bluetooth related config files out of etc
This helps with pkgbase by switching to CONFS so they are properly tagged as
config files.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16833
2018-08-21 19:28:53 +00:00
Michael Tuexen
6b01d4d433 Add SOL_SOCKET level socket option with name SO_DOMAIN to get
the domain of a socket.

This is helpful when testing and Solaris and Linux have the same
socket option using the same name.

Reviewed by:		bcr@, rrs@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D16791
2018-08-21 14:04:30 +00:00
Pedro F. Giffuni
ab82c6bdad libthr: minor spacing cleanup.
No functional change.

X-MFC with:	r337992
2018-08-21 01:33:25 +00:00
Alex Richardson
23ff19c627 Don't rebuild ioctl.c and relink libsysdecode if there are no changes
Instead generate a temporary file and only overwrite ioctl.c if the
files are actually different.

Approved By:	jhb (mentor)
2018-08-20 10:59:49 +00:00
Alex Richardson
078018e0ac Allow bootstrapping libmd on MacOS
The assembly files use directives that only work for ELF targets so skip
them when bootstrapping on MacOS.

Reviewed By:	imp
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14247
2018-08-20 10:39:48 +00:00
Alex Richardson
ec45ce6222 Make mkioctls script work on Linux and MacOS
Using find -s  will not work with the Linux or MacOS find command. We pipe
to sort instead since the only real requirement here is that the order
stays the same. While I am touching this file I also fixed a `==` construct
which is not supported by POSIX sh but appears to work on FreeBSD.

Reviewed By:	imp
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D14246
2018-08-20 10:39:37 +00:00
Xin LI
59488f25ad In r331279 the code used ENOSYS to check the existence of getrandom(2).
This will only work if the caller already handles SIGSYS, which is not
always the case.

Address this by checking osreldate instead. Note that because there
was not __FreeBSD_version bump when the system call was added, use
1200061 (r332100) which is the first bump after the introduction of
the system call.

PR:		230762
Reported by:	Jenkins via Mark Millard
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D16807
2018-08-20 02:17:55 +00:00
Mateusz Piotrowski
c8b8b38e5f Document socket control message routines for ancillary data access (CMSG_DATA).
PR:		227777
Reviewed by:	bcr, eadler
Approved by:	mat (mentor), manpages (bcr)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D15215
2018-08-19 17:42:49 +00:00
Xin LI
c1e80940f3 Update userland arc4random() with OpenBSD's Chacha20 based arc4random().
ObsoleteFiles.inc:

    Remove manual pages for arc4random_addrandom(3) and
    arc4random_stir(3).

  contrib/ntp/lib/isc/random.c:
  contrib/ntp/sntp/libevent/evutil_rand.c:

    Eliminate in-tree usage of arc4random_addrandom().

  crypto/heimdal/lib/roken/rand.c:
  crypto/openssh/config.h:

    Eliminate in-tree usage of arc4random_stir().

  include/stdlib.h:

    Remove arc4random_stir() and arc4random_addrandom() prototypes,
    provide temporary shims for transistion period.

  lib/libc/gen/Makefile.inc:

    Hook arc4random-compat.c to build, add hint for Chacha20 source for
    kernel, and remove arc4random_addrandom(3) and arc4random_stir(3)
    links.

  lib/libc/gen/arc4random.c:

    Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the
    sys/crypto/chacha20 implementation of keystream.

  lib/libc/gen/Symbol.map:

    Remove arc4random_stir and arc4random_addrandom interfaces.

  lib/libc/gen/arc4random.h:

    Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own.

  lib/libc/gen/arc4random.3:

    Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and
    r118247.

  lib/libc/gen/arc4random-compat.c:

    Compatibility shims for arc4random_stir and arc4random_addrandom
    functions to preserve ABI.  Log once when called but do nothing
    otherwise.

  lib/libc/gen/getentropy.c:
  lib/libc/include/libc_private.h:

    Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl).
    Remove from libc_private.h as a result.

  sys/crypto/chacha20/chacha.c:
  sys/crypto/chacha20/chacha.h:

    Make it possible to use the kernel implementation in libc.

PR:		182610
Reviewed by:	cem, markm
Obtained from:	OpenBSD
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16760
2018-08-19 17:40:50 +00:00
Konstantin Belousov
540cc17f7b Provide set_constraint_handler_s(3) man page.
Mention abort_handler_s(3) and ignore_handler_s(3), provide
cross-reference from memset(3).

Submitted by:	Yuri Pankov <yuripv@yuripv.net>
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D16797
2018-08-19 14:39:57 +00:00
Konstantin Belousov
759a4bc697 Clarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.
Fix typos and other nits.

Submitted by:	Yuri Pankov <yuripv@yuripv.net>
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D16797
2018-08-19 14:25:28 +00:00
Konstantin Belousov
d3ee476315 Use tab for indent.
Submitted by:	Yuri Pankov <yuripv@yuripv.net>
MFC after:	3 days
2018-08-19 14:22:45 +00:00
Dimitry Andric
3611ec6048 Merge ^/head r337646 through r338014. 2018-08-18 12:15:54 +00:00
Dimitry Andric
7726714dff Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch
r339999, resolve conflicts, and bump version numbers.

PR:		230240,230355
2018-08-18 12:11:17 +00:00
Xin LI
52809cc35b Workaround ECAPMODE for kernels between revision [331280, 337999)
where getrandom(2) is not available in capability mode.
2018-08-18 08:32:21 +00:00
Dimitry Andric
5a4cb1eb0c Vendor import of clang release_70 branch r339999:
https://llvm.org/svn/llvm-project/cfe/branches/release_70@339999
2018-08-18 08:26:59 +00:00
Dimitry Andric
d0a9cbdae1 Vendor import of llvm release_70 branch r339999:
https://llvm.org/svn/llvm-project/llvm/branches/release_70@339999
2018-08-18 08:26:46 +00:00
Xin LI
718863d076 Split arc4random_uniform into it's own file and sync with OpenBSD.
PR:		182610
Obtained from:	OpenBSD
MFC after:	2 weeks
2018-08-18 06:20:45 +00:00
Kyle Evans
7920ad944b libbe(3): Move build goop back out of cddl/
Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.
2018-08-18 03:20:59 +00:00
Pedro F. Giffuni
b6413b6db8 POSIX compliance improvements in the pthread(3) functions.
This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018.

Hinted by:	DragonFlyBSD

Relnotes:	yes
MFC after:	1 month
Differential Revision:	D16722
2018-08-18 01:05:38 +00:00