55
66KBUILD_DEFCONFIG := haps_hs_smp_defconfig
77
8+ ifdef cross_compiling
89ifeq ($(CROSS_COMPILE ) ,)
910ifdef CONFIG_ISA_ARCV3
11+ ifdef CONFIG_64BIT
1012CROSS_COMPILE := $(call cc-cross-prefix, arc64-elf- arc64-linux-gnu- arc64-linux- arc64-unknown-linux-gnu-)
1113else
14+ CROSS_COMPILE := $(call cc-cross-prefix, arc64-elf- arc32-linux-gnu- arc32-linux- arc32-unknown-linux-gnu-)
15+ endif
16+ else
1217CROSS_COMPILE := $(call cc-cross-prefix, arc-elf32- arc-linux- arceb-linux-)
1318endif
1419endif
20+ endif
1521
1622ifdef CONFIG_ISA_ARCV3
1723ifdef CONFIG_64BIT
@@ -30,29 +36,32 @@ tune-mcpu-def-$(CONFIG_ISA_ARCV3) := -mcpu=hs5x
3036ldflags-$(CONFIG_ISA_ARCV3) += -marc64elf32
3137endif
3238
33- cflags-y += -fno-common -pipe -fno-builtin -D__linux__
34- ifndef CONFIG_ISA_ARCV3
35- cflags-y += -fsection-anchors -mno-sdata -mmedium-calls
36- else
37- cflags-$(CONFIG_64BIT) += -mcmodel=large
38- cflags-$(CONFIG_ARC_HAS_LL128) += -m128
39- endif
40- cflags-y += -Wa,-I$(srctree ) /arch/arc/include
41-
42- ifeq ($(CONFIG_ARC_TUNE_MCPU ) ,"")
43- cflags-y += $(tune-mcpu-def-y )
44- else
4539tune-mcpu := $(shell echo $(CONFIG_ARC_TUNE_MCPU ) )
46- ifneq ($(call cc-option,$(tune-mcpu ) ) ,)
47- cflags-y += $(tune-mcpu )
48- else
40+ ifneq ($(tune-mcpu ) ,)
41+ ifeq ($(call cc-option,$(tune-mcpu ) ) ,)
4942# The flag provided by 'CONFIG_ARC_TUNE_MCPU' option isn't known by this compiler
5043# (probably the compiler is too old). Use ISA default mcpu flag instead as a safe option.
5144$(warning ** WARNING ** CONFIG_ARC_TUNE_MCPU flag '$(tune-mcpu)' is unknown, fallback to '$(tune-mcpu-def-y)')
52- cflags-y + = $(tune-mcpu-def-y )
45+ tune-mcpu : = $(tune-mcpu-def-y )
5346endif
47+ else
48+ tune-mcpu := $(tune-mcpu-def-y )
5449endif
5550
51+ cflags-y += $(tune-mcpu )
52+
53+ cflags-y += -fno-common -pipe -fno-builtin -D__linux__
54+
55+ ifneq ($(filter y,$(CONFIG_ISA_ARCOMPACT ) $(CONFIG_ISA_ARCV2 ) ) ,)
56+ cflags-y += -fsection-anchors -mno-sdata -mmedium-calls
57+ endif
58+
59+ ifdef CONFIG_ISA_ARCV3
60+ cflags-$(CONFIG_64BIT) += -mcmodel=large
61+ cflags-$(CONFIG_ARC_HAS_LL128) += -m128
62+ endif
63+
64+ cflags-y += -Wa,-I$(srctree ) /arch/arc/include
5665
5766ifdef CONFIG_ARC_CURR_IN_REG
5867# For a global register definition, make sure it gets passed to every file
0 commit comments