GNOME Bugzilla – Bug 775777
Switch to mingw-build toolchains / Linux distro packages for Windows toolchains
Last modified: 2018-11-03 10:21:56 UTC
https://wiki.qt.io/MinGW-64-bit recommends these here: https://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-posix/seh/ https://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/32-bit/threads-posix/ We should switch to those instead of relying on our very old toolchains that nobody maintains. Or alternatively to these https://sourceforge.net/projects/mingw-w64/files/Multilib%20Toolchains%28Targetting%20Win32%20and%20Win64%29/ray_linn/gcc-6.X-with-ada/ which are also linked from the Qt wiki. For Linux cross compilation, we should just rely on the distro packages. Both Fedora and Debian have recent packages. All this just needs some changes all over the place for setting up things correctly inside cerbero. And then we still need msys (or something similar, msys2?) to get wget, flex and bison and to actually get a working shell with all the tools.
mingw-builds joined mingw-w64 btw
Created attachment 369691 [details] [review] WIP: Use system mingw toolchain
Created attachment 369692 [details] [review] gstgloverlay: Fix build with recent mingw
This is just a quick try to see how hard it is. I got it build on Ubuntu 17.10. - libtheora which fails with weird error I've no idea why. - I haven't even try to port vsintegration. - Did only cross-build, no idea how native build on windows works. - mingw-runtime is missing static libs and headers for the devel package. Distros won't have .la file, btw.
Created attachment 369694 [details] [review] WIP: Use system mingw toolchain
Created attachment 369695 [details] [review] WIP: Use system mingw toolchain
Created attachment 369697 [details] [review] WIP: Use system mingw toolchain
Created attachment 369698 [details] [review] libass: Remove patch not needed with recent mingw
Created attachment 369699 [details] [review] libmpeg2: Fix build with recent mingw
Created attachment 369700 [details] [review] libtheora: Fix build with recent mingw
Created attachment 369701 [details] [review] WIP: Use system mingw toolchain
Created attachment 369702 [details] [review] Remove recipes to build mingw toolchain
(In reply to Xavier Claessens from comment #4) > - libtheora which fails with weird error I've no idea why. Fixed. > - I haven't even try to port vsintegration. Done Now a full cross build works and generates tarballs. Haven't checked yet if they work on windows.
Created attachment 369783 [details] [review] WIP: Use system mingw toolchain
I tried build on windows, but gettext-tools fails to build. I think we need this patch[1] but it modify a .m4 and thus it needs automake to regen, but automake recipe depends on gettext... At that point I gave up. Suggestions? [1] https://aur.archlinux.org/cgit/aur.git/tree/09-gnulib-fix-underscore-cond.patch?h=mingw-w64-gettext
for your info cross compiling from archlinux using the packages here: https://aur.archlinux.org/packages/?O=0&SeB=nd&K=mingw-w64-gst&outdated=&SB=n&SO=a&PP=50&do_Search=Go works just fine, but this is outside cerbero
Cross building works fine with my patches above. It's the native build on windows that fails.
Looks like in Yocto they made a patch that fixes the configure too, to avoid reconf, http://lists.openembedded.org/pipermail/openembedded-core/2017-January/131147.html
Direct link to the patch: https://patchwork.openembedded.org/patch/135904/raw/
I have rebase these patches, the problem is that you need to have run the bootstrap before running the bootstrap as we run the compiler in the config.
Ok, I've worked around that, but the path used to find the DLL does not work on Fedora. The DLL are in the sysroot (only .a in that path you have picked). Also libgcc_s_seh-1.dll only on X86)64, and libgcc_s_sjlj-1.dll on X86.
That's new code, we we now do something that does not work with system mingw. We join toolchain_prefix and host. But toolchain_prefix contains host/7.X../ .
In the mingw runtime package, we add libgomp, the OpenMP runtime. I'm sharing it here, but I have strong doubt we have anything that depends on that.
I can now confirm that building libopus with a recent toolchain fixes the stack alignment issue we have with libopus as reported in bug #797092
The patch adds a winpthread recipe, saying Debian does not ship this. On stable, I can find it in /usr/i686-w64-mingw32/lib/libwinpthread-1.dll . Though, the way it's stored between fedora (mingw 7) and debian (mingw 6) is a bit of a mess.
Created attachment 373763 [details] [review] WIP: Use system mingw toolchain
Created attachment 373764 [details] [review] theora: Fix win32 .def line ending This breaks the build with newer mingw toolchain
Not as clean as the original, I had to rewrite the patches as rebasing from bugzilla is hard. Just sharing the state. Basically, I add support for MingW 7, and also sysroot based setup (like on Fedora). I'll keep cleaning up, and will re-extract the recipe changes. Next is: - Test/Debug on Debian - Test/Debug 64bit builds - Windows builds
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/cerbero/issues/41.