Skip to content

mingwandroid/toolchain4

 
 

Repository files navigation

Updated by Ray Donnelly on the 12th of May 2012.

New features:

 1. Building on Windows (MinGW/MSYS - see note [1]) and Mac OS X.
 2. Also targeting Mac OS X (MacOSX10.7.sdk).
 3. Support for building with (slightly) newer iPhoneSDK (iPhoneOS4.3.sdk).
 4. Better Objective C/Objective C++ support.
 5. Newer cctools (809) and newer ld64 (127.2) with lto capabilities.
 6. Multiarch compiler driver included (-arch flag for both OS X and iOS).
 7. Fully relocatable; build and move to where-ever you want.
 8. Builds on Fedora and openSUSE - openSUSE is still WIP (see note [2]).
 9. Builds correctly with more recent GCCs (e.g. 4.7.0).

Whereas the javacom version (which I forked) was focused on iPhone, my focus is on
Mac OS X; I have tested that "Hello World" and "Hello World C++" (gcc and llvmgcc)
work on iPhone (armv6 and v7) though. On Mac OS X I've built and tested the entire
Google Android NDK (i386 only).

To build:

 You'll need about 3GB of space in /tmp (or /tmp2 on Windows) and about 1.2GB of
  space where you clone this repository (this includes space for the SDKs).

 From a Mac get the iPhoneOS4.3.sdk and MacOSX10.7.sdk folders and place them in
  toolchain4/sdks/ (see note [3])

 On Ubuntu (tested with 11.04 i686), Windows (tested with Win7 x64), Fedora
  (tested with 17 TC3 x86_64) and Mac OS X (tested with 10.7.x i686 and x86_64):
  "./build-all.sh apple" (or "./build-all.sh apple-dbg" for debug versions)

 On openSUSE (tested with 12.1 x86_64)
  "i386 ./build-all.sh apple" (or "i386 ./build-all.sh apple-dbg")
  For openSUSE i686, the command line will be the same as for the other OSes).

 The built binaries will be in /tmp/final-release (/tmp2/final-release on Windows)

 An archive is also made in toolchain4/
  ..where VERSION is currently cctools127.2-gcc42-5666.3-llvmgcc42-2336.1:
    Linux: /multiarch-darwin11-${VERSION}-Linux-$(date +%y%m%d).tar.xz
  Windows: /multiarch-darwin11-${VERSION}-Windows-$(date +%y%m%d).7z
   Darwin: /multiarch-darwin11-${VERSION}-Darwin-$(date +%y%m%d).7z

 I compress as a .7z on Darwin as tar.xz isn't supported and .tar.bz2 is too big.
  To uncompress this you can get a binary of pz7ip for Mac OS X from
  http://mingw-and-ndk.googlecode.com/files/p7zip-macosx.tar.bz2 or use Keka.

If you just want the toolchain binaries, the latest builds can always be found at:
 http://code.google.com/p/mingw-and-ndk/
 To use the binaries you still need the official SDK(s). It should be fine to use
 these toolchains with more recent SDKs than those they were built against.

Send bug-reports/patches to Ray Donnelly <mingw.android at gmail dot com> please.

Notes:

 [1] On Windows, the following cctools programs do not currently compile:
     "seg_addr_table", "checksyms" and "redo_prebinding"

 [2] There may be an issue with openSUSE (or other strict FHS distros) setting
     libexecdir to "lib" and the built binaries expecting it to be "libexec". I've
     implemented a fix for this but it is currently untested.

 [3] The scripts contains some work to extract sdks from xcode dmgs but you're
     best off not depending on this (i.e. it doesn't work on Windows, requires
     HFS+ kernel modules on Linux and is fairly untested). On Windows, 7zip should
     be able to extract the sdk pkgs from the dmg, but extracting the pkgs will
     present challenges. The script(s) do build the tools required to extract pkgs
     though, so it *might* be achievable.

Enjoy.


Partially redundant original javacom README:

1.  Ubuntu 10.10 iPhone Toolchain 4
    If you use Ubuntu 11.04, please see wiki on how to use gcc-4.4 to compile

