#2 Howto install 32/64 bit cross compile toolchain

closed
5
2008-05-22
2008-04-17
No

Hi,

being a newbie to cross compilation under Mingw/Msys, I have problems setting up the x86_64-pc-mingw32 toolchain and integrating it into my existing mingw32 system.

I'm using bash (as sh.exe) and configure/make to build libs etc. which I can use from CodeBlocks or even VisualStudio.

This works finally with mingw32/msys, but it is hard for me to understand how to setup everything to being able to do cross compilation for x64 (building exes for XP or Vista x64) from mingw32.

As said, I'm a newbie (not in Windows, neither in Msys, but my Msys experience is more using it, not understanding all the configuration). Especially the logic behind cross-compilation isn't yet clear to me. I don't consider this to be solely a task for the mingw64 project, but I was encouraged to file a ticket :-), It would be very much appreciated to have some documentation on how to setup the toolchain - or in other words: how to integrate the files in mingw-w64-bin_i686-mingw_20080116.tar in an existing Mingw/Msys system.

Any docs/links/etc. very much appreciated.

All the best
Axel

Discussion

  • NightStrike

    NightStrike - 2008-04-20
    • assigned_to: nobody --> nightstrike
     
  • NightStrike

    NightStrike - 2008-04-21

    Logged In: YES
    user_id=1864092
    Originator: NO

    Hi, Axel.

    Sorry it's taken me a while to get to you on this, but I have some good news. I recently uploaded a new version of the toolchain that you are using, the one that is hosted on i686-pc-mingw32. You can pick this up in the download section. There's a few things to note here:
    First, it's now a zip archive. This should make handling the symlinked nature of some of the files/directories much easier. Second, it's a completely relocatable toolchain root system. You can either incorporate it directly into your current root structure, or place it in some easily identifiable (and easily deleted if you mess up) directory.

    Here's what I would recommend to start until you understand a little more just what is going on. Hopefully this support ticket will serve as a good basis from which to write up good FAQs and documentation for the site (and please, feel free to contribute anything to our Wiki :) ) Download the latest toolchain for i686-pc-mingw32 and extract it into some directory. For instance, if you're in the msys shell, you might want to put it in /opt/w64 or some such place. For this example, we'll assume you put it there. Then, just add to your path "/opt/w64/bin". That's it. You're done with the installation.

    To invoke the compiler, the command name is x86_64-pc-mingw32-XXX where XXX is the gcc/binutils tool you want (gcc is a good start). autoconf configure scripts take care of this when you configure any program with the "--host=x86_64-pc-mingw32" option. configure will by default search for a version of gcc by that name and set CC to that value. So you might want to do something like this to compile some random autoconf'd program:

    $ export PATH=/opt/w64/bin:$PATH
    $ ../configure --host=x86_64-pc-mingw32 && make all install

    That should be a good bit to get you started. Let's see how you fare with that, and we'll move on later to explaining how to incorporate the toolchain into your usual usage, and also into explaining just what cross compiling is and how it works.

     
  • Axel Holzinger

    Axel Holzinger - 2008-05-08

    Logged In: YES
    user_id=1421156
    Originator: YES

    Hi NightStrike,

    sorry, it took a while untill I found the opportunity to give mingw-w64-bin_i686-mingw_20080420.zip a try and works perfect now (okay, building ffmpeg for example, gcc gives up with an internal compiler error, but this is surely a matter of the experimental 4.4).

    I want to say thank you very very much. Your great work is highly appreciated.

    All the best
    Axel

     
  • NightStrike

    NightStrike - 2008-05-12

    Logged In: YES
    user_id=1864092
    Originator: NO

    If your goal is to compile a 64-bit version of gcc, then there is a person that did it and wrote up instructions of how to do it. I will get the information for you. Will that signify closing this support request?

     
  • Axel Holzinger

    Axel Holzinger - 2008-05-13

    Logged In: YES
    user_id=1421156
    Originator: YES

    Hi NightStrike,

    yes, please close it. My setup is running and working as expected due to your and Kai's great work. The residing problems come from gcc. A hint on how to compile it would be grat.

    All the best and thanks a lot
    Axel

     
  • Kai Tietz

    Kai Tietz - 2008-05-22
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks