refactor(build): pass TF_CFLAGS to the assembler

The assembler is already invoked through the gcc/llvm wrapper so will
understand the TF_CFLAGS out of the box. TF_CFLAGS are also quite
comprehensive. So don't duplicate the definitions and use it directly.
This also allows to absorb TF_CFLAGS_$(ARCH) and CPPFLAGS and reduce
the number of permutations of flags we pass.

Change-Id: I801cea0421dab5a07bf720be9693dce3ef220dcf
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 2ba462f..19c3faa 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -357,7 +357,7 @@
 
 $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/
 	$$(s)echo "  AS      $$<"
-	$$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@
+	$$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS) $$(ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@
 
 -include $(DEP)
 
@@ -405,7 +405,7 @@
 
 $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/
 	$$(s)echo "  AS      $$<"
-	$$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS_$(ARCH)) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@
+	$$(q)$($(ARCH)-as) -x assembler-with-cpp $$(TF_CFLAGS) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(call MAKE_DEP,$(DEP),$(OBJ)) -c $$< -o $$@
 
 -include $(DEP)
 
diff --git a/make_helpers/cflags.mk b/make_helpers/cflags.mk
index 429dda0..e237c51 100644
--- a/make_helpers/cflags.mk
+++ b/make_helpers/cflags.mk
@@ -30,7 +30,6 @@
 # Process Debug flag
 ifneq (${DEBUG}, 0)
 	TF_CFLAGS	+=	-g -gdwarf-4
-	ASFLAGS		+=	-g -Wa,-gdwarf-4
 endif #(Debug)
 
 ifeq (${AARCH32_INSTRUCTION_SET},A32)
@@ -165,7 +164,6 @@
 endif
 
 TF_CFLAGS	+=	$(march-directive)
-ASFLAGS		+=	$(march-directive)
 
 ifneq ($(PIE_FOUND),)
 	TF_CFLAGS	+=	-fno-PIE
@@ -173,8 +171,7 @@
 
 TF_CFLAGS		+=	$(CPPFLAGS) $(TF_CFLAGS_$(ARCH))
 TF_CFLAGS		+=	$(CFLAGS)
-ASFLAGS			+=	$(CPPFLAGS)                 			\
-				-ffreestanding -Wa,--fatal-warnings
+ASFLAGS			+=	-Wa,--fatal-warnings
 TF_LDFLAGS		+=	-z noexecstack
 
 # LD = armlink