Avoid unnecessary -L for implicit link dirs - #16233
Closed
dg0yt wants to merge 1 commit into
Closed
Conversation
vszakats
approved these changes
Feb 7, 2025
Member
|
Thanks @dg0yt, merged! |
Member
|
Ah, late, do you see anything against this shorter version?: --- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2236,7 +2236,7 @@ if(NOT CURL_DISABLE_INSTALL)
endforeach()
# Avoid getting unnecessary -L options for known system directories.
- set(_sys_libdirs "")
+ set(_sys_libdirs ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
foreach(_libdir IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
if(_libdir MATCHES "/$")
string(APPEND _libdir "lib") |
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Feb 7, 2025
Co-authored-by: Kai Pastor Ref: curl/curl@f72b848 Ref: curl/curl#16233
vszakats
added a commit
to libssh2/libssh2
that referenced
this pull request
Feb 7, 2025
Co-authored-by: Kai Pastor Ref: curl/curl@f72b848 Ref: curl/curl#16233
Contributor
Author
CMake shenanigans: Written this way, you get inconsistent behavior depending on That's why I didn't do it that way. On second thought, it is fine with double quotes.
|
Member
Nice, thanks! |
vszakats
added a commit
to libssh2/libssh2
that referenced
this pull request
Feb 7, 2025
For consistent initialization for `_sys_libdirs` and just for consistent formatting in the other case. Ref: curl/curl#16233 (comment) Follow-up to 3de8731 #1540
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 7, 2025
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 7, 2025
Also mind the quotes: curl#16233 (comment) Follow-up to f72b848 curl#16233
vszakats
added a commit
that referenced
this pull request
Feb 7, 2025
Also mind the quotes: #16233 (comment) Follow-up to f72b848 #16233 Closes #16243
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
The unnecessary `-L` may unexpectedly change the toolchain's chosen search order in implicit link directories. Causing this error noticed by a vcpkg user, and reproduced, in the context of Android NDK r22b, API level 16, static library and CRT linkage: ~~~ configure:23635: checking whether libcurl is usable configure:23669: armv7a-linux-androideabi16-clang -o conftest --sysroot=/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -DDECLARE_TIMEZONE -Wall -I/home/runner/work/boinc/boinc/3rdParty/buildCache/android/android-tc/arm/arm-linux-androideabi/include -O3 -fomit-frame-pointer -fPIE -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -D__ANDROID_API__=16 -Wall -I/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/include -I/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/pkgconfig/../../include -DCURL_STATICLIB -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib -llog -fPIE -pie -latomic -static-libstdc++ -march=armv7-a -Wl,--fix-cortex-a8 -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib conftest.c -L/home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/pkgconfig/../../lib -lcurl -L/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi -lssl -lcrypto -ldl -pthread -lz >&5 clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument] ld: error: undefined symbol: bsd_signal >>> referenced by legacy_signal_inlines.h:116 (/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/legacy_signal_inlines.h:116) >>> libcrypto-lib-ui_openssl.o:(read_string_inner) in archive /home/runner/work/boinc/boinc/3rdParty/android/vcpkg/installed/arm-android/lib/libcrypto.a ld: error: undefined symbol: pthread_atfork ~~~ with the unnecessary option ~~~ -L/home/runner/work/boinc/boinc/3rdParty/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi ~~~ Reference: microsoft/vcpkg#43463 (comment) Closes curl#16233
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Also mind the quotes: curl#16233 (comment) Follow-up to f72b848 curl#16233 Closes curl#16243
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.
The unnecessary
-Lmay unexpectedly change the toolchain's chosen search order in implicit link directories.Causing this error noticed by a vcpkg user, and reproduced, in the context of Android NDK r22b, API level 16, static library and CRT linkage:
with the unnecessary option
Reference: microsoft/vcpkg#43463 (comment)