[FFmpeg-devel] [FFmpeg-cvslog] Merge commit '7cb1d9e2dbbe5bf4652be5d78cdd68e956fa3d63'

James Almer jamrial at gmail.com
Sat Oct 14 02:32:23 EEST 2017


On 10/13/2017 6:30 PM, Reino Wijnsma wrote:
> On 13-10-2017 18:48, James Almer <jamrial at gmail.com> wrote:
>> Are "-lshlwapi -lpthread -lcrypt32"
>> extralibs you added manually, or were they derived from dependencies
>> like libmpg123, vorbis, etc by pkg-config?
> My configure line up until now with the manually added extra-libs:
> 
> # ./configure --arch=x86 --target-os=mingw32
> --cross-prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-
> --pkg-config=pkg-config --pkg-config-flags=--static
> --extra-version=Reino --enable-gray --enable-version3 --disable-debug
> --disable-doc --disable-htmlpages --disable-manpages --disable-podpages
> --disable-schannel --disable-txtpages --disable-w32threads
> --enable-avisynth --enable-avresample --enable-fontconfig
> --enable-frei0r --enable-filter=frei0r --enable-gmp --enable-gnutls
> *--extra-libs=-lcrypt32* --enable-gpl --enable-libass --enable-libbluray
> --enable-libbs2b --enable-libcaca --extra-cflags=-DCACA_STATIC
> --enable-libfdk-aac --enable-libflite --enable-libfreetype
> --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc
> *--extra-libs=-lpthread* --enable-libmp3lame --enable-libmysofa
> --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenh264 --enable-libopenmpt *--extra-libs=-lshlwapi*
> --enable-libopus --enable-librubberband --enable-libsnappy
> --enable-libsoxr --enable-libspeex --enable-libtheora
> --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC
> --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis
> --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxavs --enable-libxml2 --enable-libxvid --enable-libzimg
> --enable-libzvbi --extra-cflags='-march=pentium3' --extra-cflags=-O2
> --extra-cflags='-mfpmath=sse' --extra-cflags=-msse --enable-static
> --disable-shared
> --prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
> 
>> See if adding -lstdc++ fixes it.
> It does.

Ok, fixing this way then.

Consider reporting this bug to libopenmpt, while at it. They should add
-lstdc++ to their pkg-config file for static builds, instead of projects
using the library having to workaround it.

> And since we're in the process of fixing the external library
> checks in 'configure', I've removed all --extra-libs and --extra-cflags
> entries from the configure line and I've made some changes to
> 'configure' until no more errors showed up.

Thanks a lot for that!

> 
> _Libcaca_
> 
> -enabled libcaca           && require_pkg_config libcaca caca caca.h
> caca_create_canvas
> +enabled libcaca           && require_pkg_config libcaca caca caca.h
> caca_create_canvas -DCACA_STATIC && add_cppflags -DCACA_STATIC
> (see
> <https://github.com/Reino17/ffmpeg-windows-build-helpers/blob/master/cross_compile_ffmpeg.sh#L1652-L1653>https://github.com/Reino17/ffmpeg-windows-build-helpers/blob/master/cross_compile_ffmpeg.sh#L1652-L1653
> )
> 
> Otherwise you'll get "undefined reference to `_imp__caca_create_canvas'"
> and "ERROR: caca not found using pkg-config".

This i will not touch. It's unrelated to the commit that revamped the
dependency checking code and is something the maintainer of the libcaca
wrapper should solve.

> 
> _Libilbc_
> 
> On 13-10-2017 20:09, James Almer <jamrial at gmail.com> wrote:
>> With this, the check will include the needed pthreads ldflags when
>> pkg-config is invoked with the --static flag.
> My 'libilbc.pc' doesn't include -lpthread at all. Adding it here
> manually works for me.

It doesn't? That's weird, seeing "Libs.private: @PTHREAD_LIBS@" is
listed in the source package.

> 
> -enabled libilbc           && require libilbc ilbc.h
> WebRtcIlbcfix_InitDecode -lilbc
> +enabled libilbc           && require_pkg_config libilbc libilbc ilbc.h
> WebRtcIlbcfix_InitDecode -lpthread

This doesn't work as is. -lpthread will be used as part of the check,
but afterwards it will not be added to libilbc's ldflags.
require_pkg_config() doesn't work the same as require(), for some reason.

I'll keep the current non pkg-config check then and add the pthreads
ldflag to it.

> 
> _Libmodplug_
> 
> -enabled libmodplug        && require_pkg_config libmodplug libmodplug
> libmodplug/modplug.h ModPlug_Load
> +enabled libmodplug        && require_pkg_config libmodplug libmodplug
> libmodplug/modplug.h ModPlug_Load -DMODPLUG_STATIC && add_cppflags
> -DMODPLUG_STATIC

Again, i'll not change this. Needing project specific pre-processor
flags is unrelated.

> 
> Although I've replaced libmodplug for libopenmpt, I know FFmpeg's
> 'configure' needs this. I don't know the "undefined reference"-message
> anymore.
> 
> _Libopenmpt_
> 
> -enabled libopenmpt        && require_pkg_config libopenmpt "libopenmpt
>>= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
> +enabled libopenmpt        && require_pkg_config libopenmpt "libopenmpt
>>= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++
> -lshlwapi
> 
> Adding -lstdc++ fixes the 12000 errors I mentioned earlier, but without
> -lshlwapi you'd still get:
> 
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xcb):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x224):
> undefined reference to `_imp__PathIsUNCW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x4e9):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x670):
> undefined reference to `_imp__PathIsUNCW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xd4b):
> undefined reference to `_imp__PathCombineW at 12'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xf1b):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x10c4):
> undefined reference to `_imp__PathIsUNCW at 4'

