[FFmpeg-devel] Building with all threading disabled still results in avutil-55.dll dependency on pthreadGC-3.dll

Gregory J Wolfe gregory.wolfe at kodakalaris.com
Thu Nov 17 22:50:10 EET 2016


> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On
> Behalf Of Gregory J Wolfe
> Sent: Thursday, November 17, 2016 2:10 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] Building with all threading disabled still results
> in avutil-55.dll dependency on pthreadGC-3.dll
> 
> I am building FFmpeg using msys/MinGW on Windows 7 for use on
> Windows systems.  I **want** the resulting DLLs to have threading
> enabled, but no matter what I do the avutil DLL has a dependency on
> MinGW library pthreadGC-3.dll.  For deployment purposes we do not
> want the destination system to have to have any MinGW components
> installed.  Even the following configuration does not eliminate this
> dependency (config.log attached):
> 
> ../configure --enable-shared --disable-static --enable-memalign-hack -
> -enable-libmp3lame --enable-libopenh264 --extra-ldflags=-static-libgcc
> --disable-iconv --enable-nvenc --disable-w32threads --disable-
> pthreads
> 
> Even though all threading support has been (theoretically) disabled,
> the dependency walker shows that the avutil DLL depends on the
> following symbols:
> 
> _sched_affinitycpucount
> _sched_affinitycpuzero
> sched_getaffinity
> 
> I tried using -static as an additional CFLAG/LDFLAG, but then configure
> command does not find the libopenh264 DLL.  So I think what I need to
> do is to modify the compile/link commands for the avutil DLL ONLY
> such that it statically links in threading support.  Is this possible through
> the configure command?  Any other suggestions out there?

Found the answer to the easy question.  In libavutil/cpu.c, all of the thread
related code should be surrounded by #if HAVE_THREADS, so that if all
thread support is disabled the code will not attempt to query how may
processors there are, etc.

On to the more difficult question of removing the dependency when
threading is desired ...

> 
> Greg Wolfe
> Kodak Alaris
> 



More information about the ffmpeg-devel mailing list