Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 1 | # This file is included by the global makefile so that you can add your own |
Masahiro Yamada | 8212f89 | 2021-10-13 15:36:22 +0900 | [diff] [blame] | 2 | # architecture-specific flags and dependencies. |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 3 | # |
| 4 | # This file is subject to the terms and conditions of the GNU General Public |
| 5 | # License. See the file "COPYING" in the main directory of this archive |
| 6 | # for more details. |
| 7 | # |
| 8 | # Copyright (C) 1994 by Linus Torvalds |
| 9 | # Changes for PPC by Gary Thomas |
| 10 | # Rewritten by Cort Dougan and Paul Mackerras |
| 11 | # |
| 12 | |
Michael Ellerman | 402928b5 | 2023-12-06 22:55:48 +1100 | [diff] [blame] | 13 | ifdef cross_compiling |
| 14 | ifeq ($(CROSS_COMPILE),) |
| 15 | # Auto detect cross compiler prefix. |
| 16 | # Look for: (powerpc(64(le)?)?)(-unknown)?-linux(-gnu)?- |
| 17 | CC_ARCHES := powerpc powerpc64 powerpc64le |
| 18 | CC_SUFFIXES := linux linux-gnu unknown-linux-gnu |
| 19 | CROSS_COMPILE := $(call cc-cross-prefix, $(foreach a,$(CC_ARCHES), \ |
| 20 | $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-))) |
| 21 | endif |
| 22 | endif |
| 23 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 24 | HAS_BIARCH := $(call cc-option-yn, -m32) |
| 25 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 26 | # Set default 32 bits cross compilers for vdso and boot wrapper |
| 27 | CROSS32_COMPILE ?= |
| 28 | |
Michael Ellerman | af5cd05 | 2019-02-07 16:16:52 +1100 | [diff] [blame] | 29 | # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use |
Michael Ellerman | 22f17b0 | 2023-12-06 22:55:47 +1100 | [diff] [blame] | 30 | # ppc64le_defconfig because we have nothing better to go on. |
Michael Ellerman | af5cd05 | 2019-02-07 16:16:52 +1100 | [diff] [blame] | 31 | uname := $(shell uname -m) |
Michael Ellerman | 22f17b0 | 2023-12-06 22:55:47 +1100 | [diff] [blame] | 32 | KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64le)_defconfig |
Paul Mackerras | 8a5abdf | 2005-11-18 16:39:08 +1100 | [diff] [blame] | 33 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 34 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) |
| 35 | |
| 36 | ifeq ($(new_nm),y) |
| 37 | NM := $(NM) --synthetic |
| 38 | endif |
| 39 | |
Michael Ellerman | 68201fb | 2016-08-11 16:03:14 +1000 | [diff] [blame] | 40 | # BITS is used as extension for files which are available in a 32 bit |
| 41 | # and a 64 bit version to simplify shared Makefiles. |
| 42 | # e.g.: obj-y += foo_$(BITS).o |
| 43 | export BITS |
| 44 | |
| 45 | ifdef CONFIG_PPC64 |
| 46 | BITS := 64 |
| 47 | else |
| 48 | BITS := 32 |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 49 | endif |
| 50 | |
Michael Ellerman | 57073e2 | 2016-08-11 16:03:15 +1000 | [diff] [blame] | 51 | machine-y = ppc |
| 52 | machine-$(CONFIG_PPC64) += 64 |
| 53 | machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le |
| 54 | UTS_MACHINE := $(subst $(space),,$(machine-y)) |
Stephen Rothwell | 190554d | 2005-10-13 16:14:15 +1000 | [diff] [blame] | 55 | |
Masahiro Yamada | 54a1165 | 2023-01-19 17:22:50 +0900 | [diff] [blame] | 56 | ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) |
Michael Ellerman | b40b238 | 2017-07-26 15:00:42 +1000 | [diff] [blame] | 57 | # Have the linker provide sfpr if possible. |
| 58 | # There is a corresponding test in arch/powerpc/lib/Makefile |
| 59 | KBUILD_LDFLAGS_MODULE += --save-restore-funcs |
| 60 | else |
| 61 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
| 62 | endif |
Michael Ellerman | b40b238 | 2017-07-26 15:00:42 +1000 | [diff] [blame] | 63 | |
Rodrigo R. Galvao | badf436 | 2018-08-06 13:42:03 -0300 | [diff] [blame] | 64 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
Nicholas Piggin | 1421dc6 | 2018-05-30 22:19:21 +1000 | [diff] [blame] | 65 | KBUILD_CFLAGS += -mlittle-endian |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 66 | KBUILD_LDFLAGS += -EL |
Ian Munsie | d72b080 | 2013-09-23 12:05:11 +1000 | [diff] [blame] | 67 | LDEMULATION := lppc |
| 68 | GNUTARGET := powerpcle |
| 69 | MULTIPLEWORD := -mno-multiple |
Tony Breeds | d3d35d9 | 2014-03-12 15:12:01 +1100 | [diff] [blame] | 70 | KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) |
Ian Munsie | d72b080 | 2013-09-23 12:05:11 +1000 | [diff] [blame] | 71 | else |
Nicholas Piggin | 1421dc6 | 2018-05-30 22:19:21 +1000 | [diff] [blame] | 72 | KBUILD_CFLAGS += $(call cc-option,-mbig-endian) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 73 | KBUILD_LDFLAGS += -EB |
Ian Munsie | d72b080 | 2013-09-23 12:05:11 +1000 | [diff] [blame] | 74 | LDEMULATION := ppc |
| 75 | GNUTARGET := powerpc |
| 76 | MULTIPLEWORD := -mmultiple |
| 77 | endif |
| 78 | |
Nicholas Piggin | 4dc831a | 2016-11-27 13:46:20 +1100 | [diff] [blame] | 79 | ifdef CONFIG_PPC64 |
Nathan Chancellor | 465bfd9 | 2019-11-18 21:57:10 -0700 | [diff] [blame] | 80 | ifndef CONFIG_CC_IS_CLANG |
Christophe Leroy | 661aa88 | 2022-05-09 07:36:06 +0200 | [diff] [blame] | 81 | cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) |
| 82 | cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mcall-aixdesc) |
| 83 | aflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) |
| 84 | aflags-$(CONFIG_PPC64_ELF_ABI_V2) += -mabi=elfv2 |
Nicholas Piggin | 4dc831a | 2016-11-27 13:46:20 +1100 | [diff] [blame] | 85 | endif |
Nathan Chancellor | 465bfd9 | 2019-11-18 21:57:10 -0700 | [diff] [blame] | 86 | endif |
Nicholas Piggin | 4dc831a | 2016-11-27 13:46:20 +1100 | [diff] [blame] | 87 | |
Masahiro Yamada | 076f421 | 2018-10-30 22:26:33 +0900 | [diff] [blame] | 88 | ifndef CONFIG_CC_IS_CLANG |
Michael Ellerman | 164af59 | 2016-08-09 22:43:46 +1000 | [diff] [blame] | 89 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align |
| 90 | endif |
| 91 | |
Nicholas Piggin | 1421dc6 | 2018-05-30 22:19:21 +1000 | [diff] [blame] | 92 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) |
| 93 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian |
Michael Ellerman | 164af59 | 2016-08-09 22:43:46 +1000 | [diff] [blame] | 94 | aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) |
| 95 | aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian |
| 96 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 97 | ifeq ($(HAS_BIARCH),y) |
Nicholas Piggin | 1421dc6 | 2018-05-30 22:19:21 +1000 | [diff] [blame] | 98 | KBUILD_CFLAGS += -m$(BITS) |
Nathan Chancellor | 31f48f1 | 2023-01-11 20:05:02 -0700 | [diff] [blame] | 99 | KBUILD_AFLAGS += -m$(BITS) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 100 | KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 101 | endif |
| 102 | |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 103 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard=tls |
Christophe Leroy | 06ec27ae | 2018-09-27 07:05:55 +0000 | [diff] [blame] | 104 | ifdef CONFIG_PPC64 |
| 105 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r13 |
| 106 | else |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 107 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r2 |
Christophe Leroy | 06ec27ae | 2018-09-27 07:05:55 +0000 | [diff] [blame] | 108 | endif |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 109 | |
Suzuki Poulose | 9c5f7d3 | 2011-12-14 22:58:12 +0000 | [diff] [blame] | 110 | LDFLAGS_vmlinux-y := -Bstatic |
| 111 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie |
Fangrui Song | 0355785 | 2021-08-13 13:05:11 -0700 | [diff] [blame] | 112 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) += -z notext |
Suzuki Poulose | 9c5f7d3 | 2011-12-14 22:58:12 +0000 | [diff] [blame] | 113 | LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 114 | |
Rodrigo R. Galvao | badf436 | 2018-08-06 13:42:03 -0300 | [diff] [blame] | 115 | ifdef CONFIG_PPC64 |
Nicholas Piggin | 77e69ee | 2023-04-08 12:17:52 +1000 | [diff] [blame] | 116 | ifndef CONFIG_PPC_KERNEL_PCREL |
Anton Blanchard | 1fbe9cf | 2012-11-26 17:41:08 +0000 | [diff] [blame] | 117 | # -mcmodel=medium breaks modules because it uses 32bit offsets from |
| 118 | # the TOC pointer to create pointers where possible. Pointers into the |
| 119 | # percpu data area are created by this method. |
| 120 | # |
| 121 | # The kernel module loader relocates the percpu data section from the |
| 122 | # original location (starting with 0xd...) to somewhere in the base |
| 123 | # kernel percpu data space (starting with 0xc...). We need a full |
| 124 | # 64bit relocation for this to work, hence -mcmodel=large. |
| 125 | KBUILD_CFLAGS_MODULE += -mcmodel=large |
Anton Blanchard | 1fbe9cf | 2012-11-26 17:41:08 +0000 | [diff] [blame] | 126 | endif |
Nicholas Piggin | 77e69ee | 2023-04-08 12:17:52 +1000 | [diff] [blame] | 127 | endif |
Anton Blanchard | 1fbe9cf | 2012-11-26 17:41:08 +0000 | [diff] [blame] | 128 | |
Anton Blanchard | a50a862 | 2015-05-26 08:53:27 +1000 | [diff] [blame] | 129 | CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) |
Christophe Leroy | 661aa88 | 2022-05-09 07:36:06 +0200 | [diff] [blame] | 130 | ifdef CONFIG_PPC64_ELF_ABI_V2 |
Anton Blanchard | 238abec | 2015-05-26 08:53:29 +1000 | [diff] [blame] | 131 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) |
Anton Blanchard | 721aeaa | 2014-03-10 21:06:12 +1100 | [diff] [blame] | 132 | else |
Nathan Chancellor | 7c3bd83 | 2023-02-15 11:41:16 -0700 | [diff] [blame] | 133 | ifndef CONFIG_CC_IS_CLANG |
Nicholas Piggin | 4dc831a | 2016-11-27 13:46:20 +1100 | [diff] [blame] | 134 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) |
Anton Blanchard | 238abec | 2015-05-26 08:53:29 +1000 | [diff] [blame] | 135 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc) |
Anton Blanchard | 721aeaa | 2014-03-10 21:06:12 +1100 | [diff] [blame] | 136 | endif |
Nathan Chancellor | 465bfd9 | 2019-11-18 21:57:10 -0700 | [diff] [blame] | 137 | endif |
Naveen N Rao | c330b50 | 2024-01-10 19:42:37 +0530 | [diff] [blame] | 138 | CFLAGS-$(CONFIG_PPC64) += -mcmodel=medium |
Anton Blanchard | 98679fb | 2012-12-12 14:43:12 +0000 | [diff] [blame] | 139 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) |
Michael Ellerman | 78f0929 | 2023-04-04 20:28:47 +1000 | [diff] [blame] | 140 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mlong-double-128) |
Segher Boessenkool | 51d42f0 | 2018-02-28 17:02:49 -0800 | [diff] [blame] | 141 | |
Joel Stanley | 72e7bcc | 2018-11-12 15:58:06 +1030 | [diff] [blame] | 142 | # Clang unconditionally reserves r2 on ppc32 and does not support the flag |
Nathan Chancellor | 2947a45 | 2024-01-09 15:16:31 -0700 | [diff] [blame] | 143 | # https://llvm.org/pr39555 |
Joel Stanley | 72e7bcc | 2018-11-12 15:58:06 +1030 | [diff] [blame] | 144 | CFLAGS-$(CONFIG_PPC32) := $(call cc-option, -ffixed-r2) |
| 145 | |
| 146 | # Clang doesn't support -mmultiple / -mno-multiple |
Nathan Chancellor | 2947a45 | 2024-01-09 15:16:31 -0700 | [diff] [blame] | 147 | # https://llvm.org/pr39556 |
Joel Stanley | 72e7bcc | 2018-11-12 15:58:06 +1030 | [diff] [blame] | 148 | CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD)) |
| 149 | |
Segher Boessenkool | 51d42f0 | 2018-02-28 17:02:49 -0800 | [diff] [blame] | 150 | CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) |
Anton Blanchard | d23c6fb | 2012-04-17 18:45:28 +0000 | [diff] [blame] | 151 | |
Samuel Holland | 01db473 | 2024-03-29 00:18:23 -0700 | [diff] [blame] | 152 | CC_FLAGS_FPU := $(call cc-option,-mhard-float) |
| 153 | CC_FLAGS_NO_FPU := $(call cc-option,-msoft-float) |
| 154 | |
Nicholas Piggin | 2a056f5 | 2018-09-14 15:08:53 +1000 | [diff] [blame] | 155 | ifdef CONFIG_FUNCTION_TRACER |
Naveen N Rao | 0f71dcf | 2023-06-19 15:17:34 +0530 | [diff] [blame] | 156 | ifdef CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY |
| 157 | KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY |
| 158 | CC_FLAGS_FTRACE := -fpatchable-function-entry=2 |
| 159 | else |
Nicholas Piggin | 2a056f5 | 2018-09-14 15:08:53 +1000 | [diff] [blame] | 160 | CC_FLAGS_FTRACE := -pg |
Torsten Duwe | 8c50b72 | 2016-03-03 15:27:00 +1100 | [diff] [blame] | 161 | ifdef CONFIG_MPROFILE_KERNEL |
Nicholas Piggin | 2a056f5 | 2018-09-14 15:08:53 +1000 | [diff] [blame] | 162 | CC_FLAGS_FTRACE += -mprofile-kernel |
| 163 | endif |
Torsten Duwe | 8c50b72 | 2016-03-03 15:27:00 +1100 | [diff] [blame] | 164 | endif |
Naveen N Rao | 0f71dcf | 2023-06-19 15:17:34 +0530 | [diff] [blame] | 165 | endif |
Torsten Duwe | 8c50b72 | 2016-03-03 15:27:00 +1100 | [diff] [blame] | 166 | |
Christophe Leroy | 45f7091 | 2023-01-25 08:38:59 +0100 | [diff] [blame] | 167 | CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU) |
| 168 | AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU) |
Anton Blanchard | d23c6fb | 2012-04-17 18:45:28 +0000 | [diff] [blame] | 169 | |
Michael Ellerman | 5083272 | 2023-03-30 10:43:08 +1100 | [diff] [blame] | 170 | CFLAGS-y += $(CONFIG_TUNE_CPU) |
Scott Wood | 01718ba | 2013-08-20 19:55:36 -0500 | [diff] [blame] | 171 | |
Guenter Roeck | 7998eb3 | 2014-05-15 09:33:42 -0700 | [diff] [blame] | 172 | asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) |
| 173 | |
Michael Ellerman | dc42087 | 2023-12-06 22:55:45 +1100 | [diff] [blame] | 174 | KBUILD_CPPFLAGS += -I $(srctree)/arch/powerpc $(asinstr) |
Masahiro Yamada | b00899b | 2019-01-11 12:22:32 +0900 | [diff] [blame] | 175 | KBUILD_AFLAGS += $(AFLAGS-y) |
Samuel Holland | 01db473 | 2024-03-29 00:18:23 -0700 | [diff] [blame] | 176 | KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU) |
Nicholas Piggin | f5df87b | 2023-06-06 16:48:30 +1000 | [diff] [blame] | 177 | KBUILD_CFLAGS += $(CFLAGS-y) |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 178 | CPP = $(CC) -E $(KBUILD_CFLAGS) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 179 | |
Michael Ellerman | 68201fb | 2016-08-11 16:03:14 +1000 | [diff] [blame] | 180 | CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__ |
Daniel Axtens | 62c2c5c | 2016-07-12 10:54:51 +1000 | [diff] [blame] | 181 | ifdef CONFIG_CPU_BIG_ENDIAN |
| 182 | CHECKFLAGS += -D__BIG_ENDIAN__ |
| 183 | else |
Christophe Leroy | 5b89492 | 2022-05-09 07:36:08 +0200 | [diff] [blame] | 184 | CHECKFLAGS += -D__LITTLE_ENDIAN__ |
Daniel Axtens | 62c2c5c | 2016-07-12 10:54:51 +1000 | [diff] [blame] | 185 | endif |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 186 | |
Rodrigo R. Galvao | badf436 | 2018-08-06 13:42:03 -0300 | [diff] [blame] | 187 | ifdef CONFIG_476FPE_ERR46 |
Alistair Popple | d5b35cf | 2014-02-24 18:00:56 +1100 | [diff] [blame] | 188 | KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ |
| 189 | -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds |
| 190 | endif |
| 191 | |
Nicholas Piggin | 4b2a931 | 2022-09-23 13:30:04 +1000 | [diff] [blame] | 192 | # No prefix or pcrel |
Nicholas Piggin | dc5dac7 | 2023-04-08 12:17:49 +1000 | [diff] [blame] | 193 | ifdef CONFIG_PPC_KERNEL_PREFIXED |
| 194 | KBUILD_CFLAGS += $(call cc-option,-mprefixed) |
| 195 | else |
Nicholas Piggin | 4b2a931 | 2022-09-23 13:30:04 +1000 | [diff] [blame] | 196 | KBUILD_CFLAGS += $(call cc-option,-mno-prefixed) |
Nicholas Piggin | dc5dac7 | 2023-04-08 12:17:49 +1000 | [diff] [blame] | 197 | endif |
Nicholas Piggin | 7e3a68b | 2023-04-08 12:17:51 +1000 | [diff] [blame] | 198 | ifdef CONFIG_PPC_KERNEL_PCREL |
| 199 | KBUILD_CFLAGS += $(call cc-option,-mpcrel) |
| 200 | else |
Nicholas Piggin | 4b2a931 | 2022-09-23 13:30:04 +1000 | [diff] [blame] | 201 | KBUILD_CFLAGS += $(call cc-option,-mno-pcrel) |
Nicholas Piggin | 7e3a68b | 2023-04-08 12:17:51 +1000 | [diff] [blame] | 202 | endif |
Nicholas Piggin | 4b2a931 | 2022-09-23 13:30:04 +1000 | [diff] [blame] | 203 | |
| 204 | # No AltiVec or VSX or MMA instructions when building kernel |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 205 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
Anton Blanchard | d23c6fb | 2012-04-17 18:45:28 +0000 | [diff] [blame] | 206 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) |
Nicholas Piggin | 4b2a931 | 2022-09-23 13:30:04 +1000 | [diff] [blame] | 207 | KBUILD_CFLAGS += $(call cc-option,-mno-mma) |
Paul Mackerras | d3f67fb | 2005-10-29 15:31:17 +1000 | [diff] [blame] | 208 | |
Kumar Gala | 0197cd2 | 2007-10-18 16:53:19 -0500 | [diff] [blame] | 209 | # No SPE instruction when building kernel |
Thiemo Seufer | ce400c0 | 2008-09-02 00:23:02 +1000 | [diff] [blame] | 210 | # (We use all available options to help semi-broken compilers) |
Kumar Gala | 0197cd2 | 2007-10-18 16:53:19 -0500 | [diff] [blame] | 211 | KBUILD_CFLAGS += $(call cc-option,-mno-spe) |
Thiemo Seufer | ce400c0 | 2008-09-02 00:23:02 +1000 | [diff] [blame] | 212 | KBUILD_CFLAGS += $(call cc-option,-mspe=no) |
Kumar Gala | 0197cd2 | 2007-10-18 16:53:19 -0500 | [diff] [blame] | 213 | |
Naveen N. Rao | ba96301 | 2020-03-05 20:05:30 +0530 | [diff] [blame] | 214 | # Don't emit .eh_frame since we have no use for it |
| 215 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables |
| 216 | |
Benjamin Herrenschmidt | 57647a4 | 2007-03-22 17:23:44 +1100 | [diff] [blame] | 217 | # Never use string load/store instructions as they are |
| 218 | # often slow when they are implemented at all |
Anton Blanchard | a50a862 | 2015-05-26 08:53:27 +1000 | [diff] [blame] | 219 | KBUILD_CFLAGS += $(call cc-option,-mno-string) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 220 | |
Michael Ellerman | 164af59 | 2016-08-09 22:43:46 +1000 | [diff] [blame] | 221 | KBUILD_AFLAGS += $(aflags-y) |
| 222 | KBUILD_CFLAGS += $(cflags-y) |
| 223 | |
Tom Rini | 135f0b1 | 2006-01-12 16:55:58 -0700 | [diff] [blame] | 224 | # Default to zImage, override when needed |
Grant Likely | 25431333 | 2008-02-07 05:18:34 +1100 | [diff] [blame] | 225 | all: zImage |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 226 | |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 227 | # With make 3.82 we cannot mix normal and wildcard targets |
Anatolij Gustschin | c686ecf | 2010-08-15 22:26:56 +0000 | [diff] [blame] | 228 | BOOT_TARGETS1 := zImage zImage.initrd uImage |
Benjamin Herrenschmidt | 11eab297 | 2011-12-01 19:35:08 +0000 | [diff] [blame] | 229 | BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% |
Stephen Rothwell | cabb5587 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 230 | |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 231 | PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) |
Stephen Rothwell | cabb5587 | 2005-09-30 16:16:52 +1000 | [diff] [blame] | 232 | |
Michael Ellerman | dc42087 | 2023-12-06 22:55:45 +1100 | [diff] [blame] | 233 | boot := arch/powerpc/boot |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 234 | |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 235 | $(BOOT_TARGETS1): vmlinux |
Michael Ellerman | 1196d7a | 2016-11-21 21:14:33 +1100 | [diff] [blame] | 236 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 237 | $(BOOT_TARGETS2): vmlinux |
Michael Ellerman | 1196d7a | 2016-11-21 21:14:33 +1100 | [diff] [blame] | 238 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 239 | |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 240 | |
Michael Ellerman | d42c6d0 | 2020-02-19 11:04:34 +1100 | [diff] [blame] | 241 | PHONY += bootwrapper_install |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 242 | bootwrapper_install: |
Michael Ellerman | 1196d7a | 2016-11-21 21:14:33 +1100 | [diff] [blame] | 243 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
Sam Ravnborg | e32e78c | 2010-08-02 20:47:48 +0000 | [diff] [blame] | 244 | |
Nicolas Saenz Julienne | a400c28 | 2023-01-24 12:02:12 +0100 | [diff] [blame] | 245 | include $(srctree)/scripts/Makefile.defconf |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 246 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 247 | generated_configs += ppc64le_defconfig |
Michael Ellerman | 2adc48a | 2015-09-23 15:40:35 +1000 | [diff] [blame] | 248 | ppc64le_defconfig: |
| 249 | $(call merge_into_defconfig,ppc64_defconfig,le) |
| 250 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 251 | generated_configs += ppc64le_guest_defconfig |
Satheesh Rajendran | 721c01b | 2018-11-15 12:19:50 +0530 | [diff] [blame] | 252 | ppc64le_guest_defconfig: |
Michael Ellerman | bac9496 | 2023-04-14 23:24:13 +1000 | [diff] [blame] | 253 | $(call merge_into_defconfig,ppc64_defconfig,le guest kvm_guest) |
Satheesh Rajendran | 721c01b | 2018-11-15 12:19:50 +0530 | [diff] [blame] | 254 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 255 | generated_configs += ppc64_guest_defconfig |
Satheesh Rajendran | 721c01b | 2018-11-15 12:19:50 +0530 | [diff] [blame] | 256 | ppc64_guest_defconfig: |
Michael Ellerman | bac9496 | 2023-04-14 23:24:13 +1000 | [diff] [blame] | 257 | $(call merge_into_defconfig,ppc64_defconfig,be guest kvm_guest) |
Satheesh Rajendran | 721c01b | 2018-11-15 12:19:50 +0530 | [diff] [blame] | 258 | |
Michael Ellerman | 596ddea | 2023-04-14 23:24:14 +1000 | [diff] [blame] | 259 | generated_configs += pseries_le_defconfig |
| 260 | pseries_le_defconfig: ppc64le_guest_defconfig |
| 261 | |
Michael Ellerman | 9ecda93 | 2023-04-14 23:24:15 +1000 | [diff] [blame] | 262 | generated_configs += pseries_defconfig |
| 263 | pseries_defconfig: ppc64le_guest_defconfig |
| 264 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 265 | generated_configs += powernv_be_defconfig |
Michael Ellerman | 3603c52 | 2017-07-24 22:50:45 +1000 | [diff] [blame] | 266 | powernv_be_defconfig: |
| 267 | $(call merge_into_defconfig,powernv_defconfig,be) |
| 268 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 269 | generated_configs += mpc85xx_defconfig |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 270 | mpc85xx_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 271 | $(call merge_into_defconfig,mpc85xx_base.config,\ |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 272 | 85xx-32bit 85xx-hw fsl-emb-nonhw) |
| 273 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 274 | generated_configs += mpc85xx_smp_defconfig |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 275 | mpc85xx_smp_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 276 | $(call merge_into_defconfig,mpc85xx_base.config,\ |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 277 | 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw) |
| 278 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 279 | generated_configs += corenet32_smp_defconfig |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 280 | corenet32_smp_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 281 | $(call merge_into_defconfig,corenet_base.config,\ |
Claudiu Manoil | e0b80f0 | 2016-09-22 18:04:12 +0300 | [diff] [blame] | 282 | 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw dpaa) |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 283 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 284 | generated_configs += corenet64_smp_defconfig |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 285 | corenet64_smp_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 286 | $(call merge_into_defconfig,corenet_base.config,\ |
Claudiu Manoil | e0b80f0 | 2016-09-22 18:04:12 +0300 | [diff] [blame] | 287 | 85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw dpaa) |
Scott Wood | 44d5401 | 2015-07-29 18:14:04 -0500 | [diff] [blame] | 288 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 289 | generated_configs += mpc86xx_defconfig |
Alessio Igor Bogani | 43de32c | 2016-02-22 10:26:14 +0100 | [diff] [blame] | 290 | mpc86xx_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 291 | $(call merge_into_defconfig,mpc86xx_base.config,\ |
Alessio Igor Bogani | 43de32c | 2016-02-22 10:26:14 +0100 | [diff] [blame] | 292 | 86xx-hw fsl-emb-nonhw) |
| 293 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 294 | generated_configs += mpc86xx_smp_defconfig |
Alessio Igor Bogani | 43de32c | 2016-02-22 10:26:14 +0100 | [diff] [blame] | 295 | mpc86xx_smp_defconfig: |
Michael Ellerman | 58b12eb | 2019-05-28 18:16:14 +1000 | [diff] [blame] | 296 | $(call merge_into_defconfig,mpc86xx_base.config,\ |
Alessio Igor Bogani | 43de32c | 2016-02-22 10:26:14 +0100 | [diff] [blame] | 297 | 86xx-smp 86xx-hw fsl-emb-nonhw) |
| 298 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 299 | generated_configs += ppc32_allmodconfig |
Michael Ellerman | 8db0c9d | 2018-07-10 00:24:25 +1000 | [diff] [blame] | 300 | ppc32_allmodconfig: |
| 301 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \ |
| 302 | -f $(srctree)/Makefile allmodconfig |
| 303 | |
Michael Ellerman | af1ebca | 2024-02-29 22:41:08 +1100 | [diff] [blame] | 304 | generated_configs += ppc40x_allmodconfig |
| 305 | ppc40x_allmodconfig: |
| 306 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/40x.config \ |
| 307 | -f $(srctree)/Makefile allmodconfig |
| 308 | |
| 309 | generated_configs += ppc44x_allmodconfig |
| 310 | ppc44x_allmodconfig: |
| 311 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/44x.config \ |
| 312 | -f $(srctree)/Makefile allmodconfig |
| 313 | |
| 314 | generated_configs += ppc8xx_allmodconfig |
| 315 | ppc8xx_allmodconfig: |
| 316 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/8xx.config \ |
| 317 | -f $(srctree)/Makefile allmodconfig |
| 318 | |
| 319 | generated_configs += ppc85xx_allmodconfig |
| 320 | ppc85xx_allmodconfig: |
| 321 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-32bit.config \ |
| 322 | -f $(srctree)/Makefile allmodconfig |
| 323 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 324 | generated_configs += ppc_defconfig |
Michael Ellerman | a273fa3 | 2019-02-07 16:16:51 +1100 | [diff] [blame] | 325 | ppc_defconfig: |
| 326 | $(call merge_into_defconfig,book3s_32.config,) |
| 327 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 328 | generated_configs += ppc64le_allmodconfig |
Michael Ellerman | 64de5d8 | 2018-07-10 00:24:26 +1000 | [diff] [blame] | 329 | ppc64le_allmodconfig: |
| 330 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \ |
| 331 | -f $(srctree)/Makefile allmodconfig |
| 332 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 333 | generated_configs += ppc64le_allnoconfig |
Michael Ellerman | 5d823447 | 2020-11-25 14:15:51 +1100 | [diff] [blame] | 334 | ppc64le_allnoconfig: |
| 335 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/ppc64le.config \ |
| 336 | -f $(srctree)/Makefile allnoconfig |
| 337 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 338 | generated_configs += ppc64_book3e_allmodconfig |
Michael Ellerman | 64de5d8 | 2018-07-10 00:24:26 +1000 | [diff] [blame] | 339 | ppc64_book3e_allmodconfig: |
| 340 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-64bit.config \ |
| 341 | -f $(srctree)/Makefile allmodconfig |
| 342 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 343 | generated_configs += ppc32_randconfig |
Michael Ellerman | f259fb8 | 2021-04-28 23:27:00 +1000 | [diff] [blame] | 344 | ppc32_randconfig: |
| 345 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/32-bit.config \ |
| 346 | -f $(srctree)/Makefile randconfig |
| 347 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 348 | generated_configs += ppc64_randconfig |
Michael Ellerman | f259fb8 | 2021-04-28 23:27:00 +1000 | [diff] [blame] | 349 | ppc64_randconfig: |
| 350 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/64-bit.config \ |
| 351 | -f $(srctree)/Makefile randconfig |
| 352 | |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 353 | PHONY += $(generated_configs) |
| 354 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 355 | define archhelp |
Michael Ellerman | 228c7a9 | 2023-03-29 18:23:33 +1100 | [diff] [blame] | 356 | echo '* zImage - Build default images selected by kernel config' |
Michael Ellerman | dc42087 | 2023-12-06 22:55:45 +1100 | [diff] [blame] | 357 | echo ' zImage.* - Compressed kernel image (arch/powerpc/boot/zImage.*)' |
Michael Ellerman | 228c7a9 | 2023-03-29 18:23:33 +1100 | [diff] [blame] | 358 | echo ' uImage - U-Boot native image format' |
| 359 | echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' |
| 360 | echo ' versions which do not support device trees' |
| 361 | echo ' dtbImage.<dt> - zImage with an embedded device tree blob' |
| 362 | echo ' simpleImage.<dt> - Firmware independent image.' |
| 363 | echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' |
| 364 | echo ' install - Install kernel using' |
| 365 | echo ' (your) ~/bin/$(INSTALLKERNEL) or' |
| 366 | echo ' (distribution) /sbin/$(INSTALLKERNEL) or' |
| 367 | echo ' install to $$(INSTALL_PATH) and run lilo' |
Michael Ellerman | dc42087 | 2023-12-06 22:55:45 +1100 | [diff] [blame] | 368 | echo ' *_defconfig - Select default config from arch/powerpc/configs' |
Michael Ellerman | 228c7a9 | 2023-03-29 18:23:33 +1100 | [diff] [blame] | 369 | echo '' |
| 370 | echo ' Targets with <dt> embed a device tree blob inside the image' |
| 371 | echo ' These targets support board with firmware that does not' |
| 372 | echo ' support passing a device tree directly. Replace <dt> with the' |
Michael Ellerman | dc42087 | 2023-12-06 22:55:45 +1100 | [diff] [blame] | 373 | echo ' name of a dts file from the arch/powerpc/boot/dts/ directory' |
Michael Ellerman | 228c7a9 | 2023-03-29 18:23:33 +1100 | [diff] [blame] | 374 | echo ' (minus the .dts extension).' |
Michael Ellerman | 22db99d | 2023-03-29 18:23:34 +1100 | [diff] [blame] | 375 | echo |
| 376 | $(foreach cfg,$(generated_configs), |
| 377 | printf " %-27s - Build for %s\\n" $(cfg) $(subst _defconfig,,$(cfg));) |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 378 | endef |
| 379 | |
Michael Ellerman | d42c6d0 | 2020-02-19 11:04:34 +1100 | [diff] [blame] | 380 | PHONY += install |
Sam Ravnborg | 3f85d63 | 2008-02-16 12:36:10 +0100 | [diff] [blame] | 381 | install: |
Masahiro Yamada | f774f5b | 2022-05-03 11:47:16 +0900 | [diff] [blame] | 382 | $(call cmd,install) |
Akinobu Mita | 928370c | 2007-04-10 21:05:31 +1000 | [diff] [blame] | 383 | |
Christophe Leroy | 91bf695 | 2020-09-27 09:16:33 +0000 | [diff] [blame] | 384 | ifeq ($(KBUILD_EXTMOD),) |
| 385 | # We need to generate vdso-offsets.h before compiling certain files in kernel/. |
| 386 | # In order to do that, we should use the archprepare target, but we can't since |
| 387 | # asm-offsets.h is included in some files used to generate vdso-offsets.h, and |
| 388 | # asm-offsets.h is built in prepare0, for which archprepare is a dependency. |
| 389 | # Therefore we need to generate the header after prepare0 has been made, hence |
| 390 | # this hack. |
| 391 | prepare: vdso_prepare |
| 392 | vdso_prepare: prepare0 |
| 393 | $(if $(CONFIG_VDSO32),$(Q)$(MAKE) \ |
Christophe Leroy | fd1feade | 2022-01-21 16:30:27 +0000 | [diff] [blame] | 394 | $(build)=arch/powerpc/kernel/vdso include/generated/vdso32-offsets.h) |
Christophe Leroy | 91bf695 | 2020-09-27 09:16:33 +0000 | [diff] [blame] | 395 | $(if $(CONFIG_PPC64),$(Q)$(MAKE) \ |
Christophe Leroy | fd1feade | 2022-01-21 16:30:27 +0000 | [diff] [blame] | 396 | $(build)=arch/powerpc/kernel/vdso include/generated/vdso64-offsets.h) |
Christophe Leroy | 91bf695 | 2020-09-27 09:16:33 +0000 | [diff] [blame] | 397 | endif |
| 398 | |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 399 | archprepare: checkbin |
| 400 | |
Firoz Khan | ab66dcc | 2018-12-17 16:10:36 +0530 | [diff] [blame] | 401 | archheaders: |
| 402 | $(Q)$(MAKE) $(build)=arch/powerpc/kernel/syscalls all |
| 403 | |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 404 | ifdef CONFIG_STACKPROTECTOR |
| 405 | prepare: stack_protector_prepare |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 406 | |
Michael Ellerman | d42c6d0 | 2020-02-19 11:04:34 +1100 | [diff] [blame] | 407 | PHONY += stack_protector_prepare |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 408 | stack_protector_prepare: prepare0 |
Christophe Leroy | 06ec27ae | 2018-09-27 07:05:55 +0000 | [diff] [blame] | 409 | ifdef CONFIG_PPC64 |
| 410 | $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h)) |
| 411 | else |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 412 | $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "TASK_CANARY") print $$3;}' include/generated/asm-offsets.h)) |
| 413 | endif |
Christophe Leroy | 06ec27ae | 2018-09-27 07:05:55 +0000 | [diff] [blame] | 414 | endif |
Christophe Leroy | c3ff2a5 | 2018-09-27 07:05:53 +0000 | [diff] [blame] | 415 | |
Michael Ellerman | d42c6d0 | 2020-02-19 11:04:34 +1100 | [diff] [blame] | 416 | PHONY += checkbin |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 417 | checkbin: |
Naveen N Rao | 25ea739 | 2023-05-30 11:44:36 +0530 | [diff] [blame] | 418 | @if test "x${CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT}" = "xy" -a \ |
| 419 | "x${CONFIG_LD_IS_BFD}" = "xy" -a \ |
| 420 | "${CONFIG_LD_VERSION}" = "23700" ; then \ |
| 421 | echo -n '*** binutils 2.37 drops unused section symbols, which recordmcount ' ; \ |
| 422 | echo 'is unable to handle.' ; \ |
| 423 | echo '*** Please use a different binutils version.' ; \ |
| 424 | false ; \ |
| 425 | fi |