[CMake] XMOS ASM / C Compiler support progress and questions

Bernhard Sputh bernhard.sputh at gmail.com
Thu Oct 13 04:32:57 EDT 2011


Hi Alexander,

2011/10/12 Alexander Neundorf <a.neundorf-work at gmx.net>:
> Hi,
>
> On Wednesday 12 October 2011, Bernhard Sputh wrote:

> Cool :-)
> Please create an entry in the bug tracker for that, so it doesn't get lost.

OK, will do this later today.

> Since 2.8.5 the "ASM" language is the one to use for assembler files which are
> processed by the C or C++ compiler, i.e. which may need to be preprocessed.
> I.e. you shouldn't even have to set CMAKE_ASM_COMPILER, when enabling ASM it
> will use the value of CMAKE_C_COMPILER for CMAKE_ASM_COMPILER.

Ah good to know.

> Why do you set the compiler id to GNU ?
> That's not a good idea I'd say.

The XMOS toolchain has for the basic functions compatible command line
switches to the GNU toolchain. However, it's not based on GNU
directly, but is based on LLVM [1] instead.

>> I would prefer to not to have not force the compiler, but the recent
>> XMOS toolchain require an additional command line argument to specify
>> the processor to compile for: `-target'. As far as I'm aware there is
>> no way to pass additional compiler flags to the compiler checking
>> operations.
>
> How does the syntax look exactly ?
>
> xcc -target Foo ....
> or
> xcc -target=Foo ...
> ?
>
> In the second case, it should work if you do
> set(CMAKE_C_COMPILER xcc -target=Foo)

Thank you for that hint, it will be useful in the future.

To be precise there are two forms, one where one uses the from:
- `-target=XC-1': To select the XC-1 development board.
- `${PATH}/${System}.xn': To specify a custom topology which consists
of one or multiple CPU-Cores and their IO.

I'll have to experiment here a little bit, and maybe get in touch with
XMOS regarding this. Their previous versions of the toolchain (before
version 10.x) could work without this option. This is not sufficient
when compiling and linking for real systems, but more than sufficient
to check whether or not the compiler works.

Cheers
Bernhard

[1] http://llvm.org/


More information about the CMake mailing list