libhttpserver icon indicating copy to clipboard operation
libhttpserver copied to clipboard

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

Open LeSpocky opened this issue 3 years ago • 1 comments

Prerequisites

  • [x] Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues

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.

LeSpocky avatar Apr 22 '21 07:04 LeSpocky

bump, same errors while linking using msys2 but i use the precompiled libraries from unofficial repo of libmicrohttpd

BlueGradientHorizon avatar May 09 '22 12:05 BlueGradientHorizon