xref: /OK3568_Linux_fs/kernel/arch/hexagon/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun#  Makefile for the Hexagon arch
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunKBUILD_DEFCONFIG = comet_defconfig
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun# Do not use GP-relative jumps
7*4882a593SmuzhiyunKBUILD_CFLAGS += -G0
8*4882a593SmuzhiyunLDFLAGS_vmlinux += -G0
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun# Do not use single-byte enums; these will overflow.
11*4882a593SmuzhiyunKBUILD_CFLAGS += -fno-short-enums
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun# We must use long-calls:
14*4882a593SmuzhiyunKBUILD_CFLAGS += -mlong-calls
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun# Modules must use either long-calls, or use pic/plt.
17*4882a593Smuzhiyun# Use long-calls for now, it's easier.  And faster.
18*4882a593Smuzhiyun# KBUILD_CFLAGS_MODULE += -fPIC
19*4882a593Smuzhiyun# KBUILD_LDFLAGS_MODULE += -shared
20*4882a593SmuzhiyunKBUILD_CFLAGS_MODULE += -mlong-calls
21*4882a593Smuzhiyun
22*4882a593Smuzhiyuncflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
23*4882a593Smuzhiyunaflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
24*4882a593Smuzhiyunldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunKBUILD_CFLAGS += $(cflags-y)
27*4882a593SmuzhiyunKBUILD_AFLAGS += $(aflags-y)
28*4882a593SmuzhiyunKBUILD_LDFLAGS += $(ldflags-y)
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun# Thread-info register will be r19.  This value is not configureable;
31*4882a593Smuzhiyun# it is hard-coded in several files.
32*4882a593SmuzhiyunTIR_NAME := r19
33*4882a593SmuzhiyunKBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
34*4882a593SmuzhiyunKBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
35*4882a593Smuzhiyun
36*4882a593Smuzhiyunhead-y := arch/hexagon/kernel/head.o
37*4882a593Smuzhiyun
38*4882a593Smuzhiyuncore-y += arch/hexagon/kernel/ \
39*4882a593Smuzhiyun	arch/hexagon/mm/ \
40*4882a593Smuzhiyun	arch/hexagon/lib/
41