Use clang assembler when clang compiler is used
authorRoberto Vargas <[email protected]>
Mon, 16 Apr 2018 10:29:45 +0000 (11:29 +0100)
committerRoberto Vargas <[email protected]>
Wed, 11 Jul 2018 08:23:05 +0000 (09:23 +0100)
Change-Id: Ib90b767e46360ef07c1f22526e3f3eb5fe366d5d
Signed-off-by: Roberto Vargas <[email protected]>
Makefile

index ed45fa3fc31ab48c762e3d8a45e630c0d9df9b35..e25c380c44cd6ceda3197b8bb802dd4d92ab56aa 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,13 @@ $(eval $(call add_define,DEBUG))
 ifneq (${DEBUG}, 0)
         BUILD_TYPE     :=      debug
         TF_CFLAGS      +=      -g
-        ASFLAGS                +=      -g -Wa,--gdwarf-2
+
+        ifneq ($(findstring clang,$(notdir $(CC))),)
+             ASFLAGS           +=      -g
+        else
+             ASFLAGS           +=      -g -Wa,--gdwarf-2
+        endif
+
         # Use LOG_LEVEL_INFO by default for debug builds
         LOG_LEVEL      :=      40
 else
@@ -144,10 +150,12 @@ ifeq ($(notdir $(CC)),armclang)
 TF_CFLAGS_aarch32      =       -target arm-arm-none-eabi $(march32-directive)
 TF_CFLAGS_aarch64      =       -target aarch64-arm-none-eabi -march=armv8-a
 LD                     =       $(LINKER)
+AS                     =       $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
 else ifneq ($(findstring clang,$(notdir $(CC))),)
 TF_CFLAGS_aarch32      =       $(target32-directive)
 TF_CFLAGS_aarch64      =       -target aarch64-elf
 LD                     =       $(LINKER)
+AS                     =       $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
 else
 TF_CFLAGS_aarch32      =       $(march32-directive)
 TF_CFLAGS_aarch64      =       -march=armv8-a