The ARM Compiler toolchain enables you to build applications that have been developed to build only with GCC. However, there might be cases when the ARM Compiler toolchain cannot complete the build successfully, because of GCC specific functionality that the ARM Compiler toolchain does not emulate. For such cases, a compiler feature is provided that invokes the GCC toolchain to attempt to complete the build. This feature is known as GCC fallback, and it supports the CodeSourcery 2010Q1 gcc toolchain release.
GCC fallback cannot be used to build the Linux kernel, only user applications.
To specify GCC fallback, include the compiler option
GCC is invoked with the same GCC-style command-line options that
are given to armcc. Therefore, GCC fallback has
the same effect as the following shell script:
armcc $myflags if found-gcc-specific-coding; then gcc $myflags endif
The whole build is still driven by the build script, makefile, or other infrastructure you are using, and that does not change. For example, a single compile step might fail when armcc tries to compile that step. armcc then attempts to perform that single compile step with gcc. If a link step fails, armcc attempts to perform the link with the GCC toolchain, using GNU ld. When armcc performs a compile or link step, the include paths, library paths, and Linux libraries it uses are identified in the ARM Linux configuration file. For fallback, you must either:
--arm_linux_config_filecompiler option to produce the configuration file by configuring armcc against an existing gcc
provide an explicit path to gcc if you are specifying other configuration options manually.
The GCC toolchain used for fallback is the one that the configuration was created against. Therefore, the paths and libraries used by armcc and gcc must be equivalent.
If GCC fallback is invoked by armcc, a warning message is displayed. If gcc also fails, an additional error is displayed, otherwise you get a message indicating that gcc succeeded. You also see the original error messages from armcc to inform you of the source file or files that failed to compile, and the cause of the problem.
There is no change to what the ARM Compiler tools link with when using GCC fallback. That is, the tools only link with whatever gcc links with, as identified in the configuration file generated with the
--arm_linux_config_filecompiler option. Therefore, it is your responsibility to ensure that licenses are adhered to, and in particular to check what you are linking with. You might have to explicitly override this if necessary. To do this, include the GNU options
-nostdlibon the armcc command-line.
armcc invokes the GNU tools in a separate process.
armcc does not optimize any code in any GCC intermediate representations.
To see the commands that are invoked during GCC fallback,
-Warmcc,--echo command-line option.
The following figure shows a high-level view of the GCC fallback process: