Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
./configure command with custom OpenSSL directory is ommitting any "-L" in the path #5519
I'm trying to build curl with OpenSSL installed in a custom directory using the command
and it gives the error
OpenSSL is installed in:
After reading the config.log file I found this part
Notice the gcc command is ommiting the "-L" part in the path "Project-Linux".
curl version is: 7.70.0
uname -a: Linux mosa-Inspiron-3593 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
When I build OpenSSL with a custom dir I get this logged:
I get similar logs with the correct directories (i.e. the "-L" in the path is not ommited).
After that the build script keeps performing checks.. the very first check goes like this (with the correct path passed to the gcc command)..
Then right after that this happens..
Notice the directory is supposed to be Project-Linux but the -L gets ommited.
I found this line in the configure file..
which does ommit the -L in the path.
But the "checking for HMAC_Update in -lcrypto" looks suspicious and is the true reason for your problem. Why does that fail? It looks like a pthread problem:
Removing the first
The build script as far as I understand, performs many checks that don't necessarily succeed, so the first check that fails is because of missing libraries (pthread and dl) in the compilation command.
I tried removing the line I mentioned above (the one that removes the
I'm using OpenSSL version 1.1.1g
Again, the problem happens when the OpenSSL path contains -L in it.
The linking command for this path should look like this
but after performing this line
Notice the A-L became just A.
So then isn't this the fix?
--- a/configure.ac +++ b/configure.ac @@ -1719,11 +1719,11 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno && AC_SUBST(SSL_LIBS) AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"]) - LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` + LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/^-L//'` dnl use the values pkg-config reported. This is here dnl instead of below with CPPFLAGS and LDFLAGS because we only dnl learn about this via pkg-config. If we only have dnl the argument to --with-ssl we don't know what
In the logic that works out if a given OpenSSL path works, it stripped off a possibly leading -L flag using an incorrect sed pattern which would remove all instances of -L in the string, including if the path itself contained that two-letter sequence! The same pattern was used and is now updated in multiple places. Now it only removes -L if it starts the strings. Reported-by: Mohamed Osama Fixes #5519