Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5ffb381 authored by Behan Webster's avatar Behan Webster Committed by Naitik Bharadiya
Browse files

Kbuild arm: LLVMLinux: Add Kbuild support for building arch arm with Clang



Protect more options for arm with cc-option so that we don't get errors when
using clang instead of gcc.  Add more or different options when using clang as
well.

Change-Id: I766784273a1005abc09820671c8f4c8daacc2879
Author: Behan Webster <behanw@converseincode.com>
Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Patch-mainline: linux-arm-kernel @ 22/04/14, 06:08
Signed-off-by: default avatarAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
Link: https://lore.kernel.org/lkml/1398146898-15009-1-git-send-email-behanw@converseincode.com/


Signed-off-by: default avatarNaitik Bharadiya <bharad@codeaurora.org>
parent aeb74a7e
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)

# This should work on most of the modern platforms
KBUILD_DEFCONFIG := multi_v7_defconfig
ifeq ($(COMPILER),clang)
KBUILD_CFLAGS += -Wa,-mno-warn-deprecated
endif

# defines filename extension depending memory management type.
ifeq ($(CONFIG_MMU),)
@@ -43,15 +46,17 @@ KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access)
endif

ifeq ($(CONFIG_FRAME_POINTER),y)
KBUILD_CFLAGS	+=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
KBUILD_CFLAGS	+=-fno-omit-frame-pointer $(call cc-option,-mapcs,) $(call cc-option,-mno-sched-prolog,)
endif

ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS	+= -mbig-endian
KBUILD_CPPFLAGS	+= $(call cc-option,-mbig-endian)
CHECKFLAGS	+= -D__ARMEB__
AS		+= -EB
LD		+= -EB
else
KBUILD_CPPFLAGS	+= -mlittle-endian
KBUILD_CPPFLAGS	+= $(call cc-option,-mlittle-endian)
CHECKFLAGS	+= -D__ARMEL__
AS		+= -EL
LD		+= -EL
endif
@@ -108,7 +113,7 @@ tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
tune-y := $(tune-y)

ifeq ($(CONFIG_AEABI),y)
CFLAGS_ABI	:=-mabi=aapcs-linux -mfpu=vfp
CFLAGS_ABI	:=-mabi=aapcs-linux $(call cc-option,-mno-thumb-interwork,) -mfpu=vfp
else
CFLAGS_ABI	:=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
endif
@@ -132,7 +137,7 @@ AFLAGS_ISA :=$(CFLAGS_ISA)
endif

# Need -Uarm for gcc < 3.x
KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float $(call cc-option, -Uarm,)
KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float

CHECKFLAGS	+= -D__arm__ -m32