blob: 48fe08230a8088c669822a5ebb05e705318644ae [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
13# Modules must use either long-calls, or use pic/plt.
14# Use long-calls for now, it's easier. And faster.
15# CFLAGS_MODULE += -fPIC
16# LDFLAGS_MODULE += -shared
17CFLAGS_MODULE += -mlong-calls
18
Richard Kuo66b03db2012-03-27 17:37:33 -050019cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
20aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
21ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
Richard Kuoe95bf452011-10-31 18:55:58 -050022
23KBUILD_CFLAGS += $(cflags-y)
24KBUILD_AFLAGS += $(aflags-y)
25
26# no KBUILD_LDFLAGS?
27LDFLAGS += $(ldflags-y)
28
29# Thread-info register will be r19. This value is not configureable;
30# it is hard-coded in several files.
31TIR_NAME := r19
32KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
33KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
34
35LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
36libs-y += $(LIBGCC)
37
Thomas Gleixnere336e052012-05-03 09:02:54 +000038head-y := arch/hexagon/kernel/head.o
Richard Kuoe95bf452011-10-31 18:55:58 -050039
40core-y += arch/hexagon/kernel/ \
41 arch/hexagon/mm/ \
42 arch/hexagon/lib/