Skip to content

[BUG] linking libhttpserver might fail depending on configuration of libmicrohttpd #232

@LeSpocky

Description

@LeSpocky

Prerequisites

Description

When linking libhttpserver from an application, linker errors might pop up depending on how libmicrohttpd was configured.

We discovered this when building a custom application in a custom embedded board support package based on ptxdist using the distributed (backported) package rules for libmicrohttpd.

Steps to Reproduce

  1. configure libmicrohttpd with --disable-dauth, build and install it
  2. build libhttpserver against that libmicrohttpd
  3. link your application against libhttpserver only, but not against libmicrohttpd

Expected behavior:

The application should not need to link libmicrohttpd by itself, because it's only a private dependency of libhttpserver.

Actual behavior:

Link errors happen, when building the application, like this:

…/sysroot-target/usr/lib/libhttpserver.so: undefined reference to `MHD_digest_auth_get_username'
…/sysroot-target/usr/lib/libhttpserver.so: undefined reference to `MHD_queue_auth_fail_response'
…/sysroot-target/usr/lib/libhttpserver.so: undefined reference to `MHD_digest_auth_check'

Reproduces how often: always

Versions

  • custom embedded linux build with ptxdist 2018.05.0, kernel 4.9, gcc 4.9, glibc 2.20 (oselas toolchain 2014.12.x)
  • libhttpserver version 0.18.1, compiled with custom ptxdist package
  • libmicrohttpd version 0.9.66, compiled with backported package from ptxdist master

If you have problems during build:

  • cross compiling toolchain
    • OSELAS.Toolchain-2014.12.2
    • arm-v5te-linux-gnueabi
    • gcc-4.9.2-glibc-2.20-binutils-2.24-kernel-3.16
  • autotools version
    • autoconf-2.69
    • automake-1.15.1

Additional Information

I know it's hard to get our exact build environment, but I assume the bug description good enough to see what's going on.

Linking libhttpserver from the application works, if libmicrohttpd is configured with --enable-dauth. However if libhttpserver unconditionally uses symbols which are optional in libmicrohttpd, it should check on that.

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions