After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775777 - Switch to mingw-build toolchains / Linux distro packages for Windows toolchains
Switch to mingw-build toolchains / Linux distro packages for Windows toolchains
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: cerbero
git master
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-07 22:32 UTC by Sebastian Dröge (slomo)
Modified: 2018-11-03 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
WIP: Use system mingw toolchain (21.73 KB, patch)
2018-03-14 20:07 UTC, Xavier Claessens
none Details | Review
gstgloverlay: Fix build with recent mingw (665 bytes, patch)
2018-03-14 20:08 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (65.00 KB, patch)
2018-03-14 21:51 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (70.51 KB, patch)
2018-03-14 23:09 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (73.15 KB, patch)
2018-03-15 02:37 UTC, Xavier Claessens
none Details | Review
libass: Remove patch not needed with recent mingw (1.85 KB, patch)
2018-03-15 02:58 UTC, Xavier Claessens
none Details | Review
libmpeg2: Fix build with recent mingw (2.71 KB, patch)
2018-03-15 02:58 UTC, Xavier Claessens
none Details | Review
libtheora: Fix build with recent mingw (5.75 KB, patch)
2018-03-15 02:58 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (19.99 KB, patch)
2018-03-15 02:58 UTC, Xavier Claessens
none Details | Review
Remove recipes to build mingw toolchain (44.04 KB, patch)
2018-03-15 02:58 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (20.23 KB, patch)
2018-03-16 13:36 UTC, Xavier Claessens
none Details | Review
WIP: Use system mingw toolchain (57.34 KB, patch)
2018-09-26 03:40 UTC, Nicolas Dufresne (ndufresne)
none Details | Review
theora: Fix win32 .def line ending (5.75 KB, patch)
2018-09-26 03:40 UTC, Nicolas Dufresne (ndufresne)
none Details | Review

Description Sebastian Dröge (slomo) 2016-12-07 22:32:46 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.
Comment 1 Edward Hervey 2017-07-05 08:36:07 UTC
mingw-builds joined mingw-w64 btw
Comment 2 Xavier Claessens 2018-03-14 20:07:43 UTC
Created attachment 369691 [details] [review]
WIP: Use system mingw toolchain
Comment 3 Xavier Claessens 2018-03-14 20:08:15 UTC
Created attachment 369692 [details] [review]
gstgloverlay: Fix build with recent mingw
Comment 4 Xavier Claessens 2018-03-14 20:11:44 UTC
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.
Comment 5 Xavier Claessens 2018-03-14 21:51:01 UTC
Created attachment 369694 [details] [review]
WIP: Use system mingw toolchain
Comment 6 Xavier Claessens 2018-03-14 23:09:19 UTC
Created attachment 369695 [details] [review]
WIP: Use system mingw toolchain
Comment 7 Xavier Claessens 2018-03-15 02:37:37 UTC
Created attachment 369697 [details] [review]
WIP: Use system mingw toolchain
Comment 8 Xavier Claessens 2018-03-15 02:58:38 UTC
Created attachment 369698 [details] [review]
libass: Remove patch not needed with recent mingw
Comment 9 Xavier Claessens 2018-03-15 02:58:43 UTC
Created attachment 369699 [details] [review]
libmpeg2: Fix build with recent mingw
Comment 10 Xavier Claessens 2018-03-15 02:58:47 UTC
Created attachment 369700 [details] [review]
libtheora: Fix build with recent mingw
Comment 11 Xavier Claessens 2018-03-15 02:58:52 UTC
Created attachment 369701 [details] [review]
WIP: Use system mingw toolchain
Comment 12 Xavier Claessens 2018-03-15 02:58:58 UTC
Created attachment 369702 [details] [review]
Remove recipes to build mingw toolchain
Comment 13 Xavier Claessens 2018-03-15 03:01:30 UTC
(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.
Comment 14 Xavier Claessens 2018-03-16 13:36:34 UTC
Created attachment 369783 [details] [review]
WIP: Use system mingw toolchain
Comment 15 Xavier Claessens 2018-03-16 13:44:41 UTC
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
Comment 16 Nicola 2018-03-16 13:51:10 UTC
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
Comment 17 Xavier Claessens 2018-03-16 14:01:42 UTC
Cross building works fine with my patches above. It's the native build on windows that fails.
Comment 18 Nicolas Dufresne (ndufresne) 2018-09-23 02:28:35 UTC
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
Comment 19 Nicolas Dufresne (ndufresne) 2018-09-23 02:29:42 UTC
Direct link to the patch: https://patchwork.openembedded.org/patch/135904/raw/
Comment 20 Nicolas Dufresne (ndufresne) 2018-09-23 20:51:45 UTC
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.
Comment 21 Nicolas Dufresne (ndufresne) 2018-09-23 21:10:14 UTC
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.
Comment 22 Nicolas Dufresne (ndufresne) 2018-09-23 21:26:03 UTC
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../ .
Comment 23 Nicolas Dufresne (ndufresne) 2018-09-23 21:39:25 UTC
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.
Comment 24 Nicolas Dufresne (ndufresne) 2018-09-23 23:54:52 UTC
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
Comment 25 Nicolas Dufresne (ndufresne) 2018-09-24 00:23:16 UTC
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.
Comment 26 Nicolas Dufresne (ndufresne) 2018-09-26 03:40:44 UTC
Created attachment 373763 [details] [review]
WIP: Use system mingw toolchain
Comment 27 Nicolas Dufresne (ndufresne) 2018-09-26 03:40:48 UTC
Created attachment 373764 [details] [review]
theora: Fix win32 .def line ending

This breaks the build with newer mingw toolchain
Comment 28 Nicolas Dufresne (ndufresne) 2018-09-26 03:53:26 UTC
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
Comment 29 GStreamer system administrator 2018-11-03 10:21:56 UTC
-- 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.