Gentoo Archives: gentoo-dev

From: Matthias Maier <tamiko@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] mingw-w64 crossdev prefix?
Date: Thu, 18 May 2017 03:47:23
Message-Id: 87wp9e25ed.fsf@kestrel.kyomu.43-1.org
In Reply to: [gentoo-dev] mingw-w64 crossdev prefix? by Marty Plummer
1 Hi there,
2
3 On Wed, May 17, 2017, at 17:25 CDT, Marty Plummer <netz.kernel@×××××.com> wrote:
4
5 > Greetings,
6 >
7 > So, I'm a relatively new gentoo user (as of 2016-12) coming from arch,
8 > and one thing I've noticed is the relative difficulty of setting up a
9 > mingw-w64 cross-compile toolchain and libraries.
10 >
11 > I'm considering the idea of setting up a sort of prefix specifically
12 > with the intent of being used on a 'normal' gentoo system with the sole
13 > purpose of creating 'normal' windows binaries; does anyone have
14 > suggestions/objections about the idea?
15 >
16 > As it currently stands I have to use an archlinux chroot to do my
17 > cross-compiling, and I'd really enjoy to be able to do this sort of
18 > thing without depending on an auxiliary distro.
19
20 You can find some information on the wiki [1] (warning: I might be a bit
21 outdated).
22
23 But anyway, just check it for you (I haven't set up a cross compilation
24 toolchain for windows for the last ~7 years): From a plain amd64 stage-3
25 setting up a mingw-264 environment via:
26
27 # emerge crossdev
28 # crossdev [...] -t x86_64-w64-mingw32
29
30 still works with a minor complication [2]. Please verify that this works
31 and open a bug report for the libsanitizer issue mentioning the
32 workaround [2,3].
33
34 After that you end up with a cross-compiler toolchain
35
36 x86_64-w64-mingw32-*
37
38 and necessary runtime somewhere in /usr/x86_64-w64-mingw32.
39
40 You can also use $ x86_64-w64-mingw32-emerge to cross compile
41 libraries/packages for mingw.
42
43
44 Keep in mind that a cross compilation toolchain is a bit of a rocky
45 journey. You might have to pin certain versions of libraries/programs,
46 and or manually patch some stuff.
47
48 Best,
49 Matthias
50
51
52 [1] https://wiki.gentoo.org/wiki/Mingw
53
54 [2] I had to manually disable libsanitizer for gcc-6.3.0. Just set
55 EXTRA_ECONF="--disable-libsanitizer" via env/package.env for the
56 cross-x86_64-w64-mingw32/gcc package.
57
58 [3] https://bugs.gentoo.org/buglist.cgi?quicksearch=mingw&list_id=3536150

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] mingw-w64 crossdev prefix? Alon Bar-Lev <alonbl@g.o>