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?
Cross compiling between architecture and OS
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