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

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

Open
1 task done
LeSpocky opened this issue Apr 22, 2021 · 1 comment
Open
1 task done
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@LeSpocky
Copy link
Contributor

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.

@LeSpocky LeSpocky added the bug Confirmed bugs or reports that are very likely to be bugs. label Apr 22, 2021
@LeSpocky LeSpocky mentioned this issue Jan 19, 2022
6 tasks
@BlueGradientHorizon
Copy link

BlueGradientHorizon commented May 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

3 participants