-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Cannot compile with CMake on macOS 12.2.1 if option CURL_USE_GSSAPI
is On
#9017
Comments
I suspect this is the same problem I patch locally when building curl - I haven't upstreamed that because I had no time to check if it has any unwanted side effects. I just add |
CURL_USE_GGSAPI
is OnCURL_USE_GSSAPI
is On
CURL_USE_GSSAPI
is OnCURL_USE_GSSAPI
is On
@jzakrzewski I've stumbled upon this issue again on another computer and have tried your workaround. It seems to be working. |
@jzakrzewski do you want to create a PR out of your suggestion so we can have this fixed? |
I'll try to make some time either this evening or tomorrow. I'd really love to contribute more than occasional comment here and there... |
Damn, still did not get to it. :( |
CMAKE_*_LINKER_FLAGS must be a string but GSS_LINKER_FLAGS is a list, so we need to replace semicolons with spaces when setting those. Fixes curl#9017
I did this
I attempted to compile Curl in a CMake project by adding the repository as a subproject. After seemingly successful configuration I've encountered the following error:
I began investigating and I traced back the issue as follows:
If my perception is right then these are done to ensure compatibility among the supported platforms and provide the missing features through the generated portions of
curl_config.h
in case if something is missing. In my casein_addr_t
was falsely assumed missing and therefore a define was generated to aid that which clashed with the already existingin_addr_t
type on my system.CurlTests.c
andcurl_internal_test
macro works to find out why that happened. For context initially I setCURL_USE_GSSAPI
On for the reason the version of curl forked by Apple suggested so inREADME.Apple
inside the tarball.I printed out in
Macros.cmake
attry_compile()
callMACRO_CHECK_FUNCTION_DEFINITIONS
and it looked like so (notice the end):
Since this is passed to argument
CMAKE_FLAGS
oftry_compile()
it turns out that it fails (silently I think) and instead of skipping the one garbage part that it cannot handle (-dynamic -Wl,-search_paths_first
) or cause a fatal error, it just omits the compiler flags.To prove this I intentionally caused a fatal error just after the test
HAVE_IN_ADDR_T
failed and with--debug-trycompile
enabled and examined the build environment for the feature test. None of the defines were passed over to the compiler. After I quickly have found a way to prevent the part-dynamic -Wl,-search_paths_first
being passed toCMAKE_FLAGS
not only the test passed but the whole build process has healed itself.variable_watch
I traced back where-dynamic -Wl,-search_paths_first
came from:CMAKE_FLAGS
it was passed through the variable${MACRO_CHECK_FUNCTION_DEFINITIONS}
,${CMAKE_REQUIRED_FLAGS}
,CMakeLists.txt
by concatenating${_LINKER_FLAGS_STR}
,{GSS_LINKER_FLAGS}
,FindGSS
.curl/libcurl version
It both affects master at the time of writing (
134963a5efdc3906257c88ce62dba8d46c292908
) and tagcurl-7_83_1
.operating system
Darwin MYHOSTNAMEREMOVED 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 x86_64
macOS 12.2.1 Monterey
Unfortunately in a couple days I'll no longer have access to this computer so I did my best assemble all the information that should be enough to reproduce the issue.
The text was updated successfully, but these errors were encountered: