Skip to content
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

Inclusion of libssh2 via pkg-config causes harmless build warning #11538

Closed
TurtleWilly opened this issue Jul 28, 2023 · 2 comments
Closed

Inclusion of libssh2 via pkg-config causes harmless build warning #11538

TurtleWilly opened this issue Jul 28, 2023 · 2 comments

Comments

@TurtleWilly
Copy link

I did this

When building --with-libssh2 a minor warning is triggered during the configure process where the "-L" specification erroneously gets added to LIBS. Also "-lssh2" appears twice (some other libraries like ssl+crypto, zstd, z, and brotlidec also appear multiple times for some reason, but that doesn't trigger warnings at least.)

$ ./configure \
	--prefix=/usr/local/mystuff/curl/8.2.1 \
	--with-openssl \
	--with-libssh2 \
	--with-brotli \
	…

->

…
configure: using LIBS: -lcares -lnghttp2 -lidn2 -lrtmp -lz -lssl -lcrypto -lssh2 -L/usr/local/mystuff/libssh2/latest/lib -lssh2 -lssl -lcrypto -lssl -lcrypto -lzstd -lzstd -lbrotlidec -lbrotlidec -lz -lpsl -lgsasl
configure: LIBS note: LIBS should only be used to specify libraries (-lname).
configure: WARNING: Continuing even with errors mentioned immediately above this line.
…

The specifications only can get generated via the pkg-config system (I only hotlink the .pc files in /usr/local/lib/pkgconfig, and nothing else directly in the standard paths). So I'm guessing the configure script itself causes the problem. Maybe it is not using the correct --libs-only-l?

$ pkg-config --libs libssh2
-L/usr/local/mystuff/libssh2/latest/lib -lssh2

$ pkg-config --libs-only-l libssh2
-lssh2

$ pkg-config --libs-only-L libssh2
-L/usr/local/mystuff/libssh2/latest/lib

This pretty matches what other libs, like nghttp2, etc., are providing there too. And those don't trigger this faux pas.

I expected the following

…
configure: using LIBS: -lcares -lnghttp2 -lidn2 -lrtmp -lssl -lcrypto -lssh2 -lzstd -lbrotlidec -lz -lpsl -lgsasl
…

curl/libcurl version

curl 8.2.1

operating system

Mac OS X 10.10.5 (Yosemite)

@bagder
Copy link
Member

bagder commented Jul 28, 2023

I'm guessing the configure script itself causes the problem. Maybe it is not using the correct --libs-only-l?

Scarily accurate guess 😨 !

curl/configure.ac

Line 2245 in 40c6329

LIB_SSH2=`$PKGCONFIG --libs libssh2`

Do you want to make the PR?

@TurtleWilly
Copy link
Author

@bagder I think it will go much quicker for you to do it. Basically I'm just a user here and I'm not familiar with the git and github stuff at all (I still use Subversion for my own stuff), and before I would figure this out curl probably would have reached version 9 already. 😃

bagder added a commit that referenced this issue Jul 28, 2023
... instead of --libs, as that one also returns -L flags.

Reported-by: Wilhelm von Thiele
Fixes #11538
@bagder bagder closed this as completed in 756c6a0 Jul 29, 2023
ptitSeb pushed a commit to wasix-org/curl that referenced this issue Sep 25, 2023
... instead of --libs, as that one also returns -L flags.

Reported-by: Wilhelm von Thiele
Fixes curl#11538
Closes curl#11539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants