#
5205b32d |
| 15-Aug-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libc: Drop incorrect qsort optimization
As pointed out in the PR and the article linked below, the switch to insertion sort in the BSD qsort code is based on a misunderstanding of Knuth's TAOCP and
libc: Drop incorrect qsort optimization
As pointed out in the PR and the article linked below, the switch to insertion sort in the BSD qsort code is based on a misunderstanding of Knuth's TAOCP and is actually a pessimization. As demonstrated by the added test, it is trivially easy to construct pathological input which results in quadratic runtime. Without that misguided optimization, the same input runs in nearly linearithmic time.
https://www.raygard.net/2022/02/26/Re-engineering-a-qsort-part-3
PR: 287089 MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51907
show more ...
|
Revision tags: release/13.5.0-p3, release/14.2.0-p5, release/14.3.0-p2, release/14.3.0-p1, release/14.2.0-p4, release/13.5.0-p2, release/14.3.0 |
|
#
873420ca |
| 27-Apr-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libc: Add getenv_r() function.
This is a calque of the NetBSD function of the same name.
MFC after: never Relontes: yes Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://
libc: Add getenv_r() function.
This is a calque of the NetBSD function of the same name.
MFC after: never Relontes: yes Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D49979
show more ...
|
#
12668ead |
| 22-Apr-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
bsd.compiler.mk: Add a blocks compiler feature.
Sponsored by: Klara, Inc. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D49963
|
#
f0ac5e91 |
| 22-Apr-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
fts: Add blocks support.
This adds an `fts_open_b()` variant of `fts_open()` which takes a block instead of a function pointer.
This was inspired by, and is intended to be compatible with, Apple's
fts: Add blocks support.
This adds an `fts_open_b()` variant of `fts_open()` which takes a block instead of a function pointer.
This was inspired by, and is intended to be compatible with, Apple's implementation; however, although our FTS and theirs share a common ancestor, they have diverged significantly. That and the fact that we still target compilers which don't support blocks means Apple's implementation was not directly reusable.
This is the second use case for blocks in FreeBSD (the first being `qsort_b()`, which we use here). This suggest we might want to add a `COMPILER_FEATURE` for blocks to avoid hardcoding any further `COMPILER_TYPE` checks.
MFC after: never Relnotes: yes Sponsored by: Klara, Inc. Reviewed by: kevans, theraven, imp Differential Revision: https://reviews.freebsd.org/D49877
show more ...
|
#
6527682a |
| 11-Apr-2025 |
John Baldwin <jhb@FreeBSD.org> |
src: Use gnu++17 as the default C++ standard
Previously the compiler's default C++ standard was used unlike C where bsd.sys.mk explicitly sets a default language version. Setting an explicit defaul
src: Use gnu++17 as the default C++ standard
Previously the compiler's default C++ standard was used unlike C where bsd.sys.mk explicitly sets a default language version. Setting an explicit default version will give a more uniform experience across different compilers and compiler versions.
gnu++17 was chosen to match the default C standard. It is well supported by a wide range of clang (5+) and GCC (9+) versions.
gnu++17 is also the default C++ standard in recent versions of clang (16+) and GCC (11+). As a result, many of the explicit CXXSTD settings in Makefiles had the effect of lowering the C++ standard instead of raising it as was originally intended and are removed.
Note that the remaining explicit CXXSTD settings for atf and liblutok explicitly lower the standard to C++11 due to use of the deprecated auto_ptr<> template which is removed in later versions.
Reviewed by: imp, asomers, dim, emaste Differential Revision: https://reviews.freebsd.org/D49223
show more ...
|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3 |
|
#
ee9ce107 |
| 05-Apr-2025 |
Kyle Evans <kevans@FreeBSD.org> |
libc: tests: add some tests for __cxa_atexit handling
This adds a basic test that __cxa_atexit works, and also adds some tests for __cxa_atexit handlers registered in the middle of __cxa_finalize.
libc: tests: add some tests for __cxa_atexit handling
This adds a basic test that __cxa_atexit works, and also adds some tests for __cxa_atexit handlers registered in the middle of __cxa_finalize.
PR: 285870
show more ...
|
Revision tags: 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 |
|
#
c0946aee |
| 07-Aug-2024 |
Mark Johnston <markj@FreeBSD.org> |
libc tests: Add some test cases for recursive exiting
Derived from tests posted by kib in D46108. I made one of them use a pthread barrier instead of sleeping.
Reviewed by: kib MFC after: 2 weeks
libc tests: Add some test cases for recursive exiting
Derived from tests posted by kib in D46108. I made one of them use a pthread barrier instead of sleeping.
Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46176
show more ...
|
#
5132e16e |
| 29-Jul-2024 |
Mark Johnston <markj@FreeBSD.org> |
libc tests: Rename the quick_exit test file, fix style
Call it libc_exit_test instead of exit_test because the NetBSD test suite already has a file with the latter name. This is in preparation for
libc tests: Rename the quick_exit test file, fix style
Call it libc_exit_test instead of exit_test because the NetBSD test suite already has a file with the latter name. This is in preparation for adding other exit()-related tests.
MFC after: 2 weeks
show more ...
|
#
e9ac4169 |
| 15-Jul-2024 |
Warner Losh <imp@FreeBSD.org> |
Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
|
Revision tags: release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
c7dd4601 |
| 26-Sep-2023 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libc: Add a rudimentary test for quick_exit(3).
Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41937
|
#
d0b2dbfa |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
ab929323 |
| 04-Oct-2022 |
John Baldwin <jhb@FreeBSD.org> |
qsort_b_test: Only build on clang.
GCC doesn't support -fblocks.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36809
|
#
af3c7888 |
| 01-Oct-2022 |
Ed Schouten <ed@FreeBSD.org> |
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 <delphij@FreeBSD.org> |
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 <oshogbo@FreeBSD.org> |
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 <arichardson@FreeBSD.org> |
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 <mhorne@FreeBSD.org> |
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 |
|
#
53d2936c |
| 20-Jan-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r356848 through r356919.
|
#
6507380f |
| 20-Jan-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
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 <trasz@FreeBSD.org> |
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 |
|
#
c5c3ba6b |
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
#
24612bfd |
| 31-Aug-2019 |
Li-Wen Hsu <lwhsu@FreeBSD.org> |
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 |
|
#
9a696dc6 |
| 04-Apr-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345880
|
#
0eb97cca |
| 29-Mar-2019 |
Enji Cooper <ngie@FreeBSD.org> |
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 <ngie@FreeBSD.org> |
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 ...
|