Skip to content

Commit 4380714

Browse files
Vladimir IsaevVVIsaev
authored andcommitted
ARC: Fix warnings related to MCPU option
Before fix: $ make clean arch/arc/Makefile:44: ** WARNING ** CONFIG_ARC_TUNE_MCPU flag '' is unknown, fallback to '-mcpu=hs38' ... This happened because CONFIG_ARC_TUNE_MCPU is '' for clean target and '""' for build targets. Now it is fixed. Signed-off-by: Vladimir Isaev <isaev@synopsys.com>
1 parent d9aec1d commit 4380714

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

arch/arc/Makefile

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55

66
KBUILD_DEFCONFIG := haps_hs_smp_defconfig
77

8+
ifdef cross_compiling
89
ifeq ($(CROSS_COMPILE),)
910
ifdef CONFIG_ISA_ARCV3
11+
ifdef CONFIG_64BIT
1012
CROSS_COMPILE := $(call cc-cross-prefix, arc64-elf- arc64-linux-gnu- arc64-linux- arc64-unknown-linux-gnu-)
1113
else
14+
CROSS_COMPILE := $(call cc-cross-prefix, arc64-elf- arc32-linux-gnu- arc32-linux- arc32-unknown-linux-gnu-)
15+
endif
16+
else
1217
CROSS_COMPILE := $(call cc-cross-prefix, arc-elf32- arc-linux- arceb-linux-)
1318
endif
1419
endif
20+
endif
1521

1622
ifdef CONFIG_ISA_ARCV3
1723
ifdef CONFIG_64BIT
@@ -30,29 +36,32 @@ tune-mcpu-def-$(CONFIG_ISA_ARCV3) := -mcpu=hs5x
3036
ldflags-$(CONFIG_ISA_ARCV3) += -marc64elf32
3137
endif
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
4539
tune-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)
5346
endif
47+
else
48+
tune-mcpu := $(tune-mcpu-def-y)
5449
endif
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

5766
ifdef CONFIG_ARC_CURR_IN_REG
5867
# For a global register definition, make sure it gets passed to every file

0 commit comments

Comments
 (0)