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