[cfe-dev] Using clang for cross-compiling to Cortex M4

Rick Mann rmann at latencyzero.com
Mon Jun 2 20:00:22 PDT 2014


I'm having a hard time figuring out how to build clang/llvm to let me target a small Cortext M4 MCU. I've got HEAD clang installed, but apparently no runtime or standard libraries. I've read through

	http://clang.llvm.org/docs/CrossCompilation.html

and took a look at

	http://llvm.org/docs/CMake.html

It talks about how to build LLVM to target an architecture, but I thought LLVM was able to target all its targets without having to be built specifically for each target. The clang/llvm I have install has all targets enabled, and I can pass it -target arm-none-eabi -mcpu=cortext-m4, and it seems to do the right thing.

What I'd like to do is make a homebrew formula to build an LLVM-based toolchain to target small ARM MCUs (I realize I'll have to use GNU binutils to link, that's fine). But I can't really figure out how to build it even manually.


-- 
Rick







More information about the cfe-dev mailing list