Test with: clang -target arm-none-eabi -mcpu=cortex-m3 --sysroot=~/.env/gcc-arm-none-eabi -c test.c
Last active
August 31, 2015 03:30
-
-
Save ryankurte/118281a322fe38a7f9a6 to your computer and use it in GitHub Desktop.
Compile Clang/LLVM for cross building
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download and compile Clang/LLVM from source | |
# Exit on any errors | |
set -e | |
# Fetch LLVM | |
mkdir crossllvm | |
cd crossllvm | |
git clone http://llvm.org/git/llvm.git | |
# Fetch Clang | |
cd llvm/tools | |
git clone http://llvm.org/git/clang.git | |
cd ../.. | |
# Fetch runtime | |
cd llvm/projects | |
git clone http://llvm.org/git/compiler-rt.git | |
cd ../.. | |
# Build | |
mkdir build | |
cd build | |
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release ../llvm | |
ninja | |
#To install run: sudo ninja install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char** argv) { | |
while(1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment