Fix configure and cmake mistakes/differences#11973
Closed
Conversation
- for sys/uio.h - for fork - for connect Ref: #11964
- check for arc4random. To make rand.c use it accordingly. - check for fcntl - fix fseek detection - add SIZEOF_CURL_SOCKET_T - fix USE_UNIX_SOCKETS - define HAVE_SNPRINTF to 1 - check for fnmatch - check for sched_yield - remove HAVE_GETPPID duplicate from curl_config.h - add HAVE_SENDMSG Ref: #11964
16 tasks
vszakats
reviewed
Sep 28, 2023
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
bagder
added a commit
that referenced
this pull request
Sep 28, 2023
- check for arc4random. To make rand.c use it accordingly. - check for fcntl - fix fseek detection - add SIZEOF_CURL_SOCKET_T - fix USE_UNIX_SOCKETS - define HAVE_SNPRINTF to 1 - check for fnmatch - check for sched_yield - remove HAVE_GETPPID duplicate from curl_config.h - add HAVE_SENDMSG Ref: #11964 Co-authored-by: Viktor Szakats Closes #11973
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jan 16, 2025
Follow-up to 9b517c8 curl#11973 Follow-up to 23af112 curl#8680
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jan 17, 2025
On Windows this function is exported from winpthread, but winpthread is never used in Windows builds by curl itself. In cmake it was marked as never available, but autotools did check for this function. It found it sometimes (presumable when a dependency linked to pthread), resulting in a different `curl_config.h`. Sync the build systems by skipping this check in both, for Windows. Follow-up to 9b517c8 curl#11973 Follow-up to 23af112 curl#8680
vszakats
added a commit
that referenced
this pull request
Jan 17, 2025
On Windows a successful `sched_yield()` detection requires mingw-w64 built with POSIX threads (not Win32 threads) and GCC (not llvm/clang). (linking to `winpthread` via custom options may also work.) In CMake builds, it was pre-cached as unavailable before this patch. When detected (via autotools), it got only used for Windows XP or older targets combined with a non-GCC, non-clang compiler that doesn't support `__builtin_ia32_pause()`, or with the Intel C compiler. According to `lib/easy_lock.h`. mingw-w64 only supports GCC and clang, leaving a very narrow chance when `shed_yield()` gets called on Windows. Even then, `sched_yield()` is implemented in `winpthread` as `Sleep(0)`, which may or not be a useful. It's also trivial to implement locally if it is, and such rare build combination is also deemed useful. Thus, this patch marks `sched_yields()` permanently unavailable on the Windows platform also with autotools, and instead of pre-caching, skip this feature check with CMake. This syncs `HAVE_SCHED_YIELDS` between builds methods on Windows. Follow-up to 9b517c8 #11973 Follow-up to 23af112 #8680 Closes #16037
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
On Windows a successful `sched_yield()` detection requires mingw-w64 built with POSIX threads (not Win32 threads) and GCC (not llvm/clang). (linking to `winpthread` via custom options may also work.) In CMake builds, it was pre-cached as unavailable before this patch. When detected (via autotools), it got only used for Windows XP or older targets combined with a non-GCC, non-clang compiler that doesn't support `__builtin_ia32_pause()`, or with the Intel C compiler. According to `lib/easy_lock.h`. mingw-w64 only supports GCC and clang, leaving a very narrow chance when `shed_yield()` gets called on Windows. Even then, `sched_yield()` is implemented in `winpthread` as `Sleep(0)`, which may or not be a useful. It's also trivial to implement locally if it is, and such rare build combination is also deemed useful. Thus, this patch marks `sched_yields()` permanently unavailable on the Windows platform also with autotools, and instead of pre-caching, skip this feature check with CMake. This syncs `HAVE_SCHED_YIELDS` between builds methods on Windows. Follow-up to 9b517c8 curl#11973 Follow-up to 23af112 curl#8680 Closes curl#16037
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.
Part of the cleanup work of #11964