Create local C library implementation (1/2)
- This change is split into two separate patches in order to
simplify the history as interpreted by 'git'. The split is
between the move/rename and addition of new files.
- Remove dependency on toolchain C library headers and functions in
order to ensure behavioural compatibility between toolchains.
- Use FreeBSD as reference for C library implementation.
- Do not let GCC use default library include paths.
- Remove unused definitions in modified headers and implementations.
- Move C library files to 'lib/stdlib' and 'include/stdlib'.
- Break std.c functions out into separate files.
Change-Id: I91cddfb3229775f770ad781589670c57d347a154
diff --git a/Makefile b/Makefile
index e1b0b8f..544af73 100644
--- a/Makefile
+++ b/Makefile
@@ -93,10 +93,12 @@
-Idrivers/arm/interconnect/cci-400/ \
-Idrivers/arm/peripherals/pl011/ \
-Iplat/fvp -Idrivers/power \
- -Iarch/system/gic -Icommon/psci
+ -Iarch/system/gic -Icommon/psci \
+ -Iinclude/stdlib -Iinclude/stdlib/sys
-ASFLAGS += -Wa,--fatal-warnings -D__ASSEMBLY__ ${INCLUDES}
-CFLAGS := -Wall -Werror -std=c99 -c -Os -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS}
+ASFLAGS += -nostdinc -Wa,--fatal-warnings -D__ASSEMBLY__ ${INCLUDES}
+CFLAGS := -nostdinc -Wall -Werror -std=c99 -c -Os \
+ -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS}
LDFLAGS += --fatal-warnings -O1
BL1_LDFLAGS := -Map=${BL1_MAPFILE} --script ${BL1_LINKERFILE} --entry=${BL1_ENTRY_POINT}