summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordp-arm <dimitris.papastamos@arm.com>2017-05-02 12:00:08 +0100
committerdp-arm <dimitris.papastamos@arm.com>2017-05-24 14:24:49 +0100
commitd5461857ac66ed4f5ad002936efd9bd8cf99d22f (patch)
treed6877f507c52a634cefd76b2465c6d7af96d8351 /Makefile
parent72610c4102990d4f17bd654acad9a415733f795b (diff)
build: Introduce clang support
Only the compiler is switched to clang. The assembler and linker are provided by the GCC toolchain. clang is used to build TF when the base name of the path assigned to `CC` contains the string 'clang'. `CROSS_COMPILE` is still needed and should point to the appropriate GCC toolchain. Tested with clang 3.9.x and 4.0.x. Change-Id: I53236d64e3c83ad27fc843bae5fcdae30f2e325e Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 15d41829..44d4933b 100644
--- a/Makefile
+++ b/Makefile
@@ -126,11 +126,18 @@ OD := ${CROSS_COMPILE}objdump
NM := ${CROSS_COMPILE}nm
PP := ${CROSS_COMPILE}gcc -E
-ASFLAGS_aarch64 = -mgeneral-regs-only
-TF_CFLAGS_aarch64 = -mgeneral-regs-only -mstrict-align
+ifneq ($(findstring clang,$(notdir $(CC))),)
+TF_CFLAGS_aarch32 = -target armv8a-none-eabi
+TF_CFLAGS_aarch64 = -target aarch64-elf
+else
+TF_CFLAGS_aarch32 = -march=armv8-a
+TF_CFLAGS_aarch64 = -march=armv8-a
+endif
+
+TF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align
ASFLAGS_aarch32 = -march=armv8-a
-TF_CFLAGS_aarch32 = -march=armv8-a
+ASFLAGS_aarch64 = -march=armv8-a
CPPFLAGS = ${DEFINES} ${INCLUDES} -nostdinc \
-Wmissing-include-dirs -Werror