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

/usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_md4it' #10110

Closed
esdrasdemorais opened this issue Dec 18, 2022 · 13 comments
Closed

Comments

@esdrasdemorais
Copy link

esdrasdemorais commented Dec 18, 2022

I tried compile in my Dell Laptop with Slackware Current Latest Version.

And this error happened after run make command:

/usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_md4it'

I expected the following

curl/libcurl version

[curl -V output]

curl 7.86.0 (x86_64-pc-linux-gnu) libcurl/7.86.0 OpenSSL/1.1.1q zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 c-ares/1.18.1 libidn2/2.3.3 libpsl/0.21.1 (+libidn2/2.3.3) libssh2/1.10.0 nghttp2/1.50.0
Release-Date: 2022-10-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

operating system

Linux darkstar.example.net 5.19.16 #1 SMP PREEMPT_DYNAMIC Sat Oct 15 14:42:05 CDT 2022 x86_64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz GenuineIntel GNU/Linux

@bagder bagder added the build label Dec 18, 2022
@bagder
Copy link
Member

bagder commented Dec 18, 2022

Please provide us with a full sequence of what you do when you build. You presumably did something before make.

@bagder
Copy link
Member

bagder commented Dec 18, 2022

If you cannot build it. How can you provide the curl -V output?

@bagder bagder changed the title /usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_md4it' #10104 /usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_md4it' Dec 18, 2022
@esdrasdemorais
Copy link
Author

esdrasdemorais commented Dec 19, 2022 via email

@esdrasdemorais
Copy link
Author

esdrasdemorais commented Dec 19, 2022 via email

@maxbritov
Copy link

Same for me

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/include -I../lib -I/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib -DBUILDING_LIBCURL -DCURL_HIDDEN_SYMBOLS -isystem /usr/include/nss -isystem /usr/include/nspr -fvisibility=hidden -O2 -march=native -pipe -Werror-implicit-function-declaration -c /var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c  -fPIC -DPIC -o .libs/libcurl_la-md4.o
/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c: In function 'Curl_md4it':
/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c:500:3: error: unknown type name 'MD4_CTX'
  500 |   MD4_CTX ctx;
      |   ^~~~~~~
/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c:502:3: error: implicit declaration of function 'MD4_Init'; did you mean 'md4_init'? [-Werror=implicit-function-declaration]
  502 |   MD4_Init(&ctx);
      |   ^~~~~~~~
      |   md4_init
/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c:503:3: error: implicit declaration of function 'MD4_Update'; did you mean 'md4_update'? [-Werror=implicit-function-declaration]
  503 |   MD4_Update(&ctx, input, curlx_uztoui(len));
      |   ^~~~~~~~~~
      |   md4_update
/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0/lib/md4.c:504:3: error: implicit declaration of function 'MD4_Final' [-Werror=implicit-function-declaration]
  504 |   MD4_Final(output, &ctx);
      |   ^~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [Makefile:2599: libcurl_la-md4.lo] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0-abi_x86_64.amd64/lib'
make[1]: *** [Makefile:1462: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/net-misc/curl-7.87.0/work/curl-7.87.0-abi_x86_64.amd64/lib'
make: *** [Makefile:1245: all-recursive] Error 1
 * ERROR: net-misc/curl-7.87.0::gentoo failed (compile phase):

@esdrasdemorais
Copy link
Author

esdrasdemorais commented Dec 22, 2022 via email

@maxbritov
Copy link

This code should always fail MD4 build with gnutls and openssl enabled

#if defined(USE_GNUTLS)
#include <nettle/md4.h>
/* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
#include <openssl/md4.h>
#endif

@bagder
Copy link
Member

bagder commented Dec 22, 2022

should?

I can build curl fine with both and it does not fail on this.

@maxbritov
Copy link

I can't :(
./configure --without-gnutls --with-openssl builds fine
./configure --with-gnutls --with-openssl fails with #10110 (comment)

@maxbritov
Copy link

also see gentoo issue https://bugs.gentoo.org/887833

@bagder
Copy link
Member

bagder commented Dec 22, 2022

I suggest that someone that can reproduce the problem works on a fix. I cannot reproduce.

@maxbritov
Copy link

May be you have openssl with OPENSSL_NO_MD4?

I see logic with my openssl 1.1.1:

#if defined(USE_GNUTLS)
true #include <nettle/md4.h>
#elif defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
skipped #include <wolfssl/openssl/md4.h>
#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
skipped #include <openssl/md4.h>
... skipped too
#endif

nettle/md4.h included, openssl/md4.h not

#if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
false
#elif defined(USE_OPENSSL) && !defined(OPENSSL_NO_MD4)
true
skipped  #elif defined(USE_GNUTLS)
...skipped
#endif /* CRYPTO LIBS */
void Curl_md4it(unsigned char *output, const unsigned char *input,
                const size_t len)
{
  MD4_CTX ctx;

  MD4_Init(&ctx);
  MD4_Update(&ctx, input, curlx_uztoui(len));
  MD4_Final(output, &ctx);
}

And MD4_CTX still unknown here because #elif defined(USE_GNUTLS) skipped.

bagder added a commit that referenced this issue Dec 22, 2022
Reported-by: Esdras de Morais da Silva

Fixes #10110
Closes #102..
@maxbritov
Copy link

For me it fixed. Curl is great again :)
Thanks!

@bagder bagder closed this as completed in aef4dc8 Dec 22, 2022
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.

3 participants