summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--include/lib/aarch32/arch_helpers.h4
2 files changed, 12 insertions, 5 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
diff --git a/include/lib/aarch32/arch_helpers.h b/include/lib/aarch32/arch_helpers.h
index af498ca5..e652a59e 100644
--- a/include/lib/aarch32/arch_helpers.h
+++ b/include/lib/aarch32/arch_helpers.h
@@ -36,8 +36,8 @@ static inline u_register_t read_ ## _name(void) \
* systems for GCC versions < 4.6. Above GCC 4.6, both Little Endian and
* Big Endian systems generate the right instruction encoding.
*/
-#if !(__GNUC__ > (4) || __GNUC__ == (4) && __GNUC_MINOR__ >= (6))
-#error "GCC 4.6 or above is required to build AArch32 Trusted Firmware"
+#if !(__clang__ || __GNUC__ > (4) || __GNUC__ == (4) && __GNUC_MINOR__ >= (6))
+#error "clang or GCC 4.6 or above is required to build AArch32 Trusted Firmware"
#endif
#define _DEFINE_COPROCR_WRITE_FUNC_64(_name, coproc, opc1, CRm) \