LLVM Discussion Forums

LLVM for ARM cortex -M4

I want to generate LLVM IR for ARM cortex M4. Which flags I need to use while building LLVM in order to achieve this?

Thank You

See the documentation https://llvm.org/docs/HowToCrossCompileLLVM.html#cross-compiling-from-x86-64-to-arm, Download the requirements, and proceed with the steps.

See https://clang.llvm.org/docs/CrossCompilation.html to know cross compilation issues.

So if you look at clang driver testing you can find the commands that you need to run.

Short answer --target & --mcpu flag is used, also substitute the command according to your system setup.

Correct me if you find something wrong, As I didn’t it try myself.