1.3 -c

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
Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.