_fseeki64 incorrectly detected as found when cross-compiling for iOS. · Issue #15525 · curl/curl · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert _fseeki64 incorrectly detected as found when cross-compiling for iOS. #15525 New issue Copy link New issue Copy link Closed Closed _fseeki64 incorrectly detected as found when cross-compiling for iOS. #15525 Copy link Labels appleOS specific to an Apple operating system specific to an Apple operating system cmake Description lhunath opened on Nov 8, 2024 Issue body actions I did this It appears the change introduced by #15164 caused an issue cross-compiling curl for iOS/aarch64.
With the following in CMakeLists.txt : check_function_exists("_fseeki64" HAVE__FSEEKI64) Running the following: cmake -B libcurl-iphoneos -S libcurl -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_TOOLCHAIN_FILE=/Users/hubstaff/Developer/hubstaff/ios/hubstaff-core/toolchains/ios.toolchain.cmake -DCMAKE_INSTALL_PREFIX=/Users/hubstaff/Developer/hubstaff/ios/hubstaff-core/build/__third_party__/curl/distro/ios/ -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -GXcode -DBUILD_EXAMPLES=OFF -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_USE_SECTRANSP=ON -DUSE_APPLE_IDN=ON -DUSE_NGHTTP2=OFF -DCURL_USE_LIBPSL=OFF Results in: -- Looking for _fseeki64 -- Looking for _fseeki64 - found And a failed build: /Users/hubstaff/Developer/hubstaff/ios/hubstaff-core/build/__third_party__/curl/libcurl/lib/formdata.c:797:10: error: call to undeclared function '_fseeki64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 797 | return _fseeki64(stream, (__int64)offset, whence); | ^ /Users/hubstaff/Developer/hubstaff/ios/hubstaff-core/build/__third_party__/curl/libcurl/lib/formdata.c:797:29: error: use of undeclared identifier '__int64' 797 | return _fseeki64(stream, (__int64)offset, whence); | ^ /Users/hubstaff/Developer/hubstaff/ios/hubstaff-core/build/__third_party__/curl/libcurl/lib/formdata.c:794:52: warning: unused parameter 'offset' [-Wunused-parameter] 794 | static int fseeko_wrapper(void *stream, curl_off_t offset, int whence) | ^ 1 warning and 2 errors generated.
While reverting the CMakeLists.txt back to using: check_symbol_exists("_fseeki64" "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64) Yields: -- Looking for _fseeki64 -- Looking for _fseeki64 - not found And a successful build. I expected the following For HAVE__FSEEKI64 to be correctly detected as 0 rather than 1 when the symbol is unavailable during build time. curl/libcurl version curl-8_11_0 operating system Cross-compiling for iPhoneOS18.1.sdk from macOS 15.0.1 (24A348).
Activity bagder added cmake appleOS specific to an Apple operating system specific to an Apple operating system on Nov 8, 2024 vszakats commented on Nov 8, 2024 vszakats on Nov 8, 2024 Member More actions Thanks for your report. Would you mind posting the lines from CMakeFiles/CMakeConfigureLog.yaml where this detection is made? Also if you could make a ./configure build for iOS, it would be helpful to see if it's (mis)detected there. vszakats added a commit that references this issue on Nov 8, 2024 build: use `_fseeki64()` on Windows, drop detections This issue will close once commit 69b9a71 is merged into the 'master' branch.
69b9a71 vszakats commented on Nov 8, 2024 vszakats on Nov 8, 2024 Member More actions I figure it may be a more effective approach to just skip the detection altogether. Patch proposal: #15526 . Unless someone is aware that _fseeki64() is offered anywhere else than Windows. Also related: pririotizing it for Windows: aaacd02 GHA/configure-vs-cmake: add Windows build, fix issues #14678 f365d50 cmake opt-in for Windows: 8e74c07 cmake: assume _fseeki64 and no fseeko on Windows #11950 opt-in Windows: aa6c94c config-win32: define HAVE__FSEEKI64 #11944 initial support: 9c7165e lib: use wrapper for curl_mime_data fseek callback #11918 vszakats added regression on Nov 8, 2024 vszakats commented on Nov 8, 2024 vszakats on Nov 8, 2024 Member More actions In the meantime for anyone bumping into this issue, the workaround is passing -DHAVE__FSEEKI64=OFF to the cmake command-line. vszakats closed this as completed in 8b76a8a on Nov 11, 2024 danoli3 added a commit that references this issue on Nov 12, 2024 cURL - Cmakelist : FSEEK disabled till next version curl/curl#15525 52f216b vszakats commented on Nov 12, 2024 vszakats on Nov 12, 2024 Member More actions @lhunath Can you give a pointer where to find the referenced toolchains/ios.toolchain.cmake file? vszakats removed regression on Nov 12, 2024 vszakats commented on Nov 12, 2024 vszakats on Nov 12, 2024 Member More actions I could trace this back to an issue in ios.toolchain.cmake .
Details and possible upstream workaround: #15559 (comment) vszakats added a commit that references this issue on Nov 12, 2024 cmake: do not use `getpass_r` with Apple e7b5682 danoli3 added a commit that references this issue on Nov 12, 2024 OpenSSL / cURL - Update ( #448 ) 4d0e83e vszakats added a commit that references this issue on Nov 13, 2024 cmake: work around `ios.toolchain.cmake` breaking feature-detections 93e6e4b pps83 added 2 commits that reference this issue on Apr 26, 2025 build: use `_fseeki64()` on Windows, drop detections This issue will close once commit a59a6ca is merged into the 'master-min' branch. a59a6ca cmake: work around `ios.toolchain.cmake` breaking feature-detections This issue will close once commit 9d1f904 is merged into the 'master-min' branch.
9d1f904 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Metadata Metadata Assignees No one assigned Labels appleOS specific to an Apple operating system specific to an Apple operating system cmake Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.