Skip to content

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

@z2-2z

Description

@z2-2z

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions