Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mingw target
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Wed Apr 04, 2007 11:08 am    Post subject: mingw target Reply with quote

Hi all,

i was looking to the instructions in the wiki about getting mingw compiler running. It suggests to simply run crossdev mingw32 and i don´t think this is accurate, i mean, shouldn´t it be sth like crossdev mingw32-unknown-win32-gnu or sth like that ? I looked to what others do but the target looks to be different from distro to distro.
And of course i would need to run crossdev i686-mingw32(-blabla) in order to get a 32 bit compiler on my amd64 box.

Hope someone someone could talk about his experience and enlighten me.

TIA
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Sat Apr 21, 2007 8:51 am    Post subject: Reply with quote

For mingw32, your CHOST and CTARGET would be i686-pc-mingw32.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Sat Apr 21, 2007 9:31 am    Post subject: Reply with quote

thanks :)
i´ve just run crossdev i686-mingw32 as suggested and it apparently worked :P

cheers
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
hvengel
Guru
Guru


Joined: 19 Sep 2004
Posts: 515

PostPosted: Tue May 08, 2007 10:00 pm    Post subject: Reply with quote

I have this installed on my system and I can get it to work for some things but not others. For example I can build libtiff with an USE="zlib" xmerge tiff and it works as expected. But if I try to build zlib the same way it fails. In addition, there are other things that do not appear to work using xmerge like qt, libpng, fftw and vigra. It would appear that I need to hand build these in order to get them to work and that in order to do this I need to setup some things in my environment. For example, when I download qt from the qt-win-free sourceforge site and follow their directions for cross compiling the source tree it fails because it tries to built it with unix rather than windows versions of various modules. This also appears to be what is happening with other builds as well. So I don't think I have everything setup correctly and I can't find any documentation that talks about building using a crossdev setup mingw for anything other than using portage.

Is there someplace where there is better documentation about how to setup and use this?
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Tue May 08, 2007 10:07 pm    Post subject: Reply with quote

Oh, mingw32 has been a third rate target for a long time. It's only with gcc 4.3 that it'll become an "official" target. So there's little wonder that support for it is broken.
Don't bother wasting your time with xmerge. Few of the portage ebuilds correctly build with this target. Build by hand - annoying, but ah well.
I emphatically advise to use gcc 3.4 with mingw32. 4.x is fine for C stuff, but once you step into the realm of exception handling (i.e., any serious C++ class library), there be dragons (in other words, it's completely broken for dynamic linking - it's not possible to throw exceptions out of shared libraries).
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
hvengel
Guru
Guru


Joined: 19 Sep 2004
Posts: 515

PostPosted: Tue May 08, 2007 11:31 pm    Post subject: Reply with quote

Well I can believe that building by hand will be needed since most of the ebuilds I have tried are broken for building mingw32 targets even though some of them work. What I don't know is how are things setup so that I can correctly build all of the libraries I need for my project (Qt-3, vigra, qwt, wwwidgets, lcms, parts of Argyllcms, solveopt, libtiff, libpng, libusbwin.... you get the idea) and also so that I can build my project. For example what environment variables need to be set and how do I make sure that the various configure and make scripts know that _win_ or the like should be defined so that conditionals in the code work the way they should. I expect that I will have to modify the scons script for my project but this is OK since I have not been really it for Windows builds anyway. But I need to figure out a way to have it do *nix builds most of the time and mingw builds when I need them.

I will back the gcc version down to 3.4 since I clearly need C++ to be working correctly. On the other hand everything except Qt is statically linked on the Windows builds.
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Tue May 08, 2007 11:52 pm    Post subject: Reply with quote

For stuff like this, I always take a look at the ebuilds to see what they're doing and manually replicate the parts of the build process I'm interested in.

I forgot to mention: It's possible that you encounter the exception problems even with GCC 3.4. You could write a small test project consisting of one shared library and one executable, to check whether everything turns out fine. The problem with exceptions in gcc is that it relies on the cxa_at_exit facility which in turn requires support from the C runtime, and mingw32's runtime doesn't have that. This is why the Win32-hosted mingw hasn't had any stable compiler releases since gcc 3.4.2 - it's the last release where the custom patches the Win32-hosted mingw uses worked fine. Gentoo's crossdev doesn't apply those patches.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
hvengel
Guru
Guru


Joined: 19 Sep 2004
Posts: 515

PostPosted: Thu May 10, 2007 12:04 am    Post subject: Reply with quote

The only library I need that will not be statically linked is Qt and the mingw cross build for it builds with exceptions turned off by default. By the way I just got it to build. It probably does this because of this issue. If this is the only issue that exists then my project will be OK.

I am still at a loss about how the over all environment should be setup. When running xmerge or cmerge it in affect makes /usr/i686-mingw32 the system root during the build process. But when I build by hand this is not the case. So when I configure software I should set --prefix=/usr/i686-mingw32/usr - Is that correct? What else do I have to do to force these builds to look in the right place for libraries and header files? Again I can tweak the build for my own project to look in the correct locations but how do I get builds for things like 3rd party libraries (zlib, libpgn, vigra...) to do this?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum