Mailing List Archive

cross-compiling for Windows
Hi all

I have the following scenario: I have a hobby project (msndfile.sf.net), which
is a MATLAB MEX file. To create Windows binaries I currently have a Windows
VM, which used to be a requirement in order to test compiling the project with
the Visual Compiler, but I semi-recently ported the project to C99 (because why
not, its my project), so I compile it with MingW now.

Therefore I've become interested in ditching my Windows VM (which has become
somewhat painful to maintain) in favour of cross-compiling for Windows and
running MATLAB under Wine (assuming it works, which I'll have to find out
myself).

The only real questions I have is if the MinGW page on the Gentoo Wiki [0] is in
conflict with the following recommendation from the cross-compiler handbook
[1]:

"However, there are some scenarios, albeit fewer as time goes on, which
causes portage to require or to inflict changes to real root. To keep your
Gentoo installation clean, we highly recommend that crossdev installation
and all cross-compiling activities occur inside a Gentoo stage3 chroot.
(This is the same chroot you used to install Gentoo.)"

Keep in mind that I don't want to cross-emerge (the libraries I use exist as
Windows binaries), I just want to use the cross-compiler in my own build
system(s). Does the recommendation still hold then?

As a final note, I originally thought winegcc would be a suitable alternative
to MinGW, but it seems that it's only intended for compiling Windows
applications for direct use with Wine. Is this correct, or can it also act as a
drop-in replacement for MinGW?

[0] http://wiki.gentoo.org/wiki/Mingw
[1] http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=2

Greetings,
--
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup
Re: cross-compiling for Windows [ In reply to ]
Hi,

Use mingw-w64 project and not old mingw, this wiki is wrong.
Don't be worried about these comments.

crossdev -t i686-w64-mingw32
crossdev -t x86_64-w64-mingw32

Alon


On Sun, Nov 24, 2013 at 6:43 PM, Marc Joliet <marcec@gmx.de> wrote:

> Hi all
>
> I have the following scenario: I have a hobby project (msndfile.sf.net),
> which
> is a MATLAB MEX file. To create Windows binaries I currently have a
> Windows
> VM, which used to be a requirement in order to test compiling the project
> with
> the Visual Compiler, but I semi-recently ported the project to C99
> (because why
> not, its my project), so I compile it with MingW now.
>
> Therefore I've become interested in ditching my Windows VM (which has
> become
> somewhat painful to maintain) in favour of cross-compiling for Windows and
> running MATLAB under Wine (assuming it works, which I'll have to find out
> myself).
>
> The only real questions I have is if the MinGW page on the Gentoo Wiki [0]
> is in
> conflict with the following recommendation from the cross-compiler handbook
> [1]:
>
> "However, there are some scenarios, albeit fewer as time goes on, which
> causes portage to require or to inflict changes to real root. To keep
> your
> Gentoo installation clean, we highly recommend that crossdev
> installation
> and all cross-compiling activities occur inside a Gentoo stage3 chroot.
> (This is the same chroot you used to install Gentoo.)"
>
> Keep in mind that I don't want to cross-emerge (the libraries I use exist
> as
> Windows binaries), I just want to use the cross-compiler in my own build
> system(s). Does the recommendation still hold then?
>
> As a final note, I originally thought winegcc would be a suitable
> alternative
> to MinGW, but it seems that it's only intended for compiling Windows
> applications for direct use with Wine. Is this correct, or can it also act
> as a
> drop-in replacement for MinGW?
>
> [0] http://wiki.gentoo.org/wiki/Mingw
> [1]
> http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=2
>
> Greetings,
> --
> Marc Joliet
> --
> "People who think they know everything really annoy those of us who know we
> don't" - Bjarne Stroustrup
>
Re: cross-compiling for Windows [ In reply to ]
Am Sun, 24 Nov 2013 18:53:52 +0200
schrieb Alon Bar-Lev <alon.barlev@gmail.com>:

> Hi,
>
> Use mingw-w64 project and not old mingw, this wiki is wrong.
> Don't be worried about these comments.
>
> crossdev -t i686-w64-mingw32
> crossdev -t x86_64-w64-mingw32

I wasn't aware of mingw-w64, thanks for pointing that out. I'll try creating
the cross-compiler now.

--
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup
Re: cross-compiling for Windows [ In reply to ]
On Sunday 24 November 2013 11:43:37 Marc Joliet wrote:
> The only real questions I have is if the MinGW page on the Gentoo Wiki [0]
> is in conflict with the following recommendation from the cross-compiler
> handbook [1]:
>
> "However, there are some scenarios, albeit fewer as time goes on, which
> causes portage to require or to inflict changes to real root. To keep
> your Gentoo installation clean, we highly recommend that crossdev
> installation and all cross-compiling activities occur inside a Gentoo
> stage3 chroot. (This is the same chroot you used to install Gentoo.)"

hrm, i don't know why that got added. i'll remove it.
-mike