b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 1) # SPDX-License-Identifier: GPL-2.0
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 2) # Makefile for the Hexagon arch
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 3)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 4) KBUILD_DEFCONFIG = comet_defconfig
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 5)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 6) # Do not use GP-relative jumps
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 7) KBUILD_CFLAGS += -G0
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 8) LDFLAGS_vmlinux += -G0
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 9)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 10) # Do not use single-byte enums; these will overflow.
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 11) KBUILD_CFLAGS += -fno-short-enums
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 12)
788dcee0306e1 (Sid Manning 2021-04-23 15:06:58 -0500 13) # We must use long-calls:
788dcee0306e1 (Sid Manning 2021-04-23 15:06:58 -0500 14) KBUILD_CFLAGS += -mlong-calls
788dcee0306e1 (Sid Manning 2021-04-23 15:06:58 -0500 15)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 16) # Modules must use either long-calls, or use pic/plt.
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 17) # Use long-calls for now, it's easier. And faster.
3a5befc146175 (Cao jin 2017-10-09 15:11:47 +0800 18) # KBUILD_CFLAGS_MODULE += -fPIC
3a5befc146175 (Cao jin 2017-10-09 15:11:47 +0800 19) # KBUILD_LDFLAGS_MODULE += -shared
3a5befc146175 (Cao jin 2017-10-09 15:11:47 +0800 20) KBUILD_CFLAGS_MODULE += -mlong-calls
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 21)
66b03dbfe605c (Richard Kuo 2012-03-27 17:37:33 -0500 22) cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
66b03dbfe605c (Richard Kuo 2012-03-27 17:37:33 -0500 23) aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
66b03dbfe605c (Richard Kuo 2012-03-27 17:37:33 -0500 24) ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 25)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 26) KBUILD_CFLAGS += $(cflags-y)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 27) KBUILD_AFLAGS += $(aflags-y)
d503ac531a524 (Masahiro Yamada 2018-08-24 08:20:39 +0900 28) KBUILD_LDFLAGS += $(ldflags-y)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 29)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 30) # Thread-info register will be r19. This value is not configureable;
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 31) # it is hard-coded in several files.
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 32) TIR_NAME := r19
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 33) KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 34) KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
e95bf452a9e22 (Richard Kuo 2011-10-31 18:55:58 -0500 35)
e336e05bca190 (Thomas Gleixner 2012-05-03 09:02:54 +0000 36) head-y := arch/hexagon/kernel/head.o