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