|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
| #
b9c361e4 |
| 26-Sep-2023 |
Dag-Erling Smørgrav <[email protected]> |
libc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.
Compiler memory barriers do not prevent the CPU from executing the code out of order. Switch to C11 atomics. This also lets us get
libc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.
Compiler memory barriers do not prevent the CPU from executing the code out of order. Switch to C11 atomics. This also lets us get rid of the mutex; instead, loop until the compare_exchange succeeds.
While here, change the return value of at_quick_exit() on failure to the more traditional -1, matching atexit().
Sponsored by: Klara, Inc. Reviewed by: Olivier Certner, kevans, kib Differential Revision: https://reviews.freebsd.org/D41936
(cherry picked from commit 1dc3abb052430279e47c8922d22b30922adcf0f6)
libc: Add a rudimentary test for quick_exit(3).
Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41937
(cherry picked from commit c7dd4601aeebbc1bbe131cbe6747476c124b47fe)
show more ...
|
| #
d0b2dbfa |
| 16-Aug-2023 |
Warner Losh <[email protected]> |
Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
|
Revision tags: release/13.2.0, release/12.4.0 |
|
| #
ab929323 |
| 03-Oct-2022 |
John Baldwin <[email protected]> |
qsort_b_test: Only build on clang.
GCC doesn't support -fblocks.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36809
|
| #
af3c7888 |
| 30-Sep-2022 |
Ed Schouten <[email protected]> |
Alter the prototype of qsort_r(3) to match POSIX, which adopted the glibc-based interface.
Unfortunately, the glibc maintainers, despite knowing the existence of the FreeBSD qsort_r(3) interface in
Alter the prototype of qsort_r(3) to match POSIX, which adopted the glibc-based interface.
Unfortunately, the glibc maintainers, despite knowing the existence of the FreeBSD qsort_r(3) interface in 2004 and refused to add the same interface to glibc based on grounds of the lack of standardization and portability concerns, has decided it was a good idea to introduce their own qsort_r(3) interface in 2007 as a GNU extension with a slightly different and incompatible interface.
With the adoption of their interface as POSIX standard, let's switch to the same prototype, there is no need to remain incompatible.
C++ and C applications written for the historical FreeBSD interface get source level compatibility when building in C++ mode, or when building with a C compiler with C11 generics support, provided that the caller passes a fifth parameter of qsort_r() that exactly matches the historical FreeBSD comparator function pointer type and does not redefine the historical qsort_r(3) prototype in their source code.
Symbol versioning is used to keep old binaries working.
MFC: never Relnotes: yes Reviewed by: cem, imp, hps, pauamma Differential revision: https://reviews.freebsd.org/D17083
show more ...
|
| #
c65e42db |
| 07-Sep-2022 |
Xin LI <[email protected]> |
libc: add test case for qsort_b(3)
Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D36463
|
|
Revision tags: release/13.1.0, release/12.3.0 |
|
| #
597b0267 |
| 07-Nov-2021 |
Mariusz Zaborski <[email protected]> |
libc: add clearenv function
The clearenv(3) function allows us to clear all environment variable in one shot. This may be useful for security programs that want to control the environment or what va
libc: add clearenv function
The clearenv(3) function allows us to clear all environment variable in one shot. This may be useful for security programs that want to control the environment or what variables are passed to new spawned programs.
Reviewed by: scf, markj (secteam), 0mp (manpages) Differential Revision: https://reviews.freebsd.org/D28223
show more ...
|
|
Revision tags: release/13.0.0 |
|
| #
c1a3d7f2 |
| 19-Jan-2021 |
Alex Richardson <[email protected]> |
Remove remaining uses of ${COMPILER_FEATURES:Mc++11}
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_bu
Remove remaining uses of ${COMPILER_FEATURES:Mc++11}
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
show more ...
|
|
Revision tags: release/12.2.0 |
|
| #
2d143336 |
| 24-Jun-2020 |
Mitchell Horne <[email protected]> |
Enable long double tests on RISC-V
Some of the NetBSD contributed tests are gated behind the __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for platforms whose long double is larger tha
Enable long double tests on RISC-V
Some of the NetBSD contributed tests are gated behind the __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for platforms whose long double is larger than their double. I could not find this explicitly documented anywhere, but it is implied by the definitions in NetBSD's sys/arch/${arch}/include/math.h headers, and the following assertion from the UBSAN code:
#ifdef __HAVE_LONG_DOUBLE long double LD; ASSERT(sizeof(LD) > sizeof(uint64_t)); #endif
RISC-V has 128-bit long doubles, so enable the tests on this platform, and update the comments to better explain the purpose of this flag.
Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25419
show more ...
|
|
Revision tags: release/11.4.0 |
|
| #
6507380f |
| 20-Jan-2020 |
Edward Tomasz Napierala <[email protected]> |
Add qsort_r(3) regression test.
MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23206
|
| #
0d2fabfc |
| 20-Jan-2020 |
Edward Tomasz Napierala <[email protected]> |
Add qsort_s(3). Apart from the constraints, it also makes it easier to port software written for Linux variant of qsort_r(3).
Reviewed by: kib, arichardson MFC after: 2 weeks Relnotes: yes Sponsore
Add qsort_s(3). Apart from the constraints, it also makes it easier to port software written for Linux variant of qsort_r(3).
Reviewed by: kib, arichardson MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23174
show more ...
|
|
Revision tags: release/12.1.0 |
|
| #
24612bfd |
| 31-Aug-2019 |
Li-Wen Hsu <[email protected]> |
Unskip test cases from netbsd-tests by defining __HAVE_FENV
This unskips: - lib.libc.stdlib.strtod_test.strtod_round - lib.msun.fe_round_test.t_nofe_round
In lib/msun/tests/Makefile only define
Unskip test cases from netbsd-tests by defining __HAVE_FENV
This unskips: - lib.libc.stdlib.strtod_test.strtod_round - lib.msun.fe_round_test.t_nofe_round
In lib/msun/tests/Makefile only define on fe_round_test.c because lib.msun.ilogb_test.ilogb will get wrong results and needs more examination.
MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
|
Revision tags: release/11.3.0 |
|
| #
0eb97cca |
| 29-Mar-2019 |
Enji Cooper <[email protected]> |
Allow users to override CSTD/CXXSTD on a per-prog basis
The current logic for CSTD/CXXSTD requires homogenity as far as the supported C/C++ standards, which is a sensible default. However, when deal
Allow users to override CSTD/CXXSTD on a per-prog basis
The current logic for CSTD/CXXSTD requires homogenity as far as the supported C/C++ standards, which is a sensible default. However, when dealing with differing versions of C++, some code may compile with C++11, but not C++17 (for instance). So in order to avoid having people convert over their code to the new standard, give the users the ability to specify the standard on a per-program basis.
This will allow a user to override the supporting standard for a set of programs, mixing C++11 with C++14 (for instance).
Reviewed by: asomers Apprved by: emaste (mentor) MFC after: 1 month MFC with: r345708 Differential Revision: https://reviews.freebsd.org/D19738
show more ...
|
| #
bdbf3440 |
| 29-Mar-2019 |
Enji Cooper <[email protected]> |
Revert r345706: the third time will be the charm
When a review is closed via Phabricator it updates the patch attached to the review. I downloaded the raw patch from Phabricator, applied it, and rep
Revert r345706: the third time will be the charm
When a review is closed via Phabricator it updates the patch attached to the review. I downloaded the raw patch from Phabricator, applied it, and repeated my mistake from r345704 by accident mixing content from D19732 and D19738.
For my own personal sanity, I will try not to mix reviews like this in the future.
MFC after: 1 month MFC with: r345706 Approved by: emaste (mentor, implicit)
show more ...
|
| #
760b1a81 |
| 29-Mar-2019 |
Enji Cooper <[email protected]> |
Standardize `-std=c++* as `CXXSTD`
CXXSTD was added as the C++ analogue to CSTD.
CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++.
Thi
Standardize `-std=c++* as `CXXSTD`
CXXSTD was added as the C++ analogue to CSTD.
CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++.
This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203.
As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.
Notes:
This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc.
Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example:
Before this commit: ``` CXXFLAGS+= -std=c++14 ```
After this commit: ``` CXXSTD= c++14 ```
Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month MFC with: r345203, r345704, r345705 Relnotes: yes Tested with: make tinderbox Differential Revision: https://reviews.freebsd.org/D19732
show more ...
|
| #
752cabaa |
| 29-Mar-2019 |
Enji Cooper <[email protected]> |
Revert r345704
I accidentally committed code from two reviews. I will reintroduce the code to bsd.progs.mk as part of a separate commit from r345704.
Approved by: emaste (mentor, implicit) MFC afte
Revert r345704
I accidentally committed code from two reviews. I will reintroduce the code to bsd.progs.mk as part of a separate commit from r345704.
Approved by: emaste (mentor, implicit) MFC after: 2 months MFC with: r345704
show more ...
|
| #
9a41926b |
| 29-Mar-2019 |
Enji Cooper <[email protected]> |
CXXSTD is the C++ analogue to CSTD.
CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++.
This change standardizes the CXXSTD variable, ori
CXXSTD is the C++ analogue to CSTD.
CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++.
This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203.
As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.
Notes:
This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc.
Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example:
Before this commit: ``` CXXFLAGS+= -std=c++14 ```
After this commit: ``` CXXSTD= c++14 ```
Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19732
show more ...
|
| #
9303f819 |
| 31-Jan-2019 |
Kyle Evans <[email protected]> |
libc/tests: Add test case for jemalloc/libthr bug fixed in r343566
Submitted by: Andrew Gierth (original reproducer; kevans massaged for atf) Reviewed by: kib MFC after: 2 weeks X-MFC-with: r343566
libc/tests: Add test case for jemalloc/libthr bug fixed in r343566
Submitted by: Andrew Gierth (original reproducer; kevans massaged for atf) Reviewed by: kib MFC after: 2 weeks X-MFC-with: r343566 (or after) Differential Revision: https://reviews.freebsd.org/D19027
show more ...
|
| #
8c1c50ff |
| 19-Dec-2018 |
Conrad Meyer <[email protected]> |
Allow multi-byte thousands separators in strfmon(3)
PR: 234010 Reported by: Jon Tejnung <jon AT herrskogen.se> Reviewed by: yuripv Differential Revision: https://reviews.freebsd.org/D18605
|
|
Revision tags: release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0 |
|
| #
9851b340 |
| 30-Mar-2017 |
Konstantin Belousov <[email protected]> |
Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1.
Other needed supporting types, defines and constraint_handler infrastructure is added as specified in
Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1.
Other needed supporting types, defines and constraint_handler infrastructure is added as specified in the C11 spec.
Submitted by: Tom Rix <[email protected]> Sponsored by: Juniper Networks Discussed with: ed MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D9903 Differential revision: https://reviews.freebsd.org/D10161
show more ...
|
| #
9527fa4f |
| 12-Jan-2017 |
Enji Cooper <[email protected]> |
Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
This is to enable support in other testcases
Inspired by lib/msun/tests/Makefile .
MFC after: 1 week
|
|
Revision tags: release/11.0.1, release/11.0.0 |
|
| #
b585cd3e |
| 06-Aug-2016 |
Konstantin Belousov <[email protected]> |
Add __cxa_thread_atexit(3) API implementation.
This is the backing feature to implement C++11 thread storage duration specified by the thread_local keyword. A destructor for given thread-local obje
Add __cxa_thread_atexit(3) API implementation.
This is the backing feature to implement C++11 thread storage duration specified by the thread_local keyword. A destructor for given thread-local object is registered to be executed at the thread termination time using __cxa_thread_atexit(). Libc calls the __cxa_thread_calls_dtors() during exit(3), before finalizers and atexit functions, and libthr calls the function at the thread termination time, after the stack unwinding and thread-specific key destruction.
There are several uncertainties in the API which lacks a formal specification. Among them: - is it allowed to register destructors during destructing; we allow, but limiting the nesting level. If too many iterations detected, a diagnostic is issued to stderr and thread forcibly terminates for now. - how to handle destructors which belong to an unloading dso; for now, we ignore destructor calls for such entries, and issue a diagnostic. Linux does prevent dso unload until all threads with destructors from the dso terminated. It is supposed that the diagnostics allow to detect real-world applications relying on the above details and possibly adjust our implementation. Right now the choices were to provide the slim API (but that rarely stands the practice test).
Tests are added to check generic functionality and to specify some of the above implementation choices.
Submitted by: Mahdi Mokhtari <mokhi64_gmail.com> Reviewed by: theraven Discussed with: dim (detection of -std=c++11 supoort for tests) Sponsored by: The FreeBSD Foundation (my involvement) MFC after: 2 weeks Differential revisions: https://reviews.freebsd.org/D7224, https://reviews.freebsd.org/D7427
show more ...
|
| #
430f7286 |
| 04-May-2016 |
Enji Cooper <[email protected]> |
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that na
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info.
MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
show more ...
|
|
Revision tags: release/10.3.0 |
|
| #
43faedc1 |
| 02-Feb-2016 |
Glen Barber <[email protected]> |
First pass to fix the 'tests' packages.
Sponsored by: The FreeBSD Foundation
|
| #
459d04a5 |
| 22-Dec-2015 |
Ed Schouten <[email protected]> |
Let tsearch()/tdelete() use an AVL tree.
The existing implementations of POSIX tsearch() and tdelete() don't attempt to perform any balancing at all. Testing reveals that inserting 100k nodes into a
Let tsearch()/tdelete() use an AVL tree.
The existing implementations of POSIX tsearch() and tdelete() don't attempt to perform any balancing at all. Testing reveals that inserting 100k nodes into a tree sequentially takes approximately one minute on my system.
Though most other BSDs also don't use any balanced tree internally, C libraries like glibc and musl do provide better implementations. glibc uses a red-black tree and musl uses an AVL tree.
Red-black trees have the advantage over AVL trees that they only require O(1) rotations after insertion and deletion, but have the disadvantage that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n). My take is that it's better to focus on having a lower maximum depth, for the reason that in the case of tsearch() the invocation of the comparator likely dominates the running time.
This change replaces the tsearch() and tdelete() functions by versions that create an AVL tree. Compared to musl's implementation, this version is different in two different ways:
- We don't keep track of heights; just balances. This is sufficient. This has the advantage that it reduces the number of nodes that are being accessed. Storing heights requires us to also access all of the siblings along the path.
- Don't use any recursion at all. We know that the tree cannot 2^64 elements in size, so the height of the tree can never be larger than 96. Use a 128-bit bitmask to keep track of the path that is computed. This allows us to iterate over the same path twice, meaning we can apply rotations from top to bottom.
Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion seems to be twice as fast as glibc, whereas deletion has about the same performance. Unlike glibc, it uses a fixed amount of memory.
I also experimented with both recursive and iterative bottom-up implementations of the same algorithm. This iterative top-down version performs similar to the recursive bottom-up version in terms of speed and code size.
For some reason, the iterative bottom-up algorithm was actually 30% faster for deletion, but has a quadratic memory complexity to keep track of all the parent pointers.
Reviewed by: jilles Obtained from: https://github.com/NuxiNL/cloudlibc Differential Revision: https://reviews.freebsd.org/D4412
show more ...
|
| #
eacae6dc |
| 04-Dec-2015 |
Bryan Drewery <[email protected]> |
Fix LDADD/DPADD that should be LIBADD.
Sponsored by: EMC / Isilon Storage Division
|