Skip to content

Instantly share code, notes, and snippets.

@vishwassharma
Created March 3, 2013 12:16
Show Gist options
  • Select an option

  • Save vishwassharma/5075897 to your computer and use it in GitHub Desktop.

Select an option

Save vishwassharma/5075897 to your computer and use it in GitHub Desktop.
LLVM/Clang now builds for Cortex-M3?
cd llvm
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd llvm/projects
git clone http://llvm.org/git/compiler-rt.git
cd ../llvm-build/
../llvm/configure --prefix=$(HOME)/bin/llvm
--exec-prefix=$(HOME)/bin/llvm --enable-targets=x86_64,arm,cpp
--enable-optimized
make
make install
clang -v
clang++ -ccc-gcc-name arm-none-linux-gnueabi-g++ -ccc-host-triple
thumbv7m-none-gnueabi testReference.cpp -c
It seems like it worked.
$ arm-none-linux-gnueabi-objdump -D --section=.text testReference.o
testReference.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <main>:
0: e92d4800 push {fp, lr}
4: e1a0b00d mov fp, sp
8: e24dd030 sub sp, sp, #48 ; 0x30
https://gist.github.com/jsnyder/1108326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment