cmake: rework binutils ld hack to not read LOCATION property#20839
Closed
vszakats wants to merge 1 commit intocurl:masterfrom
Closed
cmake: rework binutils ld hack to not read LOCATION property#20839vszakats wants to merge 1 commit intocurl:masterfrom
LOCATION property#20839vszakats wants to merge 1 commit intocurl:masterfrom
Conversation
LOCATION access
LOCATION accessLOCATION access
LOCATION accessLOCATION access
LOCATION accessLOCATION property
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Mar 6, 2026
To allow simplifying the binutils ld hack, by chaining the original imported target to curl's local duplicate target. Also to allow linking to dependencies' native imported targes via their CMake Configs, which may similarly be chained by default. Fixing (seen on Linux with simplified binutils hack via curl#20839): ``` Requires: Requires.private: libzstd openssl zlib Libs: -L${libdir} -lcurl -Libs.private: -lcrypto -lssl -lz -lzstd +Libs.private: -lOpenSSL::Crypto -lZLIB::ZLIB -lcrypto -lssl -lz -lzstd Cflags: -I${includedir} Cflags.private: -DCURL_STATICLIB Error: Process completed with exit code ``` Ref: https://github.com/curl/curl/actions/runs/22768301699/job/66041980258?pr=20839 Cherry-picked from curl#20814 Cherry-picked from curl#20839
vszakats
added a commit
that referenced
this pull request
Mar 16, 2026
To allow simplifying the binutils ld hack, by chaining the original imported target to curl's local duplicate target. Also to allow linking to dependencies' native imported targets via their CMake Configs, which will always be hooked up to a `CURL::` interface, and may also be chained upstream. Fixing (seen on Linux with simplified binutils hack via #20839): ``` Requires: Requires.private: libzstd openssl zlib Libs: -L${libdir} -lcurl -Libs.private: -lcrypto -lssl -lz -lzstd +Libs.private: -lOpenSSL::Crypto -lZLIB::ZLIB -lcrypto -lssl -lz -lzstd Cflags: -I${includedir} Cflags.private: -DCURL_STATICLIB Error: Process completed with exit code ``` Ref: https://github.com/curl/curl/actions/runs/22768301699/job/66041980258?pr=20839 Note this makes it possible to run into an infinite loop because CMake allows cyclic dependencies. It isn't added by curl's CMake script nor by any dependencies as defined by default, but may happen in theory with custom-created targets. In such case CMake automatically stops with an error at 1000 iterations. I find it overkill to add custom protection for it. Cherry-picked from #20814 Cherry-picked from #20839 Closes #20840
4faa910 to
4b31c05
Compare
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.
Instead hook up the upstream target name as-is to the local wrapper
target.
To:
curl-config.cmake.Before this patch it had no guard for
IMPORTEDtargets even thoughfind_dependencies()is not guaranteed to create the target expectedif it already existed and was potentially created differently.
Depends-on: #20840
Follow-up to 4f1646e #20486 #20419
libcurl.pc#20840.