Another lib they have to add to their pkg-config file then... This one
seems to be Windows specific, though.

Will add -lstdc++ for now.

> 
> _Librubberband_
> 
> -enabled librubberband     && require_pkg_config librubberband
> "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
> +enabled librubberband     && require_pkg_config librubberband
> "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++
> 
> Same sort of error-messages as with libopenmpt.

Another broken pkg-config file...

Will add the flag as a workaround.

> 
> _Libsnappy_
> 
> -enabled libsnappy         && require libsnappy snappy-c.h
> snappy_compress -lsnappy
> +enabled libsnappy         && require libsnappy snappy-c.h
> snappy_compress -lsnappy -lstdc++
> 
> Same sort of error-messages as with libopenmpt.

Will add the flag, thanks.

> 
> _Libtwolame_
> 
> -enabled libtwolame        && require libtwolame twolame.h twolame_init
> -ltwolame &&
> +enabled libtwolame        && require libtwolame twolame.h twolame_init
> -ltwolame -DLIBTWOLAME_STATIC && add_cppflags -DLIBTWOLAME_STATIC &&
> 
> Otherwise you'll get "undefined reference to `_imp__twolame_init'" and
> "ERROR: libtwolame not found".

Again, not going to change this.

> 
> _Libzvbi_
> 
> -enabled libzvbi           && require libzvbi libzvbi.h vbi_decoder_new
> -lzvbi &&
> +enabled libzvbi           && require_pkg_config libzvbi zvbi-0.2
> libzvbi.h vbi_decoder_new &&
> 
> Otherwise you'll get lots of "undefined reference to
> `pthread_mutex_[...]'" errors.
> 
> zvbi-0.2.pc:
> 
> prefix=/cygdrive/[...]
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> 
> Name: ZVBI
> Description: VBI Capturing and Decoding Library
> Requires:
> Version: 0.2.35
> Libs: -L${libdir} -lzvbi -lm -lpthread -lwsock32  -lpthread  -lm -liconv
> Cflags: -I${includedir}
> 
> This way all the libraries get loaded, including -lpthread.

Yeah, this one definitely needs to switch to pkg-config, so i did that.
Thanks.

> 
> 
> And this works. No more errors during ./configure, but then...
> 
> [...]
> CC      fftools/ffmpeg_cuvid.o
> LD      ffmpeg_g.exe
> /cygdrive/[...]/lib/libgnutls.a(sha256-ssse3-x86.o): warning: common of
> `_gnutls_x86_cpuid_s' overridden by definition
> /cygdrive/[...]/lib/libgnutls.a(x86-common.o): warning: defined here
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xcb):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x224):
> undefined reference to `_imp__PathIsUNCW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x4e9):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x670):
> undefined reference to `_imp__PathIsUNCW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xd4b):
> undefined reference to `_imp__PathCombineW at 12'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0xf1b):
> undefined reference to `_imp__PathIsRelativeW at 4'
> /cygdrive/[...]/lib/libmpg123.a(compat.o):compat.c:(.text+0x10c4):
> undefined reference to `_imp__PathIsUNCW at 4'

These are from -lshlwapi.

> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0xe66):
> undefined reference to `_imp__CertGetCertificateContextProperty at 16'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x1652):
> undefined reference to `_imp__CertOpenSystemStoreA at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x168e):
> undefined reference to `_imp__CertFindCertificateInStore at 24'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x16b1):
> undefined reference to `_imp__CertGetCertificateContextProperty at 16'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x192d):
> undefined reference to `_imp__CertFreeCertificateContext at 4'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x193f):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2167):
> undefined reference to `_imp__CertOpenSystemStoreA at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x21a3):
> undefined reference to `_imp__CertFindCertificateInStore at 24'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x21f0):
> undefined reference to `_imp__CertFreeCertificateContext at 4'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x221d):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x23ad):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x249f):
> undefined reference to `_imp__CertOpenSystemStoreA at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x255b):
> undefined reference to `_imp__CertEnumCertificatesInStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x26db):
> undefined reference to `_imp__CertOpenSystemStoreA at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2735):
> undefined reference to `_imp__CertFindCertificateInStore at 24'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x277b):
> undefined reference to `_imp__CertGetCertificateContextProperty at 16'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x27cd):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x286f):
> undefined reference to `_imp__CertDeleteCertificateFromStore at 4'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2ab5):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2d70):
> undefined reference to `_imp__PFXImportCertStore at 12'
> /cygdrive/[...]/lib/libgnutls.a(keys-win.o):keys-win.c:(.text+0x2e7f):
> undefined reference to `_imp__CertFindCertificateInStore at 24'
> /cygdrive/[...]/lib/libgnutls.a(certs.o):certs.c:(.text+0xe0): undefined
> reference to `_imp__CertOpenSystemStoreA at 8'
> /cygdrive/[...]/lib/libgnutls.a(certs.o):certs.c:(.text+0xf5): undefined
> reference to `_imp__CertEnumCertificatesInStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(certs.o):certs.c:(.text+0x1fb):
> undefined reference to `_imp__CertCloseStore at 8'
> /cygdrive/[...]/lib/libgnutls.a(certs.o):certs.c:(.text+0x230):
> undefined reference to `_imp__CertOpenSystemStoreA at 8'

And these from -lcrypt32

You had those two as custom extra-ldflags before the commit that
introduced all these issues, or had to start doing it after it?

> collect2: error: ld returned 1 exit status
> make: *** [Makefile:107: ffmpeg_g.exe] Error 1
> 
> ...and I have no idea yet why this is happening.>
> -- Reino



More information about the ffmpeg-devel mailing list