-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #4312 - musl compilation compatibility #4336
Conversation
And indeed, it helps a bit: |
and upgraded the test so that it would fail, both at compile time and at run time, without the fix
centralizes auto detection tests, then distribute the outcome in all the places where it's active.
standard defined re-entrant variant of qsort(). Unfortunately, Annex K is optional.
lib/dictBuilder/cover.c
Outdated
* Note(@cyan): qsort() is never guaranteed to be stable, | ||
* so why would this property only matter for OpenBSD ? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop this. This was added before we switched to use COVER_strict_cmp*
which enforces a strict ordering on the array.
g_coverCtx can be declared as thread local so this code will at least be thread-safe on older versions of musl |
In |
#4312 tried to implement a manual workaround for
musl
compilation issues.It's manual because
musl
does not provide a version number, making it difficult to automate decisions.Unfortunately, the fix was incomplete, and the test did not catch it because it only detected a "warning" and had no runtime error.
Fixed both the test, which will now fail both at run time and compile time under similar conditions,
and the code, which now passes the more stringent test.
Used the opportunity to restructure the code, so that the dispatch strategy among the different variants of
qsort*()
is more maintainable and extendable.Employed the new framework to add support for
C11
Annex Kqsort_s()
re-entrant variant.also:
Reduced the duration of long CLI tests, particularly dictionary building tests, by utilizing multithreading with the
-T0
flag. This optimization significantly decreases the execution time of the longest CI jobs, enhancing overall CI efficiency and throughput.