win32 build fails with --enable-static-ffmpeg
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
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".
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.
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:
Applied Greg's patch and produced a Win32 bindist which works on my box (recorded an mp4 of me hitting random keys in x64sc).
The bindist is here: https://sourceforge.net/projects/vice-emu/files/experimental%20binaries/GTK3VICE-3.3-win32-r36934-debug%2Bffmpeg.zip/download
It compiled, linked and ran fine on my Win10 box, so if anyone else can confirm this bindist working, I can commit the patch and close this.
Patch applied and commited. Seems to run fine on Win10 and Win7.
Closing.
It builds and runs with the SDL2 UI, also.
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]
Last edit: Retroplay 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:
i'd check if the link order is different in xscpu64 for some reason
I used gcc 9.1 (not 8.3) in the 'Mingw-w64 32 bit' shell, with the following configure line:
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
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
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
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.
No, everything is vanilla, the only thing I've added was export miktex/pdftex to .bashrc, that's all.
Here's the config summary:
That output looks fine. I just tried compiling 32-bit Gtk3 again with:
Guessing perhaps the
--disable-archcaused 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:
Seems to indicate my last update of msys2 was two weeks ago. I'll update and if that triggers any errors.
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.
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-declarationfor g++ because g++ would return 0 eventhough the flag wasn't accepted. Pushing-Werrorin front of the flags to check made AC_TRY_COMPILE() barf properly and thus not add-Werror=implicit-function-declarationto 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
If I'm not mistaken, this works, as long as you don't buil out-of-tree. I'll check,
Okay, Gtk3-Win32 bindist which works on my x64 box: https://sourceforge.net/projects/vice-emu/files/experimental%20binaries/GTK3VICE-3.3-win32-r37004-ffmpeg-debug-debuggtk3.zip/download
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.
Just an update on the issue with
--enable-static-ffmpegfor win32.Maybe it's "just" an MSYS2 error, but there's a lot of warnings and
undefined reference toerrors if building with ffmpeg for win32.--disable-arch --enable-native-gtk3ui --enable-static-lame --enable-static-ffmpeg --enable-realdevice --enable-cpuhistory --enable-native-toolsFull
maketerminal output attached.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.
Just got win32 and ffmpeg to work. Updated msys2, checked out a fresh copy of VICE, and used this:
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 cleanor evenmake distcleanisn't enough to properly clean up previous objects generated by a win64 compile in the same dir.