Menu

#1136 win32 build fails with --enable-static-ffmpeg

v3.6
closed-fixed
compyx
None
GTK3
Buildsystem
2021-12-30
2019-07-27
Retroplay
No

MSYS2 32-bit, up-to-date as of July 27th 2019, GCC 9.1.0.

# gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys32\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-9.1.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --enable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 9.1.0 (Rev3, Built by MSYS2 project)

Fails each and every time with --enable-static-ffmpeg enabled:

C:/msys32/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/include/xmmintrin.h:244:1: error: inlining failed in call to always_inline '_mm_and_ps': target specific option mismatch
  244 | _mm_and_ps (__m128 __A, __m128 __B)
      | ^~~~~~~~~~
xmm_quantize_sub.c:89:29: note: called from here
   89 |             vec_tmp._m128 = _mm_and_ps(vec_tmp._m128, vec_fabs_mask); /* fabs */
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[7]: *** [Makefile:319: xmm_quantize_sub.lo] Error 1
make[6]: *** [Makefile:547: all-recursive] Error 1
make[5]: *** [Makefile:349: all-recursive] Error 1
make[4]: *** [Makefile:276: all] Error 2
make[3]: *** [Makefile:778: all-recursive] Error 1
make[2]: *** [Makefile:2001: all-recursive] Error 1
make[1]: *** [Makefile:1756: all] Error 2
make: *** [Makefile:499: all-recursive] Error 1

I've even tried with a fresh Windows 7 x86 install in VirtualBox to rule out any "interference" with my real x86_64 setup.
Compyx mentioned he used GCC 8.3.0 and I'm on latest 9.1.0, perhaps that's something to with it?

I'd also like to mention that I have to edit lines 238, 240, 244, 246 in /vice/lib/ffmpeg/configure.gnu to actually finish configure successfully.
I remove --enable-libmp3lame --enable-libx264, if not configure fails with "ERROR: libmp3lame >= 3.98.3 not found".

Discussion

