You copied the Doc URL to your clipboard.

-nostdlibinc

Tells the compiler to exclude the Arm® standard C and C++ library header files.

Note

This option still searches the lib/clang/*/include directory.

If you want to disable the use of the Arm standard library, then use both the -nostdlibinc and -nostdlib armclang options.

Default

-nostdlibinc is disabled by default.

Example

#include "math.h" 

double foo(double d) 
{
    return sqrt(d + 1.0);
} 
int main(int argc, char *argv[])
{
    return foo(argc);
}

Compiling this code without -nostdlibinc generates a call to __hardfp_sqrt, from the Arm standard library.

armclang --target=arm-arm-none-eabi -mcpu=Cortex-A9 -O0 -S -o- file.c -mfloat-abi=hard

Compiling this code with -nostdlibinc and -nostdlib generates an error because the compiler cannot include the standard library header file math.h.

armclang --target=arm-arm-none-eabi -mcpu=Cortex-A9 -O0 -S -o- file.c -mfloat-abi=hard -nostdlibinc -nostdlib
Was this page helpful? Yes No