On Tue, Oct 13, 2015 at 11:56 AM, Christophe Gisquet
<[email protected]> wrote:
> Hi
>
> 2015-10-06 12:41 GMT+02:00 Hendrik Leppkes <[email protected]>:
>> +static av_unused int pthread_once(pthread_once_t *once_control, void 
>> (*init_routine)(void))
> [...]
>> +                MemoryBarrier();
>
> This resolves to _mm_mfence() which results (see configuration below)
> in an undefined symbol (paths redacted):
> ffmpeg/compat/w32pthreads.h:202: undefined reference to `_mm_mfence'
> libavformat/libavformat.a(async.o): In function `w32thread_once_fallback':
> ffmpeg/compat/w32pthreads.h:202: undefined reference to `_mm_mfence'
> libavcodec/libavcodec.a(pthread_frame.o): In function 
> `w32thread_once_fallback':
> ffmpeg/compat/w32pthreads.h:202: undefined reference to `_mm_mfence'
> libavcodec/libavcodec.a(pthread_slice.o): In function 
> `w32thread_once_fallback':
> ffmpeg/compat/w32pthreads.h:202: undefined reference to `_mm_mfence'
> ffmpeg/compat/w32pthreads.h:202: undefined reference to `_mm_mfence'
> libavcodec/libavcodec.a(vp8.o):ffmpeg/compat/w32pthreads.h:202: more
> undefined references to `_mm_mfence' follow
>
> Configuration:
> In a MSYS2 Mingw32 shell
> gcc version 5.2.0 (Rev4, Built by MSYS2 project), target: x86_64-w64-mingw32
> Exact configure line:
> ../configure --disable-ffplay --disable-ffprobe --disable-ffserver \
>   --disable-hwaccels --disable-dxva2 \
>   --extra-cflags="-msse4.2" --cc="ccache gcc"
>
> The above command-line is fine for the equivalent Win64 configuration.
> Removing --extra-cflags fixes the issue. Adding -msse2 to it causes
> the same compilation error.
>
> MSVC has platform-specific implementations of MemoryBarrier() which
> may resolve to the SSE2 mfence instruction. I'm not sure if
> --extra-cflags="-msse4.2" cannot be expected to always work, or if
> there's another issue here.
>

Why would adding -msse4.2 hide the symbol? Sounds like you should
complain to mingw.

In the meantime we could add an ugly ifdef for mingw/gcc and use
__sync_synchronize there instead (the gcc built-in)

- Hendrik
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to