LLVM Cross-Compiler

From OSDev.wiki
Revision as of 10:46, 21 March 2011 by Solar (talk | contribs)
Jump to navigation Jump to search
Difficulty level

Advanced

Is as simple as that:

mkdir crossllvm
cd crossllvm
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..
mkdir build
cd build
cmake ../llvm
make

After building you will have a compiler able to output multiple output formats regardless of your current platform, you can specify x86 ELF output format (for example) to clang using "-ccc-host-triple i686-pc-linux-gnu".

TODO: describe non-svn build from released tarballs.