This document will show a little insight on how to get the IAR ARM compiler working with compiler explorer (Some line highlighting is broken as EWAVR is different from EWARM)
To run the IAR ARM compiler you will need:
c++filt
and objdump
This compiler will be installed along with the IAR Embedded Workbench (EWARM). Default installation location is under C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.2\arm\bin\iccarm.exe
We need to install this toolchain through MSYS2, as it contains c++filt
and objdump
, which are needed to demangle the assembly
pacman -Syuu
, this command will update all the internal MSYS2 modules to their latest version. This command will also update all installed modules, such as the toolchain if it was installed.pacman -Syuu
pacman -S mingw-w64-x86_64-toolchain
. This will install the toolchain to your MSYS2 default installation path under C:\msys64\mingw64\bin
C:\msys64\mingw64\bin
to windows global PATH
c++filt --help
from windows command prompt, if everything is set up correctly, then you should see all the command line options for c++filtRefer to the readme on running Native on Windows for general setup of Compiler Explorer and other compilers.
The next step is to create a c++.local.properties
file under etc/config
folder. The next step is going to be different for everyone, as you can choose what compiler options you pass to the compiler and so on, but im going to paste my template here, and you can just modify, what you need
# Default settings for C++ compilers=iar8.32.4 compiler.iar8.32.4.exe=C:\arm\bin\iccarm.exe compiler.iar8.32.4.name=IAR8.32.4 compiler.iar8.32.4.supportsDemangler=true compiler.iar8.32.4.supportsBinary=false compiler.iar8.32.4.supportsExecute=false compiler.iar8.32.4.options=--enable_restrict -IC:\arm\inc -IC:\arm\inc\c -IC:\arm\inc\cpp --dlib_config C:\arm\inc\c\DLib_Config_Full.h --c++ -e --no_exceptions --no_rtti --no_static_destruction --cpu Cortex-M4 --fpu VFPv4_sp --endian little --cpu_mode thumb compiler.iar8.32.4.compilerType=ewarm compiler.iar8.32.4.versionRe=IAR ANSI C\/C\+\+ Compiler.*ARM defaultCompiler=iar8.32.4 demangler=c++filt objdumper=objdump demanglerType=default postProcess= binaryHideFuncRe=^(__.*|_(init|start|fini)|(de)?register_tm_clones|call_gmon_start|frame_dummy|\.plt.*|_dl_relocate_static_pie)$ needsMulti=false stubRe=\bmain\b stubText=int main(void){return 0;/*stub provided by Compiler Explorer*/}
It's important to note that the compiler.iar8.32.4.compilerType
field is set to ewarm
this will be the custom compiler key later on
You should be able to just cd
into the compiler explorer repository and run npm start
. After that just head on to localhost:10240