I would like to discuss the possibility of providing cross-compilation support for XMOS processors on Linux, MacOS and Windows. I would welcome any advice for achieving this. The XMOS ‘xcc’ compiler supports C and C++ but also a custom C-like language called XC which has support for concurrency and various real-time chip architecture features built in. The current plan is:
- Create a new XMOS platform
- Create a new language, XC, for which the default file extension is ‘.xc’
- Ensure that C & C++ files, and assembly files with a ‘.S’ suffix are compiled by the ‘xcc’ compiler.
- Ensure that assembly files with a ‘.s’ suffix are assembled with the ‘xmosar’ assembler.
- Possibly provide support such that, for an executable target named ‘xtarget’, the resulting binary file is called ‘xtarget**.xe**’
Does this sound sensible/consistent with CMake design?
Current questions I have:
- What should go into the ‘XMOS’ Platform file? Preliminary work suggests it should exist if I call ‘set(CMAKE_SYSTEM_NAME XMOS)’ but I’m not sure what it should contain. Currently I have an ‘xmos_toolchain.cmake’ file that I include from CMAKE_MODULE_PATH that sets this. Would it make more sense to call ‘set(CMAKE_SYSTEM_NAME XMOS)’ from an XMOS cmake project, and put the current contents of the toolchain file into the Platform file?
- Currently, for C, CXX and ASM compiler vars (CMAKE_XXX_COMPILER), we just set those to ‘xcc’ in the current toolchain file. Is that the best way forward, or should I create new compiler and/or assembler definitions?
- Will I need separate platform sub-definitions for the host OSes (Linux, Mac, Win)?
- If I do this work, what chance is there of it being acceptable/accepted?