blob: 44312bc147d83854ec85c649fe6b57734df0b6be [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Richard Kuoe95bf452011-10-31 18:55:58 -05002# Makefile for the Hexagon arch
3
4KBUILD_DEFCONFIG = comet_defconfig
5
6# Do not use GP-relative jumps
7KBUILD_CFLAGS += -G0
8LDFLAGS_vmlinux += -G0
9
10# Do not use single-byte enums; these will overflow.
11KBUILD_CFLAGS += -fno-short-enums
12
Sid Manning788dcee2021-04-23 15:06:58 -050013# We must use long-calls:
14KBUILD_CFLAGS += -mlong-calls
15
Richard Kuoe95bf452011-10-31 18:55:58 -050016# Modules must use either long-calls, or use pic/plt.
17# Use long-calls for now, it's easier. And faster.
Cao jin3a5befc2017-10-09 15:11:47 +080018# KBUILD_CFLAGS_MODULE += -fPIC
19# KBUILD_LDFLAGS_MODULE += -shared
20KBUILD_CFLAGS_MODULE += -mlong-calls
Richard Kuoe95bf452011-10-31 18:55:58 -050021
Richard Kuo66b03db2012-03-27 17:37:33 -050022cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
23aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
24ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
Richard Kuoe95bf452011-10-31 18:55:58 -050025
26KBUILD_CFLAGS += $(cflags-y)
27KBUILD_AFLAGS += $(aflags-y)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090028KBUILD_LDFLAGS += $(ldflags-y)
Richard Kuoe95bf452011-10-31 18:55:58 -050029
30# Thread-info register will be r19. This value is not configureable;
31# it is hard-coded in several files.
32TIR_NAME := r19
33KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
34KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
35
Thomas Gleixnere336e052012-05-03 09:02:54 +000036head-y := arch/hexagon/kernel/head.o