Tells the compiler not to use generic (non-Arm specific) handling and optimization of standard C and C++ library functions and operators, for example for the printf(), strlen(), and malloc() functions from the C standard library, or for the new and delete operators from the C++ standard library.
When compiling without -fno-builtin, the
compiler can replace calls to certain standard library functions with inline code or
with calls to other library functions. The Run-time ABI for
the Arm® Architecture lists library
functions that the compiler can use. This means that your re-implementations of the
standard library functions might not be used, and might be removed by the linker.
Note:
The -fno-builtin option does not prevent Arm specific
transformations from within the Arm implementation of the C Standard Library. Use
the -nostdlib option to tell the compiler not to use the Arm standard C and C++ libraries.
Default
-fno-builtin is disabled by
default.
Example without -fno-builtin
The following test program uses the printf()
function:
The compiler has not replaced the printf() function with the puts() function when using the -fno-builtin option. Instead, it has replaced it with __2printf from the Arm standard C library. In
order to prevent that, you need to use the -nostdlib option as well.
Example with -fno-builtin and
-nostdlib
Compile the test program with -fno-builtin and -nostdlib:
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.