Commit | Line | Data |
---|---|---|
14cf11af | 1 | # This file is included by the global makefile so that you can add your own |
8212f898 | 2 | # architecture-specific flags and dependencies. |
14cf11af PM |
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 | ||
14cf11af PM |
13 | HAS_BIARCH := $(call cc-option-yn, -m32) |
14 | ||
14cf11af PM |
15 | # Set default 32 bits cross compilers for vdso and boot wrapper |
16 | CROSS32_COMPILE ?= | |
17 | ||
af5cd05d ME |
18 | # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use |
19 | # ppc64_defconfig because we have nothing better to go on. | |
20 | uname := $(shell uname -m) | |
21 | KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig | |
8a5abdf8 | 22 | |
14cf11af PM |
23 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) |
24 | ||
25 | ifeq ($(new_nm),y) | |
26 | NM := $(NM) --synthetic | |
27 | endif | |
28 | ||
68201fbb ME |
29 | # BITS is used as extension for files which are available in a 32 bit |
30 | # and a 64 bit version to simplify shared Makefiles. | |
31 | # e.g.: obj-y += foo_$(BITS).o | |
32 | export BITS | |
33 | ||
34 | ifdef CONFIG_PPC64 | |
35 | BITS := 64 | |
36 | else | |
37 | BITS := 32 | |
14cf11af PM |
38 | endif |
39 | ||
57073e27 ME |
40 | machine-y = ppc |
41 | machine-$(CONFIG_PPC64) += 64 | |
42 | machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le | |
43 | UTS_MACHINE := $(subst $(space),,$(machine-y)) | |
190554db | 44 | |
b40b2386 ME |
45 | # XXX This needs to be before we override LD below |
46 | ifdef CONFIG_PPC32 | |
47 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | |
48 | else | |
052c805a | 49 | ifeq ($(call ld-ifversion, -ge, 22500, y),y) |
b40b2386 ME |
50 | # Have the linker provide sfpr if possible. |
51 | # There is a corresponding test in arch/powerpc/lib/Makefile | |
52 | KBUILD_LDFLAGS_MODULE += --save-restore-funcs | |
53 | else | |
54 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | |
55 | endif | |
56 | endif | |
57 | ||
badf436f | 58 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
1421dc6d | 59 | KBUILD_CFLAGS += -mlittle-endian |
d503ac53 | 60 | KBUILD_LDFLAGS += -EL |
d72b0801 IM |
61 | LDEMULATION := lppc |
62 | GNUTARGET := powerpcle | |
63 | MULTIPLEWORD := -mno-multiple | |
d3d35d95 | 64 | KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) |
d72b0801 | 65 | else |
1421dc6d | 66 | KBUILD_CFLAGS += $(call cc-option,-mbig-endian) |
d503ac53 | 67 | KBUILD_LDFLAGS += -EB |
d72b0801 IM |
68 | LDEMULATION := ppc |
69 | GNUTARGET := powerpc | |
70 | MULTIPLEWORD := -mmultiple | |
71 | endif | |
72 | ||
4dc831aa | 73 | ifdef CONFIG_PPC64 |
465bfd9c | 74 | ifndef CONFIG_CC_IS_CLANG |
661aa880 CL |
75 | cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) |
76 | cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mcall-aixdesc) | |
77 | aflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) | |
78 | aflags-$(CONFIG_PPC64_ELF_ABI_V2) += -mabi=elfv2 | |
4dc831aa | 79 | endif |
465bfd9c | 80 | endif |
4dc831aa | 81 | |
076f421d | 82 | ifndef CONFIG_CC_IS_CLANG |
164af597 ME |
83 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align |
84 | endif | |
85 | ||
1421dc6d NP |
86 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) |
87 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian | |
164af597 ME |
88 | aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) |
89 | aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian | |
90 | ||
14cf11af | 91 | ifeq ($(HAS_BIARCH),y) |
1421dc6d NP |
92 | KBUILD_CFLAGS += -m$(BITS) |
93 | KBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) | |
d503ac53 | 94 | KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) |
14cf11af PM |
95 | endif |
96 | ||
c3ff2a51 | 97 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard=tls |
06ec27ae CL |
98 | ifdef CONFIG_PPC64 |
99 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r13 | |
100 | else | |
c3ff2a51 | 101 | cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r2 |
06ec27ae | 102 | endif |
c3ff2a51 | 103 | |
9c5f7d39 SP |
104 | LDFLAGS_vmlinux-y := -Bstatic |
105 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie | |
03557853 | 106 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) += -z notext |
9c5f7d39 | 107 | LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) |
14cf11af | 108 | |
badf436f | 109 | ifdef CONFIG_PPC64 |
1fbe9cf2 AB |
110 | ifeq ($(call cc-option-yn,-mcmodel=medium),y) |
111 | # -mcmodel=medium breaks modules because it uses 32bit offsets from | |
112 | # the TOC pointer to create pointers where possible. Pointers into the | |
113 | # percpu data area are created by this method. | |
114 | # | |
115 | # The kernel module loader relocates the percpu data section from the | |
116 | # original location (starting with 0xd...) to somewhere in the base | |
117 | # kernel percpu data space (starting with 0xc...). We need a full | |
118 | # 64bit relocation for this to work, hence -mcmodel=large. | |
119 | KBUILD_CFLAGS_MODULE += -mcmodel=large | |
120 | else | |
121 | export NO_MINIMAL_TOC := -mno-minimal-toc | |
122 | endif | |
123 | endif | |
124 | ||
a50a862e | 125 | CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) |
465bfd9c | 126 | ifndef CONFIG_CC_IS_CLANG |
661aa880 | 127 | ifdef CONFIG_PPC64_ELF_ABI_V2 |
238abecd | 128 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) |
721aeaa9 AB |
129 | AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) |
130 | else | |
4dc831aa | 131 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) |
238abecd | 132 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc) |
4dc831aa | 133 | AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) |
721aeaa9 | 134 | endif |
465bfd9c | 135 | endif |
238abecd | 136 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc)) |
98679fb0 | 137 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) |
51d42f0f | 138 | |
72e7bcc2 JS |
139 | # Clang unconditionally reserves r2 on ppc32 and does not support the flag |
140 | # https://bugs.llvm.org/show_bug.cgi?id=39555 | |
141 | CFLAGS-$(CONFIG_PPC32) := $(call cc-option, -ffixed-r2) | |
142 | ||
143 | # Clang doesn't support -mmultiple / -mno-multiple | |
144 | # https://bugs.llvm.org/show_bug.cgi?id=39556 | |
145 | CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD)) | |
146 | ||
51d42f0f | 147 | CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) |
d23c6fb4 | 148 | |
badf436f RG |
149 | ifdef CONFIG_PPC_BOOK3S_64 |
150 | ifdef CONFIG_CPU_LITTLE_ENDIAN | |
a73657ea | 151 | CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 |
a73657ea | 152 | else |
58ec7f06 | 153 | CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4 |
a73657ea | 154 | endif |
7fd123e5 NP |
155 | CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power10, \ |
156 | $(call cc-option,-mtune=power9, \ | |
157 | $(call cc-option,-mtune=power8))) | |
2863dd2d | 158 | else ifdef CONFIG_PPC_BOOK3E_64 |
01718ba6 SW |
159 | CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 |
160 | endif | |
161 | ||
2a056f58 NP |
162 | ifdef CONFIG_FUNCTION_TRACER |
163 | CC_FLAGS_FTRACE := -pg | |
8c50b72a | 164 | ifdef CONFIG_MPROFILE_KERNEL |
2a056f58 NP |
165 | CC_FLAGS_FTRACE += -mprofile-kernel |
166 | endif | |
8c50b72a TD |
167 | endif |
168 | ||
cc62d20c | 169 | CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) |
446cda1b | 170 | AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) |
d23c6fb4 | 171 | |
d6b551b8 | 172 | CFLAGS-$(CONFIG_E5500_CPU) += $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) |
01718ba6 SW |
173 | CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) |
174 | ||
7998eb3d GR |
175 | asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) |
176 | ||
9cc342f6 | 177 | KBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr) |
b00899b8 | 178 | KBUILD_AFLAGS += $(AFLAGS-y) |
a50a862e | 179 | KBUILD_CFLAGS += $(call cc-option,-msoft-float) |
b00899b8 | 180 | KBUILD_CFLAGS += -pipe $(CFLAGS-y) |
a0f97e06 | 181 | CPP = $(CC) -E $(KBUILD_CFLAGS) |
14cf11af | 182 | |
68201fbb | 183 | CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__ |
62c2c5cf DA |
184 | ifdef CONFIG_CPU_BIG_ENDIAN |
185 | CHECKFLAGS += -D__BIG_ENDIAN__ | |
186 | else | |
5b89492c | 187 | CHECKFLAGS += -D__LITTLE_ENDIAN__ |
62c2c5cf | 188 | endif |
14cf11af | 189 | |
badf436f | 190 | ifdef CONFIG_476FPE_ERR46 |
d5b35cff AP |
191 | KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ |
192 | -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds | |
193 | endif | |
194 | ||
4b2a9315 NP |
195 | # No prefix or pcrel |
196 | KBUILD_CFLAGS += $(call cc-option,-mno-prefixed) | |
197 | KBUILD_CFLAGS += $(call cc-option,-mno-pcrel) | |
198 | ||
199 | # No AltiVec or VSX or MMA instructions when building kernel | |
a0f97e06 | 200 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
d23c6fb4 | 201 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) |
4b2a9315 | 202 | KBUILD_CFLAGS += $(call cc-option,-mno-mma) |
d3f67fbb | 203 | |
0197cd2e | 204 | # No SPE instruction when building kernel |
ce400c01 | 205 | # (We use all available options to help semi-broken compilers) |
0197cd2e | 206 | KBUILD_CFLAGS += $(call cc-option,-mno-spe) |
ce400c01 | 207 | KBUILD_CFLAGS += $(call cc-option,-mspe=no) |
0197cd2e | 208 | |
ba96301c NR |
209 | # Don't emit .eh_frame since we have no use for it |
210 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | |
211 | ||
57647a4d BH |
212 | # Never use string load/store instructions as they are |
213 | # often slow when they are implemented at all | |
a50a862e | 214 | KBUILD_CFLAGS += $(call cc-option,-mno-string) |
14cf11af | 215 | |
548ad77d IK |
216 | cpu-as-$(CONFIG_40x) += -Wa,-m405 |
217 | cpu-as-$(CONFIG_44x) += -Wa,-m440 | |
9ddf0075 | 218 | cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) |
688de017 | 219 | cpu-as-$(CONFIG_PPC_E500) += -Wa,-me500 |
960e3002 JS |
220 | |
221 | # When using '-many -mpower4' gas will first try and find a matching power4 | |
222 | # mnemonic and failing that it will allow any valid mnemonic that GAS knows | |
223 | # about. GCC will pass -many to GAS when assembling, clang does not. | |
f5140cab DA |
224 | # LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675 |
225 | # but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway... | |
226 | cpu-as-$(CONFIG_PPC_BOOK3S_64) += $(call as-option,-Wa$(comma)-mpower4) $(call as-option,-Wa$(comma)-many) | |
69a84059 | 227 | cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) |
14cf11af | 228 | |
222d394d | 229 | KBUILD_AFLAGS += $(cpu-as-y) |
a0f97e06 | 230 | KBUILD_CFLAGS += $(cpu-as-y) |
14cf11af | 231 | |
164af597 ME |
232 | KBUILD_AFLAGS += $(aflags-y) |
233 | KBUILD_CFLAGS += $(cflags-y) | |
234 | ||
135f0b17 | 235 | # Default to zImage, override when needed |
25431333 | 236 | all: zImage |
14cf11af | 237 | |
e32e78c5 | 238 | # With make 3.82 we cannot mix normal and wildcard targets |
c686ecf5 | 239 | BOOT_TARGETS1 := zImage zImage.initrd uImage |
11eab297 | 240 | BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% |
cabb5587 | 241 | |
e32e78c5 | 242 | PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) |
cabb5587 | 243 | |
94b212c2 | 244 | boot := arch/$(ARCH)/boot |
14cf11af | 245 | |
e32e78c5 | 246 | $(BOOT_TARGETS1): vmlinux |
1196d7aa | 247 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
e32e78c5 | 248 | $(BOOT_TARGETS2): vmlinux |
1196d7aa | 249 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
e32e78c5 SR |
250 | |
251 | ||
d42c6d0f | 252 | PHONY += bootwrapper_install |
e32e78c5 | 253 | bootwrapper_install: |
1196d7aa | 254 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
773f76b1 | 255 | |
ea4d1a87 CB |
256 | # Used to create 'merged defconfigs' |
257 | # To use it $(call) it with the first argument as the base defconfig | |
258 | # and the second argument as a space separated list of .config files to merge, | |
259 | # without the .config suffix. | |
260 | define merge_into_defconfig | |
261 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \ | |
262 | -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \ | |
263 | $(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config) | |
264 | +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig | |
265 | endef | |
266 | ||
267 | PHONY += pseries_le_defconfig | |
268 | pseries_le_defconfig: | |
269 | $(call merge_into_defconfig,pseries_defconfig,le) | |
270 | ||
2adc48a6 ME |
271 | PHONY += ppc64le_defconfig |
272 | ppc64le_defconfig: | |
273 | $(call merge_into_defconfig,ppc64_defconfig,le) | |
274 | ||
721c01ba SR |
275 | PHONY += ppc64le_guest_defconfig |
276 | ppc64le_guest_defconfig: | |
277 | $(call merge_into_defconfig,ppc64_defconfig,le guest) | |
278 | ||
279 | PHONY += ppc64_guest_defconfig | |
280 | ppc64_guest_defconfig: | |
281 | $(call merge_into_defconfig,ppc64_defconfig,be guest) | |
282 | ||
3603c52f ME |
283 | PHONY += powernv_be_defconfig |
284 | powernv_be_defconfig: | |
285 | $(call merge_into_defconfig,powernv_defconfig,be) | |
286 | ||
44d54014 SW |
287 | PHONY += mpc85xx_defconfig |
288 | mpc85xx_defconfig: | |
58b12eb2 | 289 | $(call merge_into_defconfig,mpc85xx_base.config,\ |
44d54014 SW |
290 | 85xx-32bit 85xx-hw fsl-emb-nonhw) |
291 | ||
292 | PHONY += mpc85xx_smp_defconfig | |
293 | mpc85xx_smp_defconfig: | |
58b12eb2 | 294 | $(call merge_into_defconfig,mpc85xx_base.config,\ |
44d54014 SW |
295 | 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw) |
296 | ||
297 | PHONY += corenet32_smp_defconfig | |
298 | corenet32_smp_defconfig: | |
58b12eb2 | 299 | $(call merge_into_defconfig,corenet_base.config,\ |
e0b80f00 | 300 | 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw dpaa) |
44d54014 SW |
301 | |
302 | PHONY += corenet64_smp_defconfig | |
303 | corenet64_smp_defconfig: | |
58b12eb2 | 304 | $(call merge_into_defconfig,corenet_base.config,\ |
e0b80f00 | 305 | 85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw dpaa) |
44d54014 | 306 | |
43de32c5 AIB |
307 | PHONY += mpc86xx_defconfig |
308 | mpc86xx_defconfig: | |
58b12eb2 | 309 | $(call merge_into_defconfig,mpc86xx_base.config,\ |
43de32c5 AIB |
310 | 86xx-hw fsl-emb-nonhw) |
311 | ||
312 | PHONY += mpc86xx_smp_defconfig | |
313 | mpc86xx_smp_defconfig: | |
58b12eb2 | 314 | $(call merge_into_defconfig,mpc86xx_base.config,\ |
43de32c5 AIB |
315 | 86xx-smp 86xx-hw fsl-emb-nonhw) |
316 | ||
8db0c9d4 ME |
317 | PHONY += ppc32_allmodconfig |
318 | ppc32_allmodconfig: | |
319 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \ | |
320 | -f $(srctree)/Makefile allmodconfig | |
321 | ||
a273fa38 ME |
322 | PHONY += ppc_defconfig |
323 | ppc_defconfig: | |
324 | $(call merge_into_defconfig,book3s_32.config,) | |
325 | ||
64de5d8d ME |
326 | PHONY += ppc64le_allmodconfig |
327 | ppc64le_allmodconfig: | |
328 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \ | |
329 | -f $(srctree)/Makefile allmodconfig | |
330 | ||
5d823447 ME |
331 | PHONY += ppc64le_allnoconfig |
332 | ppc64le_allnoconfig: | |
333 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/ppc64le.config \ | |
334 | -f $(srctree)/Makefile allnoconfig | |
335 | ||
64de5d8d ME |
336 | PHONY += ppc64_book3e_allmodconfig |
337 | ppc64_book3e_allmodconfig: | |
338 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-64bit.config \ | |
339 | -f $(srctree)/Makefile allmodconfig | |
340 | ||
f259fb89 ME |
341 | PHONY += ppc32_randconfig |
342 | ppc32_randconfig: | |
343 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/32-bit.config \ | |
344 | -f $(srctree)/Makefile randconfig | |
345 | ||
346 | PHONY += ppc64_randconfig | |
347 | ppc64_randconfig: | |
348 | $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/64-bit.config \ | |
349 | -f $(srctree)/Makefile randconfig | |
350 | ||
14cf11af | 351 | define archhelp |
70bf0333 GL |
352 | @echo '* zImage - Build default images selected by kernel config' |
353 | @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' | |
354 | @echo ' uImage - U-Boot native image format' | |
355 | @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' | |
356 | @echo ' versions which do not support device trees' | |
357 | @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' | |
358 | @echo ' simpleImage.<dt> - Firmware independent image.' | |
359 | @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' | |
14cf11af | 360 | @echo ' install - Install kernel using' |
caa27b66 SR |
361 | @echo ' (your) ~/bin/$(INSTALLKERNEL) or' |
362 | @echo ' (distribution) /sbin/$(INSTALLKERNEL) or' | |
14cf11af | 363 | @echo ' install to $$(INSTALL_PATH) and run lilo' |
437a58db | 364 | @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' |
70bf0333 GL |
365 | @echo '' |
366 | @echo ' Targets with <dt> embed a device tree blob inside the image' | |
367 | @echo ' These targets support board with firmware that does not' | |
368 | @echo ' support passing a device tree directly. Replace <dt> with the' | |
369 | @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' | |
370 | @echo ' (minus the .dts extension).' | |
14cf11af PM |
371 | endef |
372 | ||
d42c6d0f | 373 | PHONY += install |
3f85d63e | 374 | install: |
f774f5bb | 375 | $(call cmd,install) |
928370c6 | 376 | |
91bf6955 CL |
377 | ifeq ($(KBUILD_EXTMOD),) |
378 | # We need to generate vdso-offsets.h before compiling certain files in kernel/. | |
379 | # In order to do that, we should use the archprepare target, but we can't since | |
380 | # asm-offsets.h is included in some files used to generate vdso-offsets.h, and | |
381 | # asm-offsets.h is built in prepare0, for which archprepare is a dependency. | |
382 | # Therefore we need to generate the header after prepare0 has been made, hence | |
383 | # this hack. | |
384 | prepare: vdso_prepare | |
385 | vdso_prepare: prepare0 | |
386 | $(if $(CONFIG_VDSO32),$(Q)$(MAKE) \ | |
fd1feade | 387 | $(build)=arch/powerpc/kernel/vdso include/generated/vdso32-offsets.h) |
91bf6955 | 388 | $(if $(CONFIG_PPC64),$(Q)$(MAKE) \ |
fd1feade | 389 | $(build)=arch/powerpc/kernel/vdso include/generated/vdso64-offsets.h) |
91bf6955 CL |
390 | endif |
391 | ||
14cf11af PM |
392 | archprepare: checkbin |
393 | ||
ab66dcc7 FK |
394 | archheaders: |
395 | $(Q)$(MAKE) $(build)=arch/powerpc/kernel/syscalls all | |
396 | ||
c3ff2a51 CL |
397 | ifdef CONFIG_STACKPROTECTOR |
398 | prepare: stack_protector_prepare | |
14cf11af | 399 | |
d42c6d0f | 400 | PHONY += stack_protector_prepare |
c3ff2a51 | 401 | stack_protector_prepare: prepare0 |
06ec27ae CL |
402 | ifdef CONFIG_PPC64 |
403 | $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h)) | |
404 | else | |
c3ff2a51 CL |
405 | $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "TASK_CANARY") print $$3;}' include/generated/asm-offsets.h)) |
406 | endif | |
06ec27ae | 407 | endif |
c3ff2a51 | 408 | |
d42c6d0f | 409 | PHONY += checkbin |
f2910f0e NP |
410 | # Check toolchain versions: |
411 | # - gcc-4.6 is the minimum kernel-wide version so nothing required. | |
14cf11af | 412 | checkbin: |
a3ad84da AM |
413 | @if test "x${CONFIG_LD_IS_LLD}" != "xy" -a \ |
414 | "x$(call ld-ifversion, -le, 22400, y)" = "xy" ; then \ | |
60e065f7 ME |
415 | echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \ |
416 | echo 'in some circumstances.' ; \ | |
a3ad84da | 417 | echo '*** binutils 2.23 do not define the TOC symbol ' ; \ |
60e065f7 ME |
418 | echo -n '*** Please use a different binutils version.' ; \ |
419 | false ; \ | |
420 | fi |