Results 1 to 8 of 8

Thread: Crossdev - Cross compiling

  1. #1
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default Crossdev - Cross compiling

    OK, so I had to get myself a cross toolkit to compile SMART for Windows x86 - I know others have done it and it's pretty simple on Debian/Ubuntu (You emerge some mingw package iirc, I did it on ubuntu before)

    Anyway, I don't use Debian; I mainly use Gentoo, which has crossdev. And it's awesome.

    Really, I never expected it to be that nice. I still haven't toyed around with it that much, but still. I just wanted to let some of you guys know.

    Usage is simple; http://www.gentoo.org/proj/en/base/e...evelopment.xml

    You install it; set up an overlay (basically just create a folder and set and env variably in /etc/make.conf) and run crossdev i686-mingw32 (we can also use other architectures - I am not 100% sure if they will all work, but I just want x86+windows now)

    It will then just build the full tool chain - and it works too. Admittedly I haven't toyed around with it that much yet, but it seems to work fine...

    I realise most of you won't care, but perhaps the ones who do actually have to do quite some cross compiling will care. (mopar, perhaps)

    Code:
    # crossdev i686-mingw32
    --------------------------------------------------------------------------------
     * crossdev version:      20100814
     * Host Portage ARCH:     amd64
     * Target Portage ARCH:   x86
     * Target System:         i686-mingw32
     * Stage:                 4 (C/C++ compiler)
    
     * binutils:              binutils-[latest]
     * gcc:                   gcc-[latest]
     * headers:               w32api-[latest]
     * libc:                  mingw-runtime-[latest]
    
     * PORTDIR_OVERLAY:       /usr/local/overlays/crossdev
     * PORT_LOGDIR:           /var/log/portage
     * PKGDIR:                /usr/portage/packages/cross/i686-mingw32
     * PORTAGE_TMPDIR:        /var/tmp/cross/i686-mingw32
      _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  
     * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ...     [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-binutils.log
     * Emerging cross-binutils ...                                            [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-w32api-quick.log
     * Emerging cross-w32api-quick ...                                        [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-mingw-runtime-headers.log
     * Emerging cross-mingw-runtime-headers ...                               [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-gcc-stage1.log
     * Emerging cross-gcc-stage1 ...                                          [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-w32api.log
     * Emerging cross-w32api ...                                              [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-mingw-runtime.log
     * Emerging cross-mingw-runtime ...                                       [ ok ]
     * Log: /var/log/portage/cross-i686-mingw32-gcc-stage2.log
     * Emerging cross-gcc-stage2 ...                                          [ ok ]
    Code:
    $ vim Makefile  # Had to change the cross compiler name.
    $ make windows
    Compiling Main.cpp
    Compiling Color.cpp
    Compiling Java Classes...
    src/smart/Client.java:66: warning: sun.applet.AppletClassLoader is internal proprietary API and may be removed in a future release
    import sun.applet.AppletClassLoader;
                     ^
    src/smart/Client.java:531: warning: sun.applet.AppletClassLoader is internal proprietary API and may be removed in a future release
            thisLoader = AppletClassLoader.newInstance(new URL[] { clientConnection.getJarFileURL() });
                         ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 warnings
    Encoding Java classes...
     +build/java/java/awt/Canvas$AccessibleAWTCanvas.class
     +build/java/java/awt/Canvas.class
     +build/java/smart/EventRedirect.class
     +build/java/smart/Client.class
     +build/java/smart/Client$3.class
     +build/java/smart/ClientStub.class
     +build/java/smart/EventNazi.class
     +build/java/smart/EventNazi$KeySender.class
     +build/java/smart/Client$2.class
     +build/java/smart/UnblockedEvent.class
     +build/java/smart/BlockingEventQueue.class
     +build/java/smart/Client$1.class
     +build/java/smart/Client$4.class
    Compiling Classloader.cpp
    Compiling Input.cpp
    Compiling Reflection.cpp
    Compiling JVM.cpp
    Compiling Smart.cpp
    Linking object files...
    Finished Building the Windows SMART distribution
    I'm going to try it on my ARM sheevaplug soon, I think.

    E: It did pick GCC 4.5 though, which is as far as I know not extremely well tested.
    Last edited by Wizzup?; 02-16-2011 at 09:46 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  2. #2
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I'm interested to see if it will run on ARM!
    Interested in C# and Electrical Engineering? This might interest you.

  3. #3
    Join Date
    Feb 2006
    Location
    Franklin, Ohio, USA
    Posts
    991
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    What about a Mac OSX cross compiler? I recently set one of these up for a C++ project I am working on, and it was a pain in the ass. If that has built in functionality for that I might have to switch?

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by moparisthebest View Post
    What about a Mac OSX cross compiler? I recently set one of these up for a C++ project I am working on, and it was a pain in the ass. If that has built in functionality for that I might have to switch?
    It should be possible, although with a quick look I mainly found a target to mac powerpc, not x86. But yeah, it should work. I can give it a go later.

    Quote Originally Posted by Smartzkid View Post
    I'm interested to see if it will run on ARM!
    Do you mean SMART?



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  5. #5
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    It should be possible, although with a quick look I mainly found a target to mac powerpc, not x86. But yeah, it should work. I can give it a go later.



    Do you mean SMART?
    Mhmm. IIRC my clothes drier runs on an ARM based micro
    Interested in C# and Electrical Engineering? This might interest you.

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    Mhmm. IIRC my clothes drier runs on an ARM based micro
    I have tested it yet due to lack of ARM java compilers on my system. I'll have to play with a bit more and then I can compile SMART. (Actually, I think I can just copy over the .class files from another arch since it's all bytecode)

    AFAIK it should work, since there's no platform specific code in SMART anymore.
    Last edited by Wizzup?; 03-09-2011 at 06:30 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    Feb 2006
    Location
    Franklin, Ohio, USA
    Posts
    991
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I should have posted this before, but just for reference, I used this to set up a Mac OSX cross compiler under Linux:

    http://www.sandroid.org/imcross/

    It's really 2 cross compilers, as it's for ppc and i386 mac.

    If you could do this on Gentoo with the built-in tools, I might have to switch.

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    I'm not sure if Gentoo supports all those targets, but if there is one distro specialised in compiling then it is Gentoo.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •