Skip to content

[libgnutls] Static use depends on -ldl, not carried in pc file #17650

@dg0yt

Description

@dg0yt

Describe the bug
While trying to update port libmicrohttpd, I stumbled over unresolved symbols when using static build of port libgnutls in config.log:

configure:24362: checking whether GnuTLS is usable
configure:24385: gcc -o conftest -I/home/kpa/Projekte/installed/x64-linux/debug/lib/pkgconfig/../../../include -fPIC -g -fno-strict-aliasing  -L/home/kpa/Projekte/installed/x64-linux/debug/lib  conftest.c  -L/home/kpa/Projekte/installed/x64-linux/debug/lib/pkgconfig/../../lib -lgnutls -pthread -ltspi -lgmp -latomic -lhogweed -lgmp -lnettle -ltasn1 -lidn2 >&5
/home/kpa/Projekte/installed/x64-linux/debug/lib/libgnutls.a(tpm.o): In function `check_init':
/home/kpa/Projekte/buildtrees/libgnutls/x64-linux-dbg/lib/.././../src/3.6.15-4050d06d46.clean/lib/tpm.c:123: undefined reference to `dlopen'
/home/kpa/Projekte/buildtrees/libgnutls/x64-linux-dbg/lib/.././../src/3.6.15-4050d06d46.clean/lib/tpm.c:129: undefined reference to `dlsym'
/home/kpa/Projekte/buildtrees/libgnutls/x64-linux-dbg/lib/.././../src/3.6.15-4050d06d46.clean/lib/tpm.c:129: undefined reference to `dlclose'
...
collect2: error: ld returned 1 exit status
...
configure:24397: result: no
configure:24407: WARNING: pkg-config reports that GnuTLS is present, but GnuTLS can't be used

I'm not sure if this is desired for the static build, or if it is just a bug in the .pc files.

Environment

  • OS: linux
  • Triplet: default (x64-linux)

To Reproduce

  1. Add libgnutls dependency to libmicrohttpd
  2. Add --with-https to OPTIONS for vcpkg_configure_make in libmicrohttpd portfile.
  3. ./vcpkg install libmicrohttpd
  4. Inspect config.log

Expected behavior
No undefined references when consuming libgnutls via .pc files in a static build

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions