cmake: fix HAVE_H_ERRNO_ASSIGNABLE detection#12094
cmake: fix HAVE_H_ERRNO_ASSIGNABLE detection#12094vszakats wants to merge 3 commits intocurl:masterfrom
HAVE_H_ERRNO_ASSIGNABLE detection#12094Conversation
Skip `check_c_source_runs()` call when cross-building. Regression from 04a3a37 curl#11979 Reported-by: Kartatz on Github Fixes curl#12093 Closes #xxxxx
|
After re-reading the autotools code and made more tests, I'm attempting It looks like this test code isn't meant to be run; compiling it is enough. This If this works correctly with SerenityOS, we might drop the allowlisting. [ What confused me is that the test returns a meaningful result when run, but /cc @Kartatz |
This fixes the issue for me. Both |
HAVE_GETADDRINFO_THREADSAFE detection
HAVE_GETADDRINFO_THREADSAFE detectionHAVE_H_ERRNO_ASSIGNABLE detection
|
Perfect! This made the fix simpler, enabled it for cross-builds and made the allow-list unnecessary. This is ready to merge. |
According to the issue curl/curl#12093 the curl build doesn't properly detect that Serenity has getaddrinfo() and outputs the following: --- Performing Test HAVE_H_ERRNO_ASSIGNABLE CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately: HAVE_H_ERRNO_ASSIGNABLE_EXITCODE (advanced) --- Setting the CMake cache variable HAVE_GETADDRINFO_THREADSAFE=1 solves the mentioned error. Also see: curl/curl#12094
According to the issue curl/curl#12093 the curl build doesn't properly detect that Serenity has getaddrinfo() and outputs the following: --- Performing Test HAVE_H_ERRNO_ASSIGNABLE CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately: HAVE_H_ERRNO_ASSIGNABLE_EXITCODE (advanced) --- Setting the CMake cache variable HAVE_GETADDRINFO_THREADSAFE=1 solves the mentioned error. Also see: curl/curl#12094
Fix
HAVE_H_ERRNO_ASSIGNABLEto not run, only compile its test snippet,aligning this with autotools. This fixes an error when doing
cross-builds and also actually detects this feature. It affected systems
not allowlisted into this, e.g. SerenityOS.
We used this detection result to enable
HAVE_GETADDRINFO_THREADSAFE.Follow-up to 04a3a37 #11979
Ref: #12095 (closed in favour of this patch)
Ref: #11964 (effort to sync cmake detections with autotools)
Reported-by: Kartatz on Github
Assisted-by: Kartatz on Github
Fixes #12093
Closes #12094