Technical Support
On-Line Manuals
Compiler Reference Guide
Version 6.14
Tells the compiler to not use the Arm® standard C and C++ libraries.
If you use the -nostdlib option, armclang does not collude with the Arm standard
library and only emits calls to functions that the C Standard or the AEABI defines.
The output from armclang works with any ISO C
library that is compliant with AEABI.
-nostdlib
armclang
The -nostdlib
armclang option, passes the --no_scanlib linker option to armlink. Therefore you must specify the location of the libraries you want
to use as input objects to armlink, or with the
--userlibpath
armlink option.
--no_scanlib
armlink
--userlibpath
-nostdlib is disabled by default.
#include "math.h"
double foo(double d)
{
return sqrt(d + 1.0);
}
int main(int argc, char *argv[])
{
return foo(argc);
}
Compiling this code with -nostdlib generates
a call to sqrt, which is AEABI compliant.
sqrt
armclang --target=arm-arm-none-eabi -mcpu=Cortex-A9 -O0 -S -o- file.c -mfloat-abi=hard -nostdlib
Compiling this code without -nostdlib
generates a call to __hardfp_sqrt (from the
Arm
standard library), which the C Standard and the AEABI do not define.
__hardfp_sqrt
armclang --target=arm-arm-none-eabi -mcpu=Cortex-A9 -O0 -S -o- file.c -mfloat-abi.