libhttpserver
libhttpserver copied to clipboard
[BUG] linking libhttpserver might fail depending on configuration of libmicrohttpd
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
- configure libmicrohttpd with
--disable-dauth
, build and install it - build libhttpserver against that libmicrohttpd
- 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.
bump, same errors while linking using msys2 but i use the precompiled libraries from unofficial repo of libmicrohttpd