[cfe-dev] NOOB Cross compiling for iOS

Gordon Keiser gkeiser at arxan.com
Wed Sep 5 18:58:39 PDT 2012

On Behalf Of jj2005:
> Hi,
> I have been struggling for weeks to cross compile some unix to run on
> IOS(ATV2).
> I must admit I thought this would be a simple task but it seems I am clearly not
> experienced enough to figure this out by myself, so her I am in the hopes
> someone would help me!!
> I was trying to configure EIBD
> http://www.auto.tuwien.ac.at/~mkoegler/index.php/eibd
> with the help of
> http://sourceforge.net/apps/trac/bcusdk/wiki/CrossCompiling
> I soon found out that Clang was necessary, anyways I tried the following:
> CXX="$DEVROOT/usr/bin/llvm-g++-4.2"
> CC="$DEVROOT/usr/bin/llvm-gcc-4.2"
> CPPFLAGS="-L/temp/include" LDFLAGS="-L/temp/lib" ./configure --
> host=armv7-apple-darwin --target=armv7-apple-darwin --build=i386-apple-
> darwin  --enable-onlyeibd --with-pth=/temp --prefix=/temp --without-pth-test
> And everything seems to be okay, but I still end up with a 64 bit binary??,
> please, please, please what am I doing wrong??

I just wrote this reply assuming that you were trying to build on a linux machine (the message isn't very clear on that), then saw the mac.com email address.  Feel free to ignore most of this if you're running on MacOSX (in which case you should be looking into setting up an Xcode project for this code for the easiest route).

I haven't done this specifically, but 
1) The CPPFLAGS line all ran together on that page.  It should probably be

export CPPFLAGS="-L/path/to/empty/dir/include" 
export LDFLAGS="-L/path/to/empty/dir/lib" 
./configure --host=armv7-apple-darwin --target=armv7-apple-darwin --build=i386-apple-darwin  --enable-onlyeibd --with-pth=/temp --prefix=/temp --without-pth-test 
make install

This probably isn't going to work.  --build is supposed to be for configuring to build the project being configured on a different system, and I don't think you're wanting to build *on* iOS.  There's also a good chance the project itself lacks any iOS support.  The configure file seems to indicate that, at least.

2) If you're trying to do this with the stock Clang from apt-get on linux, it isn't going to work, that one (at least on debian and ubuntu) targets x86 only.   The cross compiling mode is going to require, at minimum:
   * A version of Clang built with ARM as an available target, preferably configured to target iOS when built.
   * arm-apple-iosX.X.X-clang somewhere in the path 
   * All of the headers and libs required to build for iOS
   * Probably all of the packaging and signing tools for iOS if you want to run it without rooting, built for your host
   * Probably more than a few additional CPPFLAGS

Even with all of that you'd be better off trying to do this on MacOSX with Xcode installed.  As I understand it cross-compiling from linux to iOS isn't simple in the first place and may violate some licensing on the iOS libraries.  Then you can work on the configuration issues and not have to fight with two things at once. 

Also, as I understand it, this project is just building a cross-toolchain for m68hc05 ?   I can't seem to find much more about it.  

Maybe somebody on the list can help you more, but that's about the extent of what I can tell you.   Clarifying what you're trying to do 

Good luck,
Gordon Keiser
Software Development Engineer
Arxan Technologies
gkeiser at arxan.com  www.arxan.comĀ 

> --
> View this message in context: http://clang-
> developers.42468.n3.nabble.com/NOOB-Cross-compiling-for-iOS-
> tp4026492.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list