You copied the Doc URL to your clipboard.

-c (armclang)

Instructs the compiler to perform the compilation step, but not the link step.


Arm recommends using the -c option in projects with more than one source file.

The compiler creates one object file for each source file, with a .o file extension replacing the file extension on the input source file. For example, the following creates object files test1.o, test2.o, and test3.o:

armclang --target=aarch64-arm-none-eabi -mcpu=cortex-a53 -c test1.c test2.c test3.c


If you specify multiple source files with the -c option, the -o option results in an error. For example:

armclang --target=aarch64-arm-none-eabi -mcpu=cortex-a53 -c test1.c test2.c -o test.o
armclang: error: cannot specify -o when generating multiple output files