1 2 > >> (Page 1 of 2)
  • compyx

    compyx - 2019-07-27

    I updated msys2 and have gcc 9.1 now. With 64-bit mingw ffmeg compiles and links. 32-bit mingw bitches about "No working C compiler found.".
    This can probably be fixed, but ffmpeg should be on the way out, and so should 32-bit Windows.

     
  • Greg King

    Greg King - 2019-08-22

    I'd also like to mention that I have to edit lines 238, 240, 244, 246 in "/vice/lib/ffmpeg/configure.gnu" to actually finish configure successfully. I remove --enable-libmp3lame --enable-libx264; if not, configure fails with "ERROR: libmp3lame >= 3.98.3 not found".

    You must enable static LAME, too:
    --enable-static-lame --enable-static-ffmpeg.

    These patches will allow people to build the 32-bit version of static FFMPEG:

     
  • compyx

    compyx - 2019-08-27
    • status: open --> closed-fixed
     
  • compyx

    compyx - 2019-08-27

    Patch applied and commited. Seems to run fine on Win10 and Win7.

    Closing.

     
  • Greg King

    Greg King - 2019-08-28

    It builds and runs with the SDL2 UI, also.

     
  • Retroplay

    Retroplay - 2019-08-28

    Do I need to install any specific dependencies for i686 to make this work ?
    Configure works and it seemed to compile, but then this happened (from a fresh SVN checkout)..
    64-bit is good, as usual.

    ./configure --disable-arch --enable-native-gtk3ui --enable-static-lame --enable-static-ffmpeg --enable-realdevice --enable-cpuhistory --enable-x64 --enable-native-tools

    I had to snip as the log is filled to the brim with "undefined reference" errors/warnings.
    [snip]

    F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld.exe: F:\msys64\src\vice\src\lib\libffmpeg/libavcodec/wma.c:206: undefined reference to `ff_wma_critical_freqs'
    F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld.exe: F:\msys64\src\vice\src\lib\libffmpeg/libavcodec/wma.c:240: undefined reference to `ff_wma_critical_freqs'
    F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld.exe: ../src/lib/libffmpeg/libavcodec/libavcodec.a(aacps.o): in function `ff_ps_read_data':
    F:\msys64\src\vice\src\lib\libffmpeg/libavcodec/aacps.c:197: undefined reference to `ff_log2_tab'
    collect2.exe: error: ld returned 1 exit status
    make[3]: *** [Makefile:1920: xscpu64.exe] Error 1
    make[2]: *** [Makefile:2018: all-recursive] Error 1
    make[1]: *** [Makefile:1773: all] Error 2
    make: *** [Makefile:502: all-recursive] Error 1
    
     

    Last edit: Retroplay 2019-08-29
  • Greg King

    Greg King - 2019-08-29

    ff_wma_critical_freqs[] is defined by "vice/src/lib/libffmpeg/libavcodec/wma_freqs.c".
    ff_log2_tab[] is defined by "vice/src/lib/libffmpeg/libavutil/log2_tab.c".

    It's strange that those errors showed so late. Apparently, "x64.exe", "x64sc.exe", and "x64dtv.exe" were linked successfully. I don't know what made "xscpu64.exe" different -- as far as FFMPEG is concerned.

    Please see if a simpler configuration can be built:

    make clean
    ./configure --disable-arch --enable-static-lame --enable-static-ffmpeg --enable-x64
    make
    
     
  • gpz

    gpz - 2019-08-29

    i'd check if the link order is different in xscpu64 for some reason

     
  • compyx

    compyx - 2019-08-29
    • status: closed-fixed --> open
    • Version: v3.3 --> v3.x
     
  • compyx

    compyx - 2019-08-29

    I used gcc 9.1 (not 8.3) in the 'Mingw-w64 32 bit' shell, with the following configure line:

    ./configure --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug --enable-static-ffmpeg --enable-static-lame --enable-arch=no
    
     
  • Retroplay

    Retroplay - 2019-08-29

    Ok, I tried with your config, Greg King, still fails but this time it's not at xscpu64.exe but x64.exe where it stops.
    ./configure --disable-arch --enable-static-lame --enable-static-ffmpeg --enable-x64

    F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld.exe: ../src/lib/libffmpeg/libavcodec/libavcodec.a(aacps.o): in function `ff_ps_read_data':
    F:\msys64\src\vice\src\lib\libffmpeg/libavcodec/aacps.c:197: undefined reference to `ff_log2_tab'
    collect2.exe: error: ld returned 1 exit status
    make[3]: *** [Makefile:1892: x64.exe] Error 1
    make[2]: *** [Makefile:2018: all-recursive] Error 1
    make[1]: *** [Makefile:1773: all] Error 2
    make: *** [Makefile:502: all-recursive] Error 1
    

    compyx config, this time it stops at x64sc.exe:
    ./configure --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug --enable-static-ffmpeg --enable-static-lame --enable-arch=no

    F:/msys64/mingw32/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld.exe: ../src/lib/libffmpeg/libavcodec/libavcodec.a(aacps.o): in function `ff_ps_read_data':
    F:\msys64\src\vice\src\lib\libffmpeg/libavcodec/aacps.c:197: undefined reference to `ff_log2_tab'
    collect2.exe: error: ld returned 1 exit status
    make[3]: *** [Makefile:1900: x64sc.exe] Error 1
    make[2]: *** [Makefile:2018: all-recursive] Error 1
    make[1]: *** [Makefile:1773: all] Error 2
    make: *** [Makefile:502: all-recursive] Error 1
    

    What's weird is that 64-bit binaries builds fine with FFMPEG enabled, luckily 32-bit OS is a dying breed.

     

    Last edit: Retroplay 2019-08-29
  • compyx

    compyx - 2019-08-29

    Do have any CPPFLAGS, CFLAGS, CXXFLAGS or LDFLAGS set in your environment? Check the output of ./configure, at the end there should be list of user/env-set CFLAGS etc and a list of CFLAGS set by VICE.
    Though I think the static ffmpeg lib uses its own configure.

     
  • Retroplay

    Retroplay - 2019-08-29

    No, everything is vanilla, the only thing I've added was export miktex/pdftex to .bashrc, that's all.
    Here's the config summary:

    ./configure --disable-arch --enable-native-gtk3ui --enable-static-lame --enable-static-ffmpeg --enable-realdevice --enable-cpuhistory --enable-x64 --enable-native-tools
    
    configure summary:
    
    Platform canonical: i686-w64-mingw32
    Architecture      : Win32-GTK3 (treated as Unix)
    GUI               : NATIVE GTK3
    
    SCREEN/UI
    ---------
    Hardware scaling support       : yes
    Cairo rendering support        : yes
    
    SOUND
    -----
    PortAudio sound input support: no  (--enable/disable-portaudio)
    OSS sound support            : no  (--with/without-oss)
    ALSA sound support           : no  (--with/without-alsa)
    Pulseaudio sound support     : no  (--with/without-pulse)
    DirectX sound support        : yes
    SDL sound support            : no  (--with/without-sdlsound)
    NetBSD/Solaris sound support : no
    MIDI support                 : yes (--enable/disable-midi)
    Catweasel MK3 support        : yes (--enable/disable-catweasel)
    HardSID support              : yes (--enable/disable-hardsid)
    ParSID support               : yes (--enable/disable-parsid)
    SSI2001 support              : yes (--enable/disable-ssi2001)
    direct I/O access support    : no
    lpt port access              : no
    PCI utils support            : no
    MP3 encoding support         : yes (--enable/disable-lame)
    MP3 decoding support         : no
    FLAC en/de-coding support    : no
    OGG en/de-coding support     : yes
    
    SCREENSHOTS
    -----------
    GIF encoding support : yes (--with/without-gif)
    JPEG encoding support: yes (--with/without-jpeg)
    PNG encoding support : yes (--with/without-png)
    
    VIDEO RECORDING
    ---------------
    FFMPEG support                : yes (--enable-shared-ffmpeg/--enable-static-ffmpeg/--enable-external-ffmpeg)
    FFMPEG swscale support        : yes
    FFMPEG swresample support     : no
    FFMPEG avresample support     : no
    included shared FFMPEG support: no  (--enable-shared-ffmpeg)
    included static FFMPEG support: yes (--enable-static-ffmpeg)
    
    INPUT
    -----
    Mouse support               : yes
    Lightpen support            : yes
    Linux style joystick support: no
    BSD style joystick support  : no
    Digital joystick support    : no
    USB joystick support        : no
    DirectInput joystick support: yes
    
    MODEM/NETWORK
    -------------
    RS232 device support             : yes (--enable/disable-rs232)
    Network support                  : yes
    RS232 network support            : yes
    IPv6 network support             : no  (--enable/disable-ipv6)
    Network capture/injection support: no  (--enable/disable-ethernet)
    
    DRIVE
    -----
    Raw drive support: no
    Real device (OpenCBM support): yes (--enable/disable-realdevice)
    
    LIBS
    ----
    Dynamic linking support: yes
    Zlib support           : yes (--with/without-zlib)
    Libieee1284 support    : no
    
    MISC
    ----
    ReSID support              : yes (--with/without-resid)
    65xx CPU history support   : yes (--enable/disable-cpuhistory)
    Debug support              : no  (--enable/disable-debug)
    Embedded data files support: no  (--enable/disable-embedded)
    Build old x64 emulator     : yes (--enable/--disable-x64)
    
    User CPPFLAGS:
    VICE_CPPFLAGS:  -DNDEBUG
    User CFLAGS:
    VICE CFLAGS:   -g -O3 -Wall -Wformat -Wformat-signedness -Wshadow -Wpointer-arith -Wuninitialized -Wunreachable-code -Wno-unused-parameter -Werror=implicit-function-declaration -Wfatal-errors -Wall -Wno-unused-parameter -Wno-sign-compare -mms-bitfields -IF:/msys64/mingw32/include/glib-2.0 -IF:/msys64/mingw32/lib/glib-2.0/include -IF:/msys64/mingw32/include -pthread -mms-bitfields -IF:/msys64/mingw32/include/gtk-3.0 -IF:/msys64/mingw32/include/cairo -IF:/msys64/mingw32/include -IF:/msys64/mingw32/include/pango-1.0 -IF:/msys64/mingw32/include/fribidi -IF:/msys64/mingw32/include -IF:/msys64/mingw32/include/atk-1.0 -IF:/msys64/mingw32/include/cairo -IF:/msys64/mingw32/include/pixman-1 -IF:/msys64/mingw32/include -IF:/msys64/mingw32/include/freetype2 -IF:/msys64/mingw32/include -IF:/msys64/mingw32/include/harfbuzz -IF:/msys64/mingw32/include/libpng16 -IF:/msys64/mingw32/include/gdk-pixbuf-2.0 -IF:/msys64/mingw32/include/libpng16 -IF:/msys64/mingw32/include -IF:/msys64/mingw32/lib/libffi-3.2.1/include -IF:/msys64/mingw32/include/glib-2.0 -IF:/msys64/mingw32/lib/glib-2.0/include -IF:/msys64/mingw32/include
    User CXXFLAGS:
    VICE CXXFLAGS: -g -O3 -Wall -Wformat -Wshadow -Wpointer-arith -Wuninitialized -Wunreachable-code -Wno-unused-parameter -Werror=implicit-function-declaration -Wfatal-errors  -Wall -Wno-unused-parameter -Wno-sign-compare -std=c++11 -Wno-nonnull-compare
    VTE_CXXFLAGS:   -Wno-address-of-packed-member -Wno-char-subscripts -Wno-format-signedness
    User LDFLAGS:   -L/mingw32/lib/vice/lib
    VICE LDFLAGS:
    (didn't get around to LDFLAGS yet)
    ----------------------------------------------------------------------
    
     
  • compyx

    compyx - 2019-08-29

    That output looks fine. I just tried compiling 32-bit Gtk3 again with:

    ./configure --disable-arch --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug --enable-static-ffmpeg --enable-static-lame
    

    Guessing perhaps the --disable-arch caused problems, but it still compiles fine. Well, lot's of warnings about ffmpeg, but that's to be expected with that old in-tree source.

    Using:

    $ tail -n 1 /var/log/pacman.log
    [2019-08-13 14:07] [ALPM] transaction completed
    

    Seems to indicate my last update of msys2 was two weeks ago. I'll update and if that triggers any errors.

     
  • Retroplay

    Retroplay - 2019-08-29

    If you use MSYS to build other stuff, e.g MAME, I'll advice to stay on 9.1.0 for the time being.
    GCC 9.2.0 packages from MSYS repo is flakey.
    https://github.com/mamedev/mame/issues/5484

    I got some cc1plus.exe warnings when building Win64 VICE, I did build though and seemed to work well as far as I could tell.
    Just a FYI.

     
  • compyx

    compyx - 2019-08-30

    Thanks for the heads up, so I decided to update anyway :)

    Our configure compiler checks were a little off: configure would accept -Werror=implicit-function-declaration for g++ because g++ would return 0 eventhough the flag wasn't accepted. Pushing -Werror in front of the flags to check made AC_TRY_COMPILE() barf properly and thus not add -Werror=implicit-function-declaration to VICE_CXXFLAGS.

    I suppose anyone with a decently up-to-date Clang should check this fix, the latest Clang I have is 7, which isn't exactly bleeding edge.

    But anyway, the cc1plus.exe warnings disappeared.

    Edit: tested with clang++-7 on Debian, the flag is accepted.

     

    Last edit: compyx 2019-08-30
  • compyx

    compyx - 2019-09-12

    If I'm not mistaken, this works, as long as you don't buil out-of-tree. I'll check,

     
  • compyx

    compyx - 2019-09-21
    • status: open --> closed-fixed
     
  • compyx

    compyx - 2019-09-21

    Since ffmpeg should be on it's way out , I won't be fixing out-of-tree building of our in-tree ffmpeg. Compiling with --external-ffmpeg works fine with the latest ffmpeg (tested on Fedora and Debian), so if you need to build out-of-tree, use the ffmpeg packages provided by your distro.

    Closing.

     
  • Retroplay

    Retroplay - 2020-09-04

    Just an update on the issue with --enable-static-ffmpeg for win32.
    Maybe it's "just" an MSYS2 error, but there's a lot of warnings and undefined reference to errors if building with ffmpeg for win32.

    --disable-arch --enable-native-gtk3ui --enable-static-lame --enable-static-ffmpeg --enable-realdevice --enable-cpuhistory --enable-native-tools
    Full make terminal output attached.

     
  • compyx

    compyx - 2020-09-04

    The warnings are 'normal', ie the in-tree ffmpeg is pretty old and modern compilers will spit out a lot of warnings about the code. Obviously the more warnings we add to CFLAGS and CXXFLAGS to improve our code, the more warnings you'll see about the in-tree ffmpeg.

    Why ffmpeg would barf on win32 and not win64, I have no idea. Could be there are objects left over from a win64 compile you did in the same directory, so win32 ffmpeg won't rebuild those and linking fails. Perhaps try a fresh checkout of vice in a new directory, see if that helps (probably not).

    If the above doesn't work you could, if you really want ffmpeg in win32, build the current ffmpeg for Win32 with msys2 and see if configure recognizes that and can actually link against it. Personally I wouldn't bother, 64-bit machines are pretty common these days.

     
  • compyx

    compyx - 2020-09-04

    Just got win32 and ffmpeg to work. Updated msys2, checked out a fresh copy of VICE, and used this:

    $ ./autogen.sh
    $ ./configure --disable-arch --enable-native-gtk3ui --enable-static-ffmpeg --enable-static-lame
    $ make -j3 2>&1 | tee build.log
    $ make bindist
    

    I recorded a few seconds of the cursor blinking in x64sc. Windows Media Player (lol) couldn't play them, but my host's VLC played them fine.

    So I suspect make clean or even make distclean isn't enough to properly clean up previous objects generated by a win64 compile in the same dir.

     
  • compyx

    compyx - 2020-09-04
    • status: closed-fixed --> open
    • assigned_to: compyx
     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB