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

Commit a7f230f4 authored by Behan Webster's avatar Behan Webster Committed by Avaneesh Kumar Dwivedi
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
KernelVersion:
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>
parent f0a4ec7d
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -31,6 +31,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),)
@@ -39,16 +42,16 @@ 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
@@ -106,7 +109,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 -mno-thumb-interwork -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
@@ -130,7 +133,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
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ CFLAGS_fdt_ro.o := $(nossp_flags)
CFLAGS_fdt_rw.o := $(nossp_flags)
CFLAGS_fdt_wip.o := $(nossp_flags)

ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj)
asflags-y := -DZIMAGE

# Supply kernel BSS size to the decompressor via a linker symbol.