Do not let GCC use built-in functions
authorHarry Liebel <Harry.Liebel@arm.com>
Fri, 20 Dec 2013 18:51:12 +0000 (18:51 +0000)
committerDan Handley <dan.handley@arm.com>
Fri, 17 Jan 2014 10:27:52 +0000 (10:27 +0000)
In order to reduce the software dependency on the compiler, the project
is now compiled with the '-ffreestanding' flag. This is to prevent GCC
from replacing functions with more optimised versions. An example is
where GCC replaces a simple printf() with a puts().

Change-Id: I1973fe6957cd708e8432a0039af9d50e037bd884

Makefile
docs/change-log.md

index 544af731cb5f7cda2dcad29c3241c9a3f591ad86..d3951eadb957a216d634dc9b87e3f2316e7b2b7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -96,8 +96,9 @@ INCLUDES              +=      -Ilib/include/ -Iinclude/aarch64/ -Iinclude/    \
                                -Iarch/system/gic -Icommon/psci                 \
                                -Iinclude/stdlib -Iinclude/stdlib/sys
 
-ASFLAGS                        +=      -nostdinc -Wa,--fatal-warnings -D__ASSEMBLY__ ${INCLUDES}
-CFLAGS                 :=      -nostdinc -Wall -Werror -std=c99 -c -Os \
+ASFLAGS                        +=      -nostdinc -ffreestanding -Wa,--fatal-warnings   \
+                               -D__ASSEMBLY__ ${INCLUDES}
+CFLAGS                 :=      -nostdinc -ffreestanding -Wall -Werror -std=c99 -c -Os \
                                -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS}
 
 LDFLAGS                        +=      --fatal-warnings -O1
index 08d185455b8b4781196c688af47958c8688d628a..b400ac7a8f45e4d6ff256e5a794131ce4e1524ea 100644 (file)
@@ -82,6 +82,9 @@ Detailed changes since last release
     Implementations for `putchar()` and `strchr()` were added to the local C
     library.
 
+*   GCC compiler built-in function support has been disabled in order to improve
+    compiler independence.
+
 
 ARM Trusted Firmware - version 0.2
 ==================================