Makefile: Enable strict align arch minor version

Add -mstrict-align flag, and -march minor version. These are needed to
prevent compilers generating unaligned accesses and enable
architectural features respectively.

Enable the SCTLR.A and SCTLR.SA alignment checks in all images.

TF test has several cases of code which enable the alignment checks.

Change-Id: I9a0413786caf94d0abf376aa1b4fb54fc7f2f355
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
diff --git a/Makefile b/Makefile
index ece61a2..e699def 100644
--- a/Makefile
+++ b/Makefile
@@ -174,11 +174,20 @@
 COMMON_ASFLAGS		+= 	-g -Wa,--gdwarf-2
 endif
 
-COMMON_ASFLAGS_aarch64	:=	-mgeneral-regs-only
-COMMON_CFLAGS_aarch64	:=	-mgeneral-regs-only
+# Set the compiler's target architecture profile based on ARM_ARCH_MINOR option
+ifeq (${ARM_ARCH_MINOR},0)
+march32-directive	= 	-march=armv8-a
+march64-directive	= 	-march=armv8-a
+else
+march32-directive	= 	-march=armv8.${ARM_ARCH_MINOR}-a
+march64-directive	= 	-march=armv8.${ARM_ARCH_MINOR}-a
+endif
 
-COMMON_ASFLAGS_aarch32	:=	-march=armv8-a
-COMMON_CFLAGS_aarch32	:=	-march=armv8-a
+COMMON_ASFLAGS_aarch64	:=	-mgeneral-regs-only ${march64-directive}
+COMMON_CFLAGS_aarch64	:=	-mgeneral-regs-only -mstrict-align ${march64-directive}
+
+COMMON_ASFLAGS_aarch32	:=	${march32-directive}
+COMMON_CFLAGS_aarch32	:=	${march32-directive} -mno-unaligned-access
 
 COMMON_ASFLAGS		+=	-nostdinc -ffreestanding -Wa,--fatal-warnings	\
 				-Werror -Wmissing-include-dirs			\