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

Build error: Digest auth depends on base64 code but base64 code is not being included in build #12440

Closed
z2-2z opened this issue Dec 1, 2023 · 3 comments
Labels

Comments

@z2-2z
Copy link
Contributor

z2-2z commented Dec 1, 2023

I did this

I tried compiling curl at commit f5ba531 with the following commands:

autoreconf -fi
./configure  --enable-debug --disable-optimize --disable-werror --disable-symbol-hiding --without-ssl --disable-pthreads --disable-threaded-resolver --disable-http --enable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-mqtt --without-librtmp --without-zlib --without-zstd --without-brotli
make clean all

However, when the build system tries to link the curl executable I get the following linker error:

  CCLD     curl
/usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_base64_encode'
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

Curl_base64_encode() is used by auth_create_digest_http_message() in lib/vauth/digest.c but the base64 functions are not included because the following define rules from lib/base64.c don't evaluate to true:

#if !defined(CURL_DISABLE_HTTP_AUTH) || defined(USE_SSH) || \
  !defined(CURL_DISABLE_LDAP) || \
  !defined(CURL_DISABLE_SMTP) || \
  !defined(CURL_DISABLE_POP3) || \
  !defined(CURL_DISABLE_IMAP) || \
  !defined(CURL_DISABLE_DOH) || defined(USE_SSL) || defined(BUILDING_CURL)

If I understand this correctly it may be neccessary to add

!defined(CURL_DISABLE_DIGEST_AUTH)

to the code above because the digest auth also depends on the base64 code.

I expected the following

I expected there to be no linker errors since the configure script didn't throw an error about incompatible configuration options.

curl/libcurl version

Commit f5ba531

operating system

Arch Linux

@z2-2z z2-2z changed the title Linker error with certain combination of configuration options Digest auth depends on base64 code but base64 code is not being included in build Dec 1, 2023
@z2-2z z2-2z changed the title Digest auth depends on base64 code but base64 code is not being included in build Build error: Digest auth depends on base64 code but base64 code is not being included in build Dec 1, 2023
@jay
Copy link
Member

jay commented Dec 1, 2023

Makes sense. Do you want to make a PR?

@z2-2z
Copy link
Contributor Author

z2-2z commented Dec 2, 2023

Sure, I opened PR #12442

@jay jay closed this as completed in c44671e Dec 2, 2023
@jay
Copy link
Member

jay commented Dec 2, 2023

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants