aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* msun: ctanh/ctanhf: Import fix from musl libcAlex Richardson2021-02-153-19/+14
| | | | | | | | | | | | | | | | | | | This applies musl commit b02eed9c4841913d690a2d0029737d72615384fe by Szabolcs Nagy and updates the tests accordingly. This also allows removing an XFAIL from the test. musl commit message: complex: fix ctanh(+-0+i*nan) and ctanh(+-0+-i*inf) These cases were incorrect in C11 as described by http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1886.htm PR: 217528 Reviewed By: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28578
* libpmc: fix linking with C programsAlan Somers2021-02-151-0/+1
| | | | | | | | | | | Revision r334749 Added some C++ code to libpmc. It didn't change the ABI, but it did introduce a dependency on libc++. Nobody noticed because every program that in the base system that uses libpmc is also C++. Reported-by: Dom Dwyer <dom@itsallbroken.com> Reviewed By: vangyzen MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28550
* Improve size readability.Michael Reifenberger2021-02-151-3/+2
| | | | | | | | | | | Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496
* getdirentries.2: fix for NFS mountsRick Macklem2021-02-151-6/+8
| | | | | | | | | | | | | | | | | | | | It was reported that getdirentries(2) was returning dirents with d_off set to 0 for an NFS mount. This is believed to be correct behaviour at this time (it may change for some NFS mounts in the future), but is inconsistent with what the getdirentries(2) man page says. This patch fixes the man page. This is a content change. PR: 253428 Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28664
* usleep(3): replace 'process' with 'calling thread'Konstantin Belousov2021-02-111-5/+5
| | | | | | | PR: 253395 Reported by: zegang.luo@qq.com MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Fix incorrect hypotl(3) result with subnormal numbersDimitry Andric2021-02-102-1/+2
| | | | | | | | | | | This adjusts the factor used to scale the subnormal numbers, so it becomes the right value after adjusting its exponent. Thanks to Steve Kargl for finding the most elegant fix. Also enable the hypot tests, and add a test case for this bug. PR: 253313 MFC after: 1 week
* Always build the sanitizer runtimes when compiling with clangAlex Richardson2021-02-101-1/+1
| | | | | | | | | | This allows instrumenting e.g. test binaries even when compiling with an external clang (e.g. CROSS_TOOLCHAIN=llvm11). I have some upcoming patches that allow building the entire base system with ASan/UBSan/etc. instrumentation and this is required in preparation for this. Reviewed By: dim, emaste Differential Revision: https://reviews.freebsd.org/D28532
* libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIGMichael Tuexen2021-02-091-1/+1
| | | | | | | | | | TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. MFC after: 3 days Sponsored by: Netflix, Inc.
* Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10Dimitry Andric2021-02-094-6/+3
| | | | | | | | | | This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 MFC after: 3 days
* Revert "SO_RERROR indicates that receive buffer overflows should be handled ↵Alexander V. Chernikov2021-02-081-9/+1
| | | | | | | | as errors." Wrong version of the change was pushed inadvertenly. This reverts commit 4a01b854ca5c2e5124958363b3326708b913af71.
* SO_RERROR indicates that receive buffer overflows should be handled as errors.Alexander V. Chernikov2021-02-081-1/+9
| | | | | | | | | | | | Historically receive buffer overflows have been ignored and programs could not tell if they missed messages or messages had been truncated because of overflows. Since programs historically do not expect to get receive overflow errors, this behavior is not the default. This is really really important for programs that use route(4) to keep in sync with the system. If we loose a message then we need to reload the full system state, otherwise the behaviour from that point is undefined and can lead to chasing bogus bug reports.
* Fix incorrect powf(3) result with x near 1 and |y| much larger than 1Steve Kargl2021-02-081-1/+1
| | | | | | | | | | This adjusts the check to trigger overflow/underflow to a slightly lower value. Before: powf(9.999995e-01, -1.342177e+08) -> inf After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 MFC after: 1 week
* Restore the augmented strlen commentaryMateusz Guzik2021-02-081-11/+4
| | | | ... lost in revert
* Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01Alex Richardson2021-02-041-0/+2
| | | | | | This includes improvements to the atf-sh helper functions that significantly reduce the number of spawned processes for each test and therefore speeds up running the testsuite noticeably.
* Revert "Reimplement strlen"Mateusz Guzik2021-02-031-28/+54
| | | | | | | | | This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1. It breaks for some corner cases on big endian ppc64. Given the stage of the release process it is best to revert for now. Reported by: jhibbits
* atf: Fix ATF_BUILD_* values when not using the bootstrap compilerAlex Richardson2021-02-033-22/+9
| | | | | | | | | | | | | | | Currently, we encode the full path and compile flags for the build compiler in libatf. However, these values are not correct when cross-compiling: For example, when I build on macOS, CC is set to the host path /usr/local/Cellar/llvm/11.0.0_1/bin/clang-11. This path will not exist on the target system. Simplify this logic and use cc/cpp/c++ since those binaries will exist on the target system unless the compiler was explicitly disabled. I'm not convinced ATF needs to encode these values, but this is a minimal fix for these tests when using a non-bootstrapped compiler. Reviewed By: ngie, brooks Differential Revision: https://reviews.freebsd.org/D28414
* Bump shared library versions after ncurses bump in 13.John Baldwin2021-02-025-2/+5
| | | | | | | | | | | | | A few shared libraries in the base system link against ncurses. An upgrade from a 12.x host to 13 results in ABI breakage for existing binaries since the newer versions of these libraries link against the newer ncurses while the binary itself links against the older ncurses. For example, dialog4ports built on 12.x sometimes crashes on 13 since it depends on libdialog which links against ncurses internally. MFC after: 3 days Reviewed by: kib, delphij Differential Revision: https://reviews.freebsd.org/D28448
* Remove the MK_LIBCPLUSPLUS optionAlex Richardson2021-02-012-4/+2
| | | | | | | | This option has been equivalent to any form of C++ support since libstdc++ was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27974
* libc: fix buffer overrun in getrpcport(3)Edward Tomasz Napierala2021-01-311-3/+3
| | | | | | | Reviewed By: markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27332
* amd64: move memcmp checks upfrontMateusz Guzik2021-01-311-22/+28
| | | | | | | | | | | | | | | This is a tradeoff which saves jumps for smaller sizes while making the 8-16 range slower (roughly in line with the other cases). Tested with glibc test suite. For example size 3 (most common with vfs namecache) (ops/s): before: 407086026 after: 461391995 The regressed range of 8-16 (with 8 as example): before: 540850489 after: 461671032
* amd64: add a note about simd to libc memset, memmove and memcmpMateusz Guzik2021-01-313-0/+18
|
* Drop temporary compat in setproctitleMateusz Guzik2021-01-311-22/+2
|
* amd64: add missing ALIGN_TEXT to loops in memset and memmoveMateusz Guzik2021-01-302-0/+3
|
* Reimplement strlenMateusz Guzik2021-01-291-54/+28
| | | | | | | | | | | | | | | | | | | | | | | The previous code neglected to use primitives which can find the end of the string without having to branch on every character. While here augment the somewhat misleading commentary -- strlen as implemented here leaves performance on the table, especially so for userspace. Every arch should get a dedicated variant instead. In the meantime this commit lessens the problem. Tested with glibc test suite. Naive test just calling strlen in a loop on Haswell (ops/s): $(perl -e "print 'A' x 3"): before: 211198039 after: 338626619 $(perl -e "print 'A' x 100"): before: 83151997 after: 98285919
* Avoid double output in fenv_testAlex Richardson2021-01-291-0/+2
| | | | | | | | | This tests fork()s, so if there is still data in the stdout buffer on fork it will print it again in the child process. This was happening in the CheriBSD CI and caused the test to complain about malformed TAP output. Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28397
* test_inf_inputs: Use atf_tc_expect_fail() instead of atf_tc_skip()Alex Richardson2021-01-291-1/+1
| | | | | Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28396
* Update comment missed in 83ff5d5d98cbcf9b66dccd70022358aec8918a14Alex Richardson2021-01-291-1/+1
| | | | Reported by: jrtc27
* Un-XFAIL two tests with Clang > 10Alex Richardson2021-01-281-1/+1
| | | | | | | | SVN r343917 fixed this for in-tree clang, but when building with a newer out-of-tree clang the test was still marked as XFAIL. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28390
* Remove obsolete code gated on _ARM_ARCH_*Andrew Turner2021-01-282-69/+0
| | | | | | | This is all code only run on ARMv4 and ARMv5. Support for these have been dropped from FreeBSD. Differential Revision: https://reviews.freebsd.org/D28314
* Remove the old ARMv4 memcpyAndrew Turner2021-01-283-1652/+1371
| | | | | | | | | This was only used when building for ARMv4 or some ARMv5 or when _STANDALONE is defined. As ARMv4 and ARMv5 support has been removed, and we only define _STANDALONE in the bootloader where we don't use this version of memcpy we can remove it. Differential Revision: https://reviews.freebsd.org/D28313
* Remove leftover big-endian arm supportAndrew Turner2021-01-285-632/+0
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28312
* libllvmminimal: Add missing Support/ABIBreak.cppJessica Clarke2021-01-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When building natively on RISC-V, linking the bootstrap clang-tblgen fails with: ld: error: undefined symbol: llvm::EnableABIBreakingChecks >>> referenced by PrettyStackTrace.cpp >>> PrettyStackTrace.o:(.sdata+0x0) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Signals.cpp >>> Signals.o:(.sdata+0x8) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Timer.cpp >>> Timer.o:(.sdata+0x28) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a This is likely due to Error.h's inclusion of abi-breaking.h. It's unclear why this only affects RISC-V, but perhaps relates to its more eager use of .sdata due to the ABI's support for linker relaxations. Regardless, this is theoretically an issue for all architectures. Reported by: Dennis Clarke <dclarke@blastwave.org> Reviewed by: dim Tested by: mhorne MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28367
* tests: Skip cap_fileargs if build without capsicum capabilitiesOlivier Cochard2021-01-262-0/+31
| | | | | | Approved by: oshogbo Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D2834
* Don't include libarchive fuzz tests by defaultAlex Richardson2021-01-251-4/+9
| | | | | | | | | | | | | | | These tests are basic fuzz tests that permute input to trigger crashes rather than regression or unit tests. Additionally, some of them take a rather long time to run and should probably be run on a dedicated fuzzing job instead. Moreover, these simple tests use rand() instead of a real fuzzing tool that generates interesting inputs (e.g. LLVM libFuzzer) so are unlikely to find anything interesting when run in CI. This allows removing one BROKEN_TESTS case due to timeouts and speeds up running tests on emulated platforms such as QEMU. Reviewed By: lwhsu, mm Differential Revision: https://reviews.freebsd.org/D27153
* libc: try to skip memcpy in _gettempMateusz Guzik2021-01-241-3/+8
|
* libc: remove open-coded strlen in _gettempMateusz Guzik2021-01-241-2/+1
|
* libc: skip spurious stat in _gettempMateusz Guzik2021-01-241-21/+0
| | | | | It was only done to catch ENOTDIR, but the kernel already returns the error where appropriate.
* build: remove LIBPTHREAD/LIBTHR build optionsKyle Evans2021-01-221-2/+2
| | | | | | | | | | | | | | | | | | WITHOUT_LIBTHR has been broken for a little over five years now, since the xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building a useful system without threading support is becoming increasingly more difficult. Additionally, in the five plus years that it's been broken more reverse dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among others) that make it more and more difficult to reconcile the effort needed to fix these options. Remove the broken options. PR: 252760 Reviewed by: brooks, emaste, kib Differential Revision: https://reviews.freebsd.org/D28263
* fix incorrect LLD_VERSION_STRING from previous commitGlen Barber2021-01-221-1/+1
| | | | | Reported by: Oliver Pinter Sponsored by: Rubicon Communications, LLC ("Netgate")
* Bump CURRENT to 14.0Glen Barber2021-01-223-3/+3
| | | | | | | This one goes to 14. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate")
* libcasper/cap_grp tests: Reset the group database handleMark Johnston2021-01-211-0/+4
| | | | | | | | | | | | Some tests verify that the capgrp capability does not permit calls to setgrent(3), but all tests need to ensure that they reset the capability's group database handle, otherwise the local process and casper process will be out of sync. The cap_pwd tests already handle this. Sponsored by: The FreeBSD Foundation MFC after: 1 month
* libc/nss: Ensure that setgroupent(3) actually works as advertisedMark Johnston2021-01-211-0/+2
| | | | | | | | | | | Because the "files" and "compat" implementations failed to set the "stayopen", keyed lookups would close the database handle, contrary to the purpose of setgroupent(3). setpassent(3)'s implementation does not have this bug. PR: 165527 Submitted by: Andrey Simonenko MFC after: 1 month
* libc/nss tests: Add regression tests for commit 55444c823e1fMark Johnston2021-01-212-19/+93
| | | | | | PR: 252094 Sponsored by: The FreeBSD Foundation MFC after: 1 month
* libc/nss: Restore iterator state when doing passwd/group lookupsMark Johnston2021-01-212-26/+26
| | | | | | | | | | | | | | | | | | | | The getpwent(3) and getgrent(3) implementations maintain some internal iterator state. Interleaved calls to functions which do passwd/group lookups using a key, such as getpwnam(3), would in some cases clobber this state, causing a subsequent getpwent() or getgrent() call to restart iteration from the beginning of the database or to terminate early. This is particularly troublesome in programming environments where execution of green threads is interleaved within a single OS thread. Take care to restore any iterator state following a keyed lookup. The "files" provider for the passwd database was already handling this correctly, but "compat" was not, and both providers had this problem when accessing the group database. PR: 252094 Submitted by: Viktor Dukhovni <ietf-dane@dukhovni.org> MFC after: 1 month
* libc/nss tests: Fix getpw and getgr single-pass testsMark Johnston2021-01-212-32/+8
| | | | | | | | | Some NSS regression tests for getgrent(3) and getpwent(3) were not testing anything because the test incorrectly requested creation of a database snapshot. Sponsored by: The FreeBSD Foundation MFC after: 1 month
* libc/nss tests: StyleMark Johnston2021-01-213-36/+37
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 month
* x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUsKonstantin Belousov2021-01-211-4/+1
| | | | | | | Reported by: many Tested by: gallatin, mikael, rhurlin MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libc: Fix null pointer arithmetic warning in mergesortAlex Richardson2021-01-201-4/+2
| | | | | | | | | This file has other questionable code and "optimizations" (such as copying one int at a time) that are probably no longer useful, so it might make sense to replace it with a different implementation at some point. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D28134
* Remove remaining uses of ${COMPILER_FEATURES:Mc++11}Alex Richardson2021-01-192-4/+0
| | | | | | | | | | All supported compilers have C++11 support so these checks can be replaced with MK_CXX guards. See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252759 PR: 252759 Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28234
* getopt: Fix conversion from string-literal to non-const char *Alex Richardson2021-01-192-4/+3
| | | | | | Define a non-const static char EMSG[] = "" to avoid having to add __DECONST() to all uses of EMSG. Also make current_dash a const char * to fix this warning.