Merge tag 'perf-urgent-2020-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / arch / hexagon / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #  Makefile for the Hexagon arch
3
4 KBUILD_DEFCONFIG = comet_defconfig
5
6 # Do not use GP-relative jumps
7 KBUILD_CFLAGS += -G0
8 LDFLAGS_vmlinux += -G0
9
10 # Do not use single-byte enums; these will overflow.
11 KBUILD_CFLAGS += -fno-short-enums
12
13 # Modules must use either long-calls, or use pic/plt.
14 # Use long-calls for now, it's easier.  And faster.
15 # KBUILD_CFLAGS_MODULE += -fPIC
16 # KBUILD_LDFLAGS_MODULE += -shared
17 KBUILD_CFLAGS_MODULE += -mlong-calls
18
19 cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
20 aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
21 ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
22
23 KBUILD_CFLAGS += $(cflags-y)
24 KBUILD_AFLAGS += $(aflags-y)
25 KBUILD_LDFLAGS += $(ldflags-y)
26
27 # Thread-info register will be r19.  This value is not configureable;
28 # it is hard-coded in several files.
29 TIR_NAME := r19
30 KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
31 KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
32
33 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
34 libs-y += $(LIBGCC)
35
36 head-y := arch/hexagon/kernel/head.o
37
38 core-y += arch/hexagon/kernel/ \
39         arch/hexagon/mm/ \
40         arch/hexagon/lib/