Keil Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Preface armclang Command-line Options Support level definitions Summary of armclang command-line options -C -c -D -E -e -fbare-metal-pie -fbracket-depth=N -fcommon, -fno-common -fdata-sections, -fno-data-sections -ffast-math, -fno-fast-math -ffixed-rN -ffp-mode -ffunction-sections, -fno-function-sections -fident, -fno-ident @file -fldm-stm, -fno-ldm-stm -fno-builtin -fno-inline-functions -flto, -fno-lto -fexceptions, -fno-exceptions -fomit-frame-pointer, -fno-omit-frame-pointer -fropi, -fno-ropi -fropi-lowering, -fno-ropi-lowering -frwpi, -fno-rwpi -frwpi-lowering, -fno-rwpi-lowering -fshort-enums, -fno-short-enums -fshort-wchar, -fno-short-wchar -fstack-protector, -fstack-protector-all, -fstack- -fstrict-aliasing, -fno-strict-aliasing -ftrapv -fvectorize, -fno-vectorize -fvisibility -fwrapv -g, -gdwarf-2, -gdwarf-3, -gdwarf-4 -I -include -L -l -M, -MM -MD, -MMD -MF -MG -MP -MT -march -marm -masm -mbig-endian -mbranch-protection -mcmse -mcpu -mexecute-only -mfloat-abi -mfpu -mimplicit-it -mlittle-endian -mmemtag-stack, -mno-memtag-stack -mno-neg-immediates -moutline, -mno-outline -mpixolib -munaligned-access, -mno-unaligned-access -mthumb -nostdlib -nostdlibinc -o -O -pedantic -pedantic-errors -Rpass -S -save-temps -std --target -U -u -v --version --version_number --vsn -W -Wl -Xlinker -x -### Compiler-specific Keywords and Operators Compiler-specific Function, Variable, and Type Att Compiler-specific Intrinsics Compiler-specific Pragmas Other Compiler-specific Features Standard C Implementation Definition Standard C++ Implementation Definition armclang Integrated Assembler armclang Inline Assembler

-nostdlib

1.65 -nostdlib

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.

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.

Note:

If you want to use your own libraries instead of the Arm standard libraries or if you want to re-implement the standard library functions, then you must use the -nostdlib armclang option. Your libraries must be compliant with the ISO C library and with the AEABI specification.

Default

-nostdlib 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 with -nostdlib generates a call to sqrt, which is AEABI compliant.

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.

armclang --target=arm-arm-none-eabi -mcpu=Cortex-A9 -O0 -S -o- file.c -mfloat-abi=hard
Non-ConfidentialPDF file icon PDF version100067_0612_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.