aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Update Makefile.depend filesSimon J. Gerraty2019-12-11118-107/+401
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-118-0/+62
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* Add a few missed source files to libllvm, for the MK_LLVM_TARGET_BPF=yesDimitry Andric2019-12-101-0/+2
| | | | | | | | | | | | case. Otherwise, linking of clang and other llvm based executables would complain about missing symbols. Reported by: rstone MFC after: 1 month X-MFC-With: r353358 Notes: svn path=/head/; revision=355602
* [PPC64] Initial libkvm minidump implementationLeandro Lupori2019-12-094-0/+950
| | | | | | | | | | | | | This change adds PowerPC64 support for minidumps on libkvm. Address translation, page walk, and data retrieval were tested and seem to be working correctly. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21555 Notes: svn path=/head/; revision=355557
* Add additional sanity checks.Warner Losh2019-12-091-0/+9
| | | | Notes: svn path=/head/; revision=355546
* Define a vm_map method for user-space for advancing from a map entryDoug Moore2019-12-081-12/+16
| | | | | | | | | | | | | | to its successor in cases where examining a map entry requires a helper like kvm_read_all. Use that method, with kvm_read_all, to fix procstat_getfiles_kvm, which tries to find the successor now without using such a helper. This addresses a problem introduced by r355491. Reviewed by: markj (previous version) Discussed with: kib Differential Revision: https://reviews.freebsd.org/D22728 Notes: svn path=/head/; revision=355538
* Fix a type error in fixing libprocstat to be compatible with vm_map changes.Doug Moore2019-12-071-1/+1
| | | | | | | | Approved by: markj Differential Revision: https://reviews.freebsd.org/D22726 Notes: svn path=/head/; revision=355502
* r355491 broke compilation of libprocstat.c. Change that code to useDoug Moore2019-12-071-2/+2
| | | | | | | | | | new methods for accessing first, next map entries. Approved by: kib Differential Revision: https://reviews.freebsd.org/D22725 Notes: svn path=/head/; revision=355501
* Only return EPERM from kill(-pid) when no process was signalled.Konstantin Belousov2019-12-071-5/+4
| | | | | | | | | | | | | | | | | As mandated by POSIX. Also clarify the kill(2) manpage. While there, restructure the code in killpg1() to use helper which keeps overall state of the process list iteration in the killpg1_ctx structued, later used to infer the error returned. Reported by: amdmi3 Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D22621 Notes: svn path=/head/; revision=355500
* clock_gettime(2): add a HISTORY sectionAlan Somers2019-12-071-1/+9
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=355489
* lio_listio(2): add a HISTORY sectionAlan Somers2019-12-071-1/+6
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=355488
* libbe: fix build against sysutils/openzfs, part 1Kyle Evans2019-12-063-1/+8
| | | | | | | | | | | | This is the half of the changes required that work as-is with both in-tree ZFS and the new hotness, sysutils/openzfs. Highlights are less dependency on header pollution (from somewhere) and using 'mnttab' instead of 'extmnttab'. In the in-tree ZFS, the latter is a #define for the former, but in the port extmnttab is actually a distinct struct that's a super-set of mnttab. We really want mnttab here anyways, so just use it. Notes: svn path=/head/; revision=355460
* Update ELF Tool Chain to upstream r3769Ed Maste2019-12-051-1/+1
| | | | | | | | | This contains many small bugfixes and documentation improvements. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355413
* Use "far" calls and branches so that lld uses valid relocations.John Baldwin2019-12-042-6/+10
| | | | | | | | | | | | | | Conditional branch and jump instructions do not always call via PLT stubs and thus will not honor LD_PRELOAD, etc. lld warns about using non-preemptible relocations for preemptible or unknown symbols whereas bfd does not (at least for RISC-V). Reviewed by: br, James Clarke Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22658 Notes: svn path=/head/; revision=355403
* Use a single 'ld' to read the jmpbuf magic values instead of 'la; ld'.John Baldwin2019-12-042-8/+4
| | | | | | | | | | | | This saves an instruction in each case as well as an extra memory indirection via the GOT for PIC code. Reviewed by: br, James Clarke Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22656 Notes: svn path=/head/; revision=355402
* Define __SOFT_FP__ for riscv64sf to avoid infinite recursion.John Baldwin2019-12-041-0/+4
| | | | | | | | | | Submitted by: James Clarke <jrtc27@jrtc27.com> Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22660 Notes: svn path=/head/; revision=355401
* Regularize my copyright noticeWarner Losh2019-12-0410-13/+3
| | | | | | | | | | | | o Remove All Rights Reserved from my notices o imp@FreeBSD.org everywhere o regularize punctiation, eliminate date ranges o Make sure that it's clear that I don't claim All Rights reserved by listing All Rights Reserved on same line as other copyright holders (but not me). Other such holders are also listed last where it's clear. Notes: svn path=/head/; revision=355394
* devstat_selectdevs: resize dev_select only after copying data out of itAndriy Gapon2019-12-031-2/+7
| | | | | | | | | | | The resizing could be a downsizing so some data would be lost and we could attempt to read past the end of the new memory allocation. MFC after: 2 weeks Sponsored by: Panzura Notes: svn path=/head/; revision=355325
* Make use of the stats(3) framework in the TCP stack.Edward Tomasz Napierala2019-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to retrieve per-connection statistical information such as the receive window size, RTT, or goodput, using a newly added TCP_STATS getsockopt(3) option, and extract them using the stats_voistat_fetch(3) API. See the net/tcprtt port for an example consumer of this API. Compared to the existing TCP_INFO system, the main differences are that this mechanism is easy to extend without breaking ABI, and provides statistical information instead of raw "snapshots" of values at a given point in time. stats(3) is more generic and can be used in both userland and the kernel. Reviewed by: thj Tested by: thj Obtained from: Netflix Relnotes: yes Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D20655 Notes: svn path=/head/; revision=355304
* The fdlibm hypot() implementations shouldn't potentially left-shiftDimitry Andric2019-11-262-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | negative numbers (invoking undefined behavior) Summary: Various paths through hypot(x, y) will multiply x and y by a power of two, perform the calculation in a range where IEEE-754 provides greater precision, then undo the multiplication to determine the true result. Undoing that multiplication is implemented as t1*w, where t1=2**k. 2**k is often computed by taking the high word of 1.0, then adding k<<20 (for doubles or long doubles) or k<<23 (for floats) to it, then overwriting that high word. But when k is negative this left-shifts a negative value -- and that's undefined behavior in many editions of C and C++. This patch should fix all hypot implementations to compute 2**k without triggering this particular bit of undefined behavior. Test Plan: I've only very lightly tested out the hypot(double, double) change, in SpiderMonkey's JavaScript engine, for consistency with prior behavior. The other functions' changes have more or less only been eyeballed. Careful examination appreciated! Do note, however, that an error in any of these changes would most likely produce a value that is incorrect by a factor of two, so any mistake would most likely be glaring if invoked. Submitted by: Jeff Walden <jwalden@mit.edu> Obtained from: https://github.com/freebsd/freebsd/pull/414 Reviewed by: dim, lwhsu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22354 Notes: svn path=/head/; revision=355120
* MFV r355071: libbsdxml (expat) 2.2.9.Xin LI2019-11-252-17/+23
|\ | | | | | | | | | | | | | | MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=355085
| * Vendor import of expat 2.2.9Xin LI2019-11-2419-4704/+4006
| | | | | | | | Notes: svn path=/vendor/expat/dist/; revision=355071
* | [PowerPC] Fix typo in _ctx_start on ppc32Brandon Bergren2019-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Theoretically, this was breaking the size calculation for the symbol. Noticed when doing a readthrough. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22525 Notes: svn path=/head/; revision=355036
* | libclang_rt: enable on powerpc*Dimitry Andric2019-11-232-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable on powerpc64 and in lib/libclang_rt/Makefile change MACHINE_CPUARCH to MACHINE_ARCH because on powerpc64 MACHINE_ARCH==MACHINE_CPUARCH so the 32-bit library overwrites 64-bit library during installworld. This patch doesn't enable any other libclang_rt libraries because they need to be separately ported. I have verified that games/julius (which fails on powerpc64 elfv2 without this change because of no libclang_rt profiling library) builds. Test Plan: Ship it, test on powerpc and powerpcspe Submitted by: pkubaj Reviewed by: dim, jhibbits Differential Revision: https://reviews.freebsd.org/D22425 MFC after: 1 month X-MFC-With: r353358 Notes: svn path=/head/; revision=355034
* | Fix typos in the cpuset_{get,set}domain() man page.Mark Johnston2019-11-221-3/+5
| | | | | | | | | | | | | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355000
* | Add explanatory comments for the different SRCS_xxx variables used inDimitry Andric2019-11-203-1/+17
| | | | | | | | | | | | | | | | | | | | the Makefiles for libllvm and libclang. While here, cleanup a commented out SRCS entry in libllvmminimal's Makefile. MFC after: 3 days Notes: svn path=/head/; revision=354908
* | Fix grammar in gpart.8.Mark Johnston2019-11-181-1/+1
| | | | | | | | | | | | | | | | PR: 241973 MFC after: 3 days Notes: svn path=/head/; revision=354824
* | Document required size of buffer for elf_aux_info(3).Konstantin Belousov2019-11-171-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | PR: 241884 Reported by: jbeich Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D22380 Notes: svn path=/head/; revision=354787
* | [PowerPC] Fix *context on ELFv2Brandon Bergren2019-11-162-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Due to ELFv1 specific code in _ctx_start.S and makecontext.c, userspace context switching was completely broken on ELFv2. With this change, we now pass the libthr test suite. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D22421 Notes: svn path=/head/; revision=354780
* | armv6 soft float build fixedWarner Losh2019-11-143-5/+5
| | | | | | | | | | | | | | | | | | | | | | Add ifdefs in the assembler for soft-float compile case. Submitted by: Hiroki Mori Reviewed by: ray@ Differential Review: https://reviews.freebsd.org/D22352 Notes: svn path=/head/; revision=354700
* | Improve the description of AT_EXECPATH availability.Brooks Davis2019-11-131-2/+3
| | | | | | | | | | | | | | | | Reported by: kib Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=354699
* | elf_aux_info: Add support for AT_EXECPATH.Brooks Davis2019-11-132-2/+22
| | | | | | | | | | | | | | | | | | | | Reviewed by: emaste, sef MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22353 Notes: svn path=/head/; revision=354694
* | ssp: further refine the conditional used for constructor priorityKyle Evans2019-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | __has_attribute(__constructor__) is a better test for clang than defined(__clang__). Switch to it instead. While we're already here and touching it, pfg@ nailed down when GCC actually introduced the priority argument -- 4.3. Use that instead of our hammer-guess of GCC >= 5 for the sake of correctness. Notes: svn path=/head/; revision=354689
* | ssp: rework the logic to use priority=200 on clang buildsKyle Evans2019-11-131-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The preproc logic was added at the last minute to appease GCC 4.2, and kevans@ did clearly not go back and double-check that the logic worked out for clang builds to use the new variant. It turns out that clang defines __GNUC__ == 4. Flip it around and check __clang__ as well, leaving a note to remove it later. Reported by: cem Notes: svn path=/head/; revision=354672
* | ssp: add a priority to the __stack_chk_guard constructorKyle Evans2019-11-131-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this commit is a NOP on GCC <= 4.x; this decidedly doesn't work cleanly on GCC 4.2, and it will be gone soon anyways so I chose not to dump time into figuring out if there's a way to make it work. xtoolchain-gcc, clocking in as GCC6, can cope with it just fine and later versions are also generally ok with the syntax. I suspect very few users are running GCC4.2 built worlds and also experiencing potential fallout from the status quo. For dynamically linked applications, this change also means very little. rtld will run libc ctors before most others, so the situation is approximately a NOP for these as well. The real cause for this change is statically linked applications doing almost questionable things in their constructors. qemu-user-static, for instance, creates a thread in a global constructor for their async rcu callbacks. In general, this works in other places- - On OpenBSD, __stack_chk_guard is stored in an .openbsd.randomdata section that's initialized by the kernel in the static case, or ld.so in the dynamic case - On Linux, __stack_chk_guard is apparently stored in TLS and such a problem is circumvented there because the value is presumed stable in the new thread. On FreeBSD, the rcu thread creation ctor and __guard_setup are both unmarked priority. qemu-user-static spins up the rcu thread prior to __guard_setup which starts making function calls- some of these are sprinkled with the canary. In the middle of one of these functions, __guard_setup is invoked in the main thread and __stack_chk_guard changes- qemu-user-static is promptly terminated for an SSP violation that didn't actually happen. This is not an all-too-common problem. We circumvent it here by giving the __stack_chk_guard constructor a solid priority. 200 was chosen because that gives static applications ample range (down to 101) for working around it if they really need to. I suspect most applications will "just work" as expected- the default/non-prioritized flavor of __constructor__ functions run last, and the canary is generally not expected to change as of this point at the very least. This took approximately three weeks of spare time debugging to pin down. PR: 241905 Notes: svn path=/head/; revision=354669
* | Sync target triple generation with the version in Makefile.inc1.John Baldwin2019-11-121-2/+2
| | | | | | | | | | | | | | | | | | Reviewed by: dim Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22333 Notes: svn path=/head/; revision=354662
* | Revert r354605: Update jemalloc to version 5.2.1.Jason Evans2019-11-111-3/+2
| | | | | | | | | | | | | | Compilation fails for non-llvm-based platforms. Notes: svn path=/head/; revision=354606
* | Update jemalloc to version 5.2.1.Jason Evans2019-11-111-2/+3
| | | | | | | | Notes: svn path=/head/; revision=354605
* | MFV r354582: file 5.37.Xin LI2019-11-102-25/+13
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=354595
* | Update the copy_file_range man page to reflect the semantic changeRick Macklem2019-11-101-1/+14
| | | | | | | | | | | | | | | | | | done by r354574. This is a content change. Notes: svn path=/head/; revision=354575
* | libipsec: correct a typoBjoern A. Zeeb2019-11-092-2/+2
| | | | | | | | | | | | | | | | | | | | Correct a typo in the ipsec_errlist and replicated in a comment. No functional changes. MFC after: 3 weeks Notes: svn path=/head/; revision=354572
* | Update the copy_file_range.2 man page to reflect the semantic changeRick Macklem2019-11-081-8/+9
| | | | | | | | | | | | | | | | | | implemented by r354564. This is a content change. Notes: svn path=/head/; revision=354565
* | libpmc: Forgot regex.hEmmanuel Vadot2019-11-081-0/+1
| | | | | | | | | | | | | | | | | | Reported by: ci MFC after: 1 week X-MFC-With: r354549 Notes: svn path=/head/; revision=354550
* | libpmc: Match on the cpuid with a regexEmmanuel Vadot2019-11-081-4/+18
| | | | | | | | | | | | | | | | | | | | | | The CPUID is, or can be, a regex to be matched. Use regex from libc instead of strcmp Tested-by: gallatin MFC after: 1 week Notes: svn path=/head/; revision=354549
* | kvm: fix types for cross-debuggingEd Maste2019-11-082-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with other libkvm interfaces use maximum-sized types to support cross-debugging (e.g. a 64-bit vmcore on a 32-bit host). See https://lists.freebsd.org/pipermail/svn-src-all/2019-February/176051.html for further discussion. This is an API-breaking change, but there are few consumers of this interface today. Reviewed by: will Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21945 Notes: svn path=/head/; revision=354543
* | csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archsKyle Evans2019-11-081-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as we're still getting .jcr sections added -- presumably due to the reference in crtbegin. Without this terminal, the .jcr section (without data) overlaps with the next section and register_classes in crtbegin will be examining the wrong item. PR: 241439 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D22132 Notes: svn path=/head/; revision=354541
* | Get the fix in back by reverting the part accidentally included in r354491.Li-Wen Hsu2019-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | This brings back r354467. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354520
* | libcompat: build 32-bit rtld and ldd as part of "everything"Brooks Davis2019-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included directly so MD paths in Makefiles work. In the process centralize setting them in LIBCOMPATWMAKEENV. Alter .PATH and CFLAGS settings in work when the Makefile is included. While here only support LIB32 on supported platforms rather than always enabling it and requiring users of MK_LIB32 to filter based TARGET/MACHINE_ARCH. The net effect of this change is to make Makefile.libcompat only build compatability libraries. Changes relative to r354449: Correct detection of the compiler type when bsd.compat.mk is used outside Makefile.libcompat. Previously it always matched the clang case. Set LDFLAGS including the linker emulation for mips where -m32 seems to be insufficent. Reviewed by: imp, kib (origional version in r354449) Obtained from: CheriBSD (conceptually) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22251 Notes: svn path=/head/; revision=354491
* | Fix declaration of S1 by swapping misplaced ',' and ';'.Brooks Davis2019-11-071-2/+2
| | | | | | | | | | | | | | | | | | Reported by: kargl Obtained from: OpenBSD (tb@openbsd.org) MFC after: 1 week Notes: svn path=/head/; revision=354467
* | Revert change accidentally included in r354465.Brooks Davis2019-11-071-2/+2
| | | | | | | | | | | | | | Will recommit with a proper commit message shortly. Notes: svn path=/head/; revision=354466