Repository navigation
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
Yep, sorry, realized that a bit late (though I could not spot the difference in meaning myself). MUSL also fixed the |
vszakats
marked this pull request as draft
February 21, 2025 17:31
This comment was marked as outdated.
This comment was marked as outdated.
vszakats
force-pushed
the
aresrr
branch
4 times, most recently
from
February 22, 2025 00:16
8784fe6 to
3b6bf5f
Compare
Member
Author
|
Non-debug builds are also affected. Same root cause, different compiler errors. It most likely affects curl-for-win MUSL builds too in this combination (once RR is enabled there). |
Sync it with cmake to: - exclude it from all builds except windows and cygwin - exclude it from unity build for cygwin
9 tasks done
Member
Author
|
Closing this attempt in favor of #17827. |
vszakats
added a commit
that referenced
this pull request
Jul 28, 2025
Fixing: - HTTPS-RR builds with c-ares and Linux MUSL. - curl-for-win minimal builds with Linux MUSL. It should fix all other kinds of entaglement between curl's redefintions of system symbols and system (or 3rd-party) headers sensitive to that. It also syncs memory override behavior between unity & non-unity builds, thus reducing build variations. The idea is to define and declare everything once in `curl_setup.h`, without overriding any system symbols with curl ones yet. Then, like before this patch, override them, if necessary, in each source file via `curl_memory.h` and `memdebug.h`, after including system headers. To ensure a clean slate with no overrides at the beginning of each source file, reset all of them unconditionally at the end of `curl_setup.h`, by including `curl_mem_undef.h`. (This assumes `curl_setup.h` is always included first, which is already the case throughout the codebase.) `curl_mem_undef.h` can also be included explicitly wherever overrides are causing problems. E.g. in tests which use unity-style builds and a previously included `curl_memory.h`/`memdebug.h` can be spilling into other source files. The simplified role of the two override headers: - `curl_memory.h`: overrides system memory allocator functions to libcurl ones, when memory tracing (aka `CURLDEBUG`) is disabled. - `memdebug.h`: overrides system memory allocator and some other functions to curl debug functions, when memory tracing is enabled. Changed made in this patch, step-by-step: - curl_memory.h: move allocator typedefs and protos to `curl_setup.h`. - memdebug.h: move `ALLOC_*` macros to `curl_setup.h`. - memdebug.h: move allocator protos to `curl_setup.h`. - memdebug.h: move `Curl_safefree()` macro to `curl_setup.h`. (it's a regular macro, with a one-time, global, definition.) - curl_memory.h: move system symbol undefs to a new, separate header: `curl_mem_undef.h`. - curl_setup.h: include `curl_mem_undef.h` at the end, unconditionally, to reset system symbol macros after each inclusion. - handle `sclose()` and `fake_sclose()` in `curl_setup.h`. They are not system symbols, a one-time definition does the job. Also: - GHA/linux: enable unity mode for the HTTP-RR c-ares MUSL job. Follow-up to 17ab4d6 #16413 That said, I'd still find it better to avoid redefining system macros. To communicate clearly the fact that they are not the original system calls and they do behave differently. And, it would allow dropping the undef/redef dance in each source file, and maintaining the logic with it. The "last #include files should be in this order" comments in each source would also become unnecessary. Also the trick of using `(func)` (or interim macros) to call the non-overridden function where required. This method works for printf and most everything else already. For `_tcsdup`, socket and fopen functions this could work without disturbing the codebase much. Ref: #16428 (clean reboot of) Closes #17827
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.