1*9880d681SAndroid Build Coastguard WorkerHOWTO create an LLVM crosstool from x86_64/Linux to ARM/Linux 2*9880d681SAndroid Build Coastguard Worker============================================================= 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker1. % llvm/utils/crosstool/create-snapshots.sh 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker This will create llvm-[REV_L].tar.bz2 and llvm-gcc-4.2-[REV_G].tar.bz2, 7*9880d681SAndroid Build Coastguard Worker where: 8*9880d681SAndroid Build Coastguard Worker REV_L is the revision at which "llvm" was checked out, and 9*9880d681SAndroid Build Coastguard Worker REV_G is the revision at which "llvm-gcc-4.2" was checked out 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Worker Note that REV_L might REV_G might not be the same revision. 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker2. Download CodeSourcery toolchain. The exact location depends on your 14*9880d681SAndroid Build Coastguard Worker $CROSS_TARGET but the script will tell you what the location of the file is 15*9880d681SAndroid Build Coastguard Worker if you run it without having the file available. 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker For example, if you're using $CROSS_TARGET == "arm-none-linux-gnueabi" then 18*9880d681SAndroid Build Coastguard Worker you need to download: 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Worker http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/public/arm-none-linux-gnueabi/arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Worker NOTE: simply changing $CROSS_TARGET and modifying the URL accordingly will 23*9880d681SAndroid Build Coastguard Worker not work -- you'll need to go to http://www.codesourcery.com and find the 24*9880d681SAndroid Build Coastguard Worker correct file, as the release number in the file will also be different (e.g., 25*9880d681SAndroid Build Coastguard Worker in the file above, the release number is "51"). 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Worker3. You can override most values in the script without modifying it, e.g. 28*9880d681SAndroid Build Coastguard Worker $INSTALL_ROOT (if you want to install in directory other than /usr/local). 29*9880d681SAndroid Build Coastguard Worker 30*9880d681SAndroid Build Coastguard Worker Run the script as: 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Worker % env INSTALL_ROOT=[dir to install in] \ 33*9880d681SAndroid Build Coastguard Worker CODE_SOURCERY_PKG_PATH=[dir where you downloaded CodeSourcery tarball] \ 34*9880d681SAndroid Build Coastguard Worker LLVM_PKG_PATH=[dir where you stored your LLVM and LLVM-GCC snapshots] \ 35*9880d681SAndroid Build Coastguard Worker LLVM_SVN_REV=${REV_L} \ 36*9880d681SAndroid Build Coastguard Worker LLVMGCC_SVN_REV=${REV_G} \ 37*9880d681SAndroid Build Coastguard Worker build-install-linux.sh 38