2.  Install the following packages in Ubuntu

    sudo apt-get update
    sudo apt-get install bison flex build-essential wget patch
    sudo apt-get install git autoconf gawk libssl-dev libxml2-dev uuid-dev
    sudo apt-get install clang

3.  Clone Project
    cd /
    sudo git clone git://github.com/javacom/toolchain4.git
    sudo chown -R <yourusername>:<yourusername> /toolchain4

4.  Put iPhoneOS4.2.sdk.tgz to /toolchain4/sdks/
    
    or build xar
    sudo apt-get install libxml2-dev
    ./toolchain.sh xar
    then put iPhoneSDK4_2.pkg to /toolchain4/sdks/
    ./toolchain.sh buildsys
    to build sys

    Put iPhoneSDK5_0.pkg to /toolchain4/sdks/
    ./toolchain.sh buildsys50
    to build sys50 folder

    Put iPhoneSDK4_3.pkg to /toolchain4/sdks/
    ./toolchain.sh buildsys43
    to build sys43 folder

    Put iPhoneSDKHeadersAndLibs.pkg to /toolchain4/sdks/
    ./toolchain.sh build313
    to build sys313 folder

    Put iPhoneSDKHeadersAndLibs_32.pkg to /toolchain4/sdks/
    ./toolchain.sh build32
    to build sys32 folder

5.  Build headers tools and gcc 
    cd /toolchain4
    ./toolchain.sh buildsys
    ./toolchain.sh cctools
    ./toolchain.sh llvmgcc
    ./toolchain.sh ldid

6.  Install as_driver
    cd /toolchain4/as_driver
    make
    cd /usr/bin
    sudo mv as i686-linux-gnu-as
    sudo cp -p /toolchain4/as_driver/as_driver as
    sudo ln -s /toolchain4/pre/bin/arm-apple-darwin9-as .
    sudo mv ld i686-linux-gnu-ld
    sudo cp -p /toolchain4/as_driver/as_driver ld
    sudo ln -s /toolchain4/pre/bin/arm-apple-darwin9-ld .

7.  Test iOS4 sample code
    cd /toolchain4/Projects/LocalPush
    make
    make dist
    (LocalPush.app & LocalPush.ipa will be in build/4.0/ folder)

8.  Checkout the updated UICatalog in svn here
    sudo apt-get install subversion
    cd /toolchain4/Projects
    svn checkout http://apiexplorer.googlecode.com/svn/trunk/UICatalog UICatalog-read-only
    cd UICatalog-read-only 
    make -f Makefile.ios4 
    make -f Makefile.ios4 dist
    (Then install the build/4.0/UICatalog.ipa to iPhone for testing)

Enjoy.

----------------------------------------------------
Instructions to add theos build system to toolchain4
----------------------------------------------------
1.  Installation
    cd /toolchain4
    git submodule add git://github.com/DHowett/theos.git theos
    mv /toolchain4/theos/include /toolchain4/theos/include.bak
    git submodule add git://github.com/DHowett/theos-nic-templates.git theos/templates/theos-nic-templates
    git submodule add git://github.com/rpetrich/iphoneheaders.git theos/include
    for FILE in /toolchain4/theos/include.bak/*.h; do mv $FILE /toolchain4/theos/include/; done
    rmdir /toolchain4/theos/include.bak
    cp /toolchain4/Projects/IOSurfaceAPI.h /toolchain4/theos/include/IOSurface/.
    cp /toolchain4/pre/bin/ldid /toolchain4/theos/bin/.

2.  This is how to create theos project
    cd /toolchain4/Projects
    /toolchain4/theos/bin/nic.pl

3.  Test iOS5 sample notification center widget (requires sys50)
    cd /toolchain4/Projects/widgettest/
    make && make package

4.  Test mobilesubstrate extension (requires sys32)
    cd /toolchain4
    git submodule add git://github.com/DHowett/preferenceloader.git Projects/preferenceloader
    cd /toolchain4/Projects/preferenceloader
    cp /toolchain4/Projects/Makefile_for_preferenceloader Makefile
    make && make package

Enjoy.

About

iPhone toolchain 4 for Ubuntu 10.10

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 67.7%
  • C 20.6%
  • Objective-C 7.5%
  • C++ 4.2%