18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci# Makefile for the Hexagon arch 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciKBUILD_DEFCONFIG = comet_defconfig 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci# Do not use GP-relative jumps 78c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -G0 88c2ecf20Sopenharmony_ciLDFLAGS_vmlinux += -G0 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci# Do not use single-byte enums; these will overflow. 118c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -fno-short-enums 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci# We must use long-calls: 148c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -mlong-calls 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci# Modules must use either long-calls, or use pic/plt. 178c2ecf20Sopenharmony_ci# Use long-calls for now, it's easier. And faster. 188c2ecf20Sopenharmony_ci# KBUILD_CFLAGS_MODULE += -fPIC 198c2ecf20Sopenharmony_ci# KBUILD_LDFLAGS_MODULE += -shared 208c2ecf20Sopenharmony_ciKBUILD_CFLAGS_MODULE += -mlong-calls 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cicflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) 238c2ecf20Sopenharmony_ciaflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) 248c2ecf20Sopenharmony_cildflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciKBUILD_CFLAGS += $(cflags-y) 278c2ecf20Sopenharmony_ciKBUILD_AFLAGS += $(aflags-y) 288c2ecf20Sopenharmony_ciKBUILD_LDFLAGS += $(ldflags-y) 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci# Thread-info register will be r19. This value is not configureable; 318c2ecf20Sopenharmony_ci# it is hard-coded in several files. 328c2ecf20Sopenharmony_ciTIR_NAME := r19 338c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__ 348c2ecf20Sopenharmony_ciKBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME) 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_cihead-y := arch/hexagon/kernel/head.o 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cicore-y += arch/hexagon/kernel/ \ 398c2ecf20Sopenharmony_ci arch/hexagon/mm/ \ 408c2ecf20Sopenharmony_ci arch/hexagon/lib/ 41