[gnutls-devel] Link to -lcrypt32 in pkg-config file as well

Reino Wijnsma rwijnsma at xs4all.nl
Sun Mar 4 15:50:45 CET 2018


Hello gnutls-devs,

I'm cross-compiling FFmpeg with GnuTLS (on Windows using Cygwin, MinGW and GCC) for TLS 1.2 support.
Without intervention FFmpeg's configure would always fail:

/cygdrive/m/[...]/bin/i686-w64-mingw32-gcc -Wl,--large-address-aware -Wl,--nxcompat,--dynamicbase -Wl,--as-needed -Wl,--pic-executable,-e,_mainCRTStartup -I/cygdrive/m/[...]/i686-w64-mingw32/include -L/cygdrive/m/[...]/i686-w64-mingw32/lib -o /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.c6JidCYd/test.exe /cygdrive/c/DOCUME~1/Admin/LOCALS~1/Temp/ffconf.c6JidCYd/test.o -lgnutls -lws2_32 -lgmp -lhogweed -lgmp -lnettle
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0xe55): undefined reference to `_imp__CertGetCertificateContextProperty at 16'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x1662): undefined reference to `_imp__CertOpenSystemStoreA at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x169e): undefined reference to `_imp__CertFindCertificateInStore at 24'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x16ca): undefined reference to `_imp__CertGetCertificateContextProperty at 16'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x1932): undefined reference to `_imp__CertFreeCertificateContext at 4'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x1944): undefined reference to `_imp__CertCloseStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2167): undefined reference to `_imp__CertOpenSystemStoreA at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x21a3): undefined reference to `_imp__CertFindCertificateInStore at 24'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x21f0): undefined reference to `_imp__CertFreeCertificateContext at 4'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x221d): undefined reference to `_imp__CertCloseStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x23ad): undefined reference to `_imp__CertCloseStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x249f): undefined reference to `_imp__CertOpenSystemStoreA at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x255b): undefined reference to `_imp__CertEnumCertificatesInStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x26db): undefined reference to `_imp__CertOpenSystemStoreA at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x26f5): undefined reference to `_imp__CertFindCertificateInStore at 24'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2777): undefined reference to `_imp__CertGetCertificateContextProperty at 16'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x27cc): undefined reference to `_imp__CertCloseStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2874): undefined reference to `_imp__CertDeleteCertificateFromStore at 4'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2ab5): undefined reference to `_imp__CertCloseStore at 8'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2d70): undefined reference to `_imp__PFXImportCertStore at 12'
/cygdrive/m/[...]/i686-w64-mingw32/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2e7f): undefined reference to `_imp__CertFindCertificateInStore at 24'
collect2: error: ld returned 1 exit status
ERROR: gnutls not found using pkg-config

I've always had to update 'gnutls.pc.in':

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: GnuTLS
Description: Transport Security Layer implementation for the GNU system
URL: http://www.gnutls.org/
Version: @VERSION@
Libs: -L${libdir} -lgnutls
Libs.private: @LIBINTL@ @LIBSOCKET@ @LIBNSL@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBIDN2_LIBS@ *-lcrypt32*
@GNUTLS_REQUIRES_PRIVATE@
Cflags: -I${includedir}

or configure FFmpeg with --extra-libs=-lcrypt32 to correct this.

In 'lib/Makefile.am' I did notice:

if WINDOWS
thirdparty_libadd += -lcrypt32
endif

and in 'lib/.libs/libgnutls.lai' I did notice:

# Libraries that this one depends upon.
dependency_libs=' -lws2_32 -L/cygdrive/m/[...]/i686-w64-mingw32/lib -lhogweed -lnettle /cygdrive/m/[...]/i686-w64-mingw32/lib/libgmp.la -lcrypt32'

but as FFmpeg only checks the pkg-config file, I believe 'gnutls.pc.in' is this case is in need of an update.

-- Reino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20180304/608dd12b/attachment.html>


More information about the Gnutls-devel mailing list