Quantcast

Jump to content

» «
Photo

Cross compiling between architecture and OS

2 replies to this topic
SagaciousKJB
  • SagaciousKJB

    Captain tl;dr

  • The Connection
  • Joined: 21 Jun 2003
  • None
  • Ban Roulette Winner 2016

#1

Posted 12 May 2015 - 10:36 PM

I have a little program I want to keep binaries for on a thumbdrive so I can run it no matter what computer OS/architecture I wind up being on.  I've been able to cross compile with MinGW under Linux to Windows, is there also a way to do it for i386 versus x86_64?  Also is there anything quite as easy to cross-compile to OSX from Linux too?


K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Best Poster [Technology / Programming] 2016
    Best Poster [Programming] 2015
    Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 15 May 2015 - 08:53 AM

This page should be helpful.

 

Can't help you with OSX, though.


bartoc
  • bartoc

    Player Hater

  • Members
  • Joined: 15 Jun 2016
  • United-States

#3

Posted 17 June 2016 - 06:59 PM

hm, not sure about that. If there's any hope it would be in clang, which looks like it has a target option that supports mach-o. You need to be careful to avoid dynamic library dependencies (aside from maybe libc). On windows you do this by compiling with the /MT switch. Linux does not really support static linking libc, but glibc is pretty universal. There are things like uclibc that could be interesting. In general if all the dependencies are there and the executable is in the right format it will run, but cross compilation can be difficult (in particular because you need to test the compiled binaries and at that point why both cross compiling).

 

Anyway good luck.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users