Skip to content

CMake: use only needed socket libs when checking nonblocking sockets - #712

Closed
bk138 wants to merge 2 commits into
libssh2:masterfrom
bk138:master
Closed

bk138 wants to merge 2 commits into
libssh2:masterfrom
bk138:master

Conversation

@bk138

@bk138 bk138 commented Jun 20, 2022

Copy link
Copy Markdown

When building libssh2 and the libraries it depends on from source
using a single CMakeLists.txt (as is common on Android), libssh2's
CMake has to be hinted at where to find other libs by setting
variables like OPENSSL_SSL_LIBRARY and so on.

Now, as under Android there's one single CMakeLists.txt that has to
add_subdirectory() all other CMakeLists.txt, there's only one
configure phase and one build phase. That means when libssh2 is
configured, the libs it is configured to use are actually not built
yet.

In this case it's a problem to use the libs in LIBRARIES when checking
for nonblocking sockets as some libs in there are not yet built,
failing the test and ending up with HAVE_DISABLED_NONBLOCKING in
libssh2_config.h.

Fix this by using a separate, clean library list for the nonblocking
socket checks.

Closes #694

When building libssh2 and the libraries it depends on from source
using a single CMakeLists.txt (as is common on Android), libssh2's
CMake has to be hinted at where to find other libs by setting
variables like OPENSSL_SSL_LIBRARY and so on.

Now, as under Android there's one single CMakeLists.txt that has to
`add_subdirectory()` all other CMakeLists.txt, there's only one
configure phase and one build phase. That means when libssh2 is
configured, the libs it is configured to use are actually not built
yet.

In this case it's a problem to use the libs in LIBRARIES when checking
for nonblocking sockets as some libs in there are not yet built,
failing the test and ending up with HAVE_DISABLED_NONBLOCKING in
libssh2_config.h.

Fix this by using a separate, clean library list for the nonblocking
socket checks.

Closes #694
@bk138

bk138 commented Jul 9, 2022

Copy link
Copy Markdown
Author

Is there any more info I can provide regarding this?

@bk138

bk138 commented Aug 3, 2022

Copy link
Copy Markdown
Author

@willco007 friendly ping asking if more info is needed on this. Thanks!

bk138 added a commit to bk138/multivnc that referenced this pull request Dec 21, 2022
vszakats added a commit to vszakats/libssh2 that referenced this pull request Mar 7, 2023
@vszakats

vszakats commented Mar 7, 2023

Copy link
Copy Markdown
Member

Re-applying this fix to master: #816

@vszakats vszakats closed this in #816 Mar 8, 2023
vszakats added a commit that referenced this pull request Mar 8, 2023
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_libssh2_transport_read block forever on Android with OpenSSL

2 participants