Commit 98679fb0927cee2084caddc5277326f18642a58b
Committed by
Benjamin Herrenschmidt
1 parent
0b9fd94a1c
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
powerpc: Avoid load of static chain register when calling nested functions throu…
…gh a pointer on 64bit The ppc64 ABI has a static chain register (r11) which is only used when calling nested functions through a pointer. Considering that we take a dim view of nested functions in the kernel, we have a lot of unnecessary overhead here. gcc 4.7 has an option to disable loading of r11 so lets use it. If hell freezes over and hipsters manage to litter the kernel with nested functions, gcc will give us an error message and won't simply compile bad code: You cannot take the address of a nested function if you use the -mno-pointers-to-nested-functions option. Furthermore our kernel module trampolines don't setup the static chain register so adding this option and forcing gcc to error out makes even more sense. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 1 changed file with 1 additions and 0 deletions Inline Diff
arch/powerpc/Makefile
1 | # This file is included by the global makefile so that you can add your own | 1 | # This file is included by the global makefile so that you can add your own |
2 | # architecture-specific flags and dependencies. Remember to do have actions | 2 | # architecture-specific flags and dependencies. Remember to do have actions |
3 | # for "archclean" and "archdep" for cleaning up and making dependencies for | 3 | # for "archclean" and "archdep" for cleaning up and making dependencies for |
4 | # this architecture. | 4 | # this architecture. |
5 | # | 5 | # |
6 | # This file is subject to the terms and conditions of the GNU General Public | 6 | # This file is subject to the terms and conditions of the GNU General Public |
7 | # License. See the file "COPYING" in the main directory of this archive | 7 | # License. See the file "COPYING" in the main directory of this archive |
8 | # for more details. | 8 | # for more details. |
9 | # | 9 | # |
10 | # Copyright (C) 1994 by Linus Torvalds | 10 | # Copyright (C) 1994 by Linus Torvalds |
11 | # Changes for PPC by Gary Thomas | 11 | # Changes for PPC by Gary Thomas |
12 | # Rewritten by Cort Dougan and Paul Mackerras | 12 | # Rewritten by Cort Dougan and Paul Mackerras |
13 | # | 13 | # |
14 | 14 | ||
15 | HAS_BIARCH := $(call cc-option-yn, -m32) | 15 | HAS_BIARCH := $(call cc-option-yn, -m32) |
16 | 16 | ||
17 | # Set default 32 bits cross compilers for vdso and boot wrapper | 17 | # Set default 32 bits cross compilers for vdso and boot wrapper |
18 | CROSS32_COMPILE ?= | 18 | CROSS32_COMPILE ?= |
19 | 19 | ||
20 | CROSS32CC := $(CROSS32_COMPILE)gcc | 20 | CROSS32CC := $(CROSS32_COMPILE)gcc |
21 | CROSS32AR := $(CROSS32_COMPILE)ar | 21 | CROSS32AR := $(CROSS32_COMPILE)ar |
22 | 22 | ||
23 | ifeq ($(HAS_BIARCH),y) | 23 | ifeq ($(HAS_BIARCH),y) |
24 | ifeq ($(CROSS32_COMPILE),) | 24 | ifeq ($(CROSS32_COMPILE),) |
25 | CROSS32CC := $(CC) -m32 | 25 | CROSS32CC := $(CC) -m32 |
26 | CROSS32AR := GNUTARGET=elf32-powerpc $(AR) | 26 | CROSS32AR := GNUTARGET=elf32-powerpc $(AR) |
27 | endif | 27 | endif |
28 | endif | 28 | endif |
29 | 29 | ||
30 | export CROSS32CC CROSS32AR | 30 | export CROSS32CC CROSS32AR |
31 | 31 | ||
32 | ifeq ($(CROSS_COMPILE),) | 32 | ifeq ($(CROSS_COMPILE),) |
33 | KBUILD_DEFCONFIG := $(shell uname -m)_defconfig | 33 | KBUILD_DEFCONFIG := $(shell uname -m)_defconfig |
34 | else | 34 | else |
35 | KBUILD_DEFCONFIG := ppc64_defconfig | 35 | KBUILD_DEFCONFIG := ppc64_defconfig |
36 | endif | 36 | endif |
37 | 37 | ||
38 | ifeq ($(CONFIG_PPC64),y) | 38 | ifeq ($(CONFIG_PPC64),y) |
39 | OLDARCH := ppc64 | 39 | OLDARCH := ppc64 |
40 | 40 | ||
41 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) | 41 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) |
42 | 42 | ||
43 | ifeq ($(new_nm),y) | 43 | ifeq ($(new_nm),y) |
44 | NM := $(NM) --synthetic | 44 | NM := $(NM) --synthetic |
45 | endif | 45 | endif |
46 | 46 | ||
47 | else | 47 | else |
48 | OLDARCH := ppc | 48 | OLDARCH := ppc |
49 | endif | 49 | endif |
50 | 50 | ||
51 | # It seems there are times we use this Makefile without | 51 | # It seems there are times we use this Makefile without |
52 | # including the config file, but this replicates the old behaviour | 52 | # including the config file, but this replicates the old behaviour |
53 | ifeq ($(CONFIG_WORD_SIZE),) | 53 | ifeq ($(CONFIG_WORD_SIZE),) |
54 | CONFIG_WORD_SIZE := 32 | 54 | CONFIG_WORD_SIZE := 32 |
55 | endif | 55 | endif |
56 | 56 | ||
57 | UTS_MACHINE := $(OLDARCH) | 57 | UTS_MACHINE := $(OLDARCH) |
58 | 58 | ||
59 | ifeq ($(HAS_BIARCH),y) | 59 | ifeq ($(HAS_BIARCH),y) |
60 | override AS += -a$(CONFIG_WORD_SIZE) | 60 | override AS += -a$(CONFIG_WORD_SIZE) |
61 | override LD += -m elf$(CONFIG_WORD_SIZE)ppc | 61 | override LD += -m elf$(CONFIG_WORD_SIZE)ppc |
62 | override CC += -m$(CONFIG_WORD_SIZE) | 62 | override CC += -m$(CONFIG_WORD_SIZE) |
63 | override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) | 63 | override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR) |
64 | endif | 64 | endif |
65 | 65 | ||
66 | LDFLAGS_vmlinux-y := -Bstatic | 66 | LDFLAGS_vmlinux-y := -Bstatic |
67 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie | 67 | LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie |
68 | LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) | 68 | LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) |
69 | 69 | ||
70 | ifeq ($(CONFIG_PPC64),y) | 70 | ifeq ($(CONFIG_PPC64),y) |
71 | ifeq ($(call cc-option-yn,-mcmodel=medium),y) | 71 | ifeq ($(call cc-option-yn,-mcmodel=medium),y) |
72 | # -mcmodel=medium breaks modules because it uses 32bit offsets from | 72 | # -mcmodel=medium breaks modules because it uses 32bit offsets from |
73 | # the TOC pointer to create pointers where possible. Pointers into the | 73 | # the TOC pointer to create pointers where possible. Pointers into the |
74 | # percpu data area are created by this method. | 74 | # percpu data area are created by this method. |
75 | # | 75 | # |
76 | # The kernel module loader relocates the percpu data section from the | 76 | # The kernel module loader relocates the percpu data section from the |
77 | # original location (starting with 0xd...) to somewhere in the base | 77 | # original location (starting with 0xd...) to somewhere in the base |
78 | # kernel percpu data space (starting with 0xc...). We need a full | 78 | # kernel percpu data space (starting with 0xc...). We need a full |
79 | # 64bit relocation for this to work, hence -mcmodel=large. | 79 | # 64bit relocation for this to work, hence -mcmodel=large. |
80 | KBUILD_CFLAGS_MODULE += -mcmodel=large | 80 | KBUILD_CFLAGS_MODULE += -mcmodel=large |
81 | else | 81 | else |
82 | export NO_MINIMAL_TOC := -mno-minimal-toc | 82 | export NO_MINIMAL_TOC := -mno-minimal-toc |
83 | endif | 83 | endif |
84 | endif | 84 | endif |
85 | 85 | ||
86 | CFLAGS-$(CONFIG_PPC64) := -mtraceback=no -mcall-aixdesc | 86 | CFLAGS-$(CONFIG_PPC64) := -mtraceback=no -mcall-aixdesc |
87 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,-mminimal-toc) | 87 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,-mminimal-toc) |
88 | CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) | ||
88 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple | 89 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple |
89 | 90 | ||
90 | CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4) | 91 | CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4) |
91 | CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell) | 92 | CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell) |
92 | CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4) | 93 | CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4) |
93 | CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) | 94 | CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) |
94 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) | 95 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) |
95 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) | 96 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) |
96 | 97 | ||
97 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) | 98 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) |
98 | 99 | ||
99 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) | 100 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) |
100 | KBUILD_AFLAGS += -Iarch/$(ARCH) | 101 | KBUILD_AFLAGS += -Iarch/$(ARCH) |
101 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) | 102 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) |
102 | CPP = $(CC) -E $(KBUILD_CFLAGS) | 103 | CPP = $(CC) -E $(KBUILD_CFLAGS) |
103 | 104 | ||
104 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ | 105 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ |
105 | 106 | ||
106 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | 107 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
107 | 108 | ||
108 | # No AltiVec or VSX instructions when building kernel | 109 | # No AltiVec or VSX instructions when building kernel |
109 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) | 110 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
110 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) | 111 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) |
111 | 112 | ||
112 | # No SPE instruction when building kernel | 113 | # No SPE instruction when building kernel |
113 | # (We use all available options to help semi-broken compilers) | 114 | # (We use all available options to help semi-broken compilers) |
114 | KBUILD_CFLAGS += $(call cc-option,-mno-spe) | 115 | KBUILD_CFLAGS += $(call cc-option,-mno-spe) |
115 | KBUILD_CFLAGS += $(call cc-option,-mspe=no) | 116 | KBUILD_CFLAGS += $(call cc-option,-mspe=no) |
116 | 117 | ||
117 | # Enable unit-at-a-time mode when possible. It shrinks the | 118 | # Enable unit-at-a-time mode when possible. It shrinks the |
118 | # kernel considerably. | 119 | # kernel considerably. |
119 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) | 120 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) |
120 | 121 | ||
121 | # FIXME: the module load should be taught about the additional relocs | 122 | # FIXME: the module load should be taught about the additional relocs |
122 | # generated by this. | 123 | # generated by this. |
123 | # revert to pre-gcc-4.4 behaviour of .eh_frame | 124 | # revert to pre-gcc-4.4 behaviour of .eh_frame |
124 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | 125 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) |
125 | 126 | ||
126 | # Never use string load/store instructions as they are | 127 | # Never use string load/store instructions as they are |
127 | # often slow when they are implemented at all | 128 | # often slow when they are implemented at all |
128 | KBUILD_CFLAGS += -mno-string | 129 | KBUILD_CFLAGS += -mno-string |
129 | 130 | ||
130 | ifeq ($(CONFIG_6xx),y) | 131 | ifeq ($(CONFIG_6xx),y) |
131 | KBUILD_CFLAGS += -mcpu=powerpc | 132 | KBUILD_CFLAGS += -mcpu=powerpc |
132 | endif | 133 | endif |
133 | 134 | ||
134 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. | 135 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. |
135 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 136 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
136 | KBUILD_CFLAGS += -mno-sched-epilog | 137 | KBUILD_CFLAGS += -mno-sched-epilog |
137 | endif | 138 | endif |
138 | 139 | ||
139 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 | 140 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 |
140 | cpu-as-$(CONFIG_ALTIVEC) += -Wa,-maltivec | 141 | cpu-as-$(CONFIG_ALTIVEC) += -Wa,-maltivec |
141 | cpu-as-$(CONFIG_E500) += -Wa,-me500 | 142 | cpu-as-$(CONFIG_E500) += -Wa,-me500 |
142 | cpu-as-$(CONFIG_E200) += -Wa,-me200 | 143 | cpu-as-$(CONFIG_E200) += -Wa,-me200 |
143 | 144 | ||
144 | KBUILD_AFLAGS += $(cpu-as-y) | 145 | KBUILD_AFLAGS += $(cpu-as-y) |
145 | KBUILD_CFLAGS += $(cpu-as-y) | 146 | KBUILD_CFLAGS += $(cpu-as-y) |
146 | 147 | ||
147 | head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o | 148 | head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o |
148 | head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o | 149 | head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o |
149 | head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o | 150 | head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o |
150 | head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o | 151 | head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o |
151 | head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o | 152 | head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o |
152 | 153 | ||
153 | head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o | 154 | head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o |
154 | head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o | 155 | head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o |
155 | head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o | 156 | head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o |
156 | head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o | 157 | head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o |
157 | 158 | ||
158 | core-y += arch/powerpc/kernel/ \ | 159 | core-y += arch/powerpc/kernel/ \ |
159 | arch/powerpc/mm/ \ | 160 | arch/powerpc/mm/ \ |
160 | arch/powerpc/lib/ \ | 161 | arch/powerpc/lib/ \ |
161 | arch/powerpc/sysdev/ \ | 162 | arch/powerpc/sysdev/ \ |
162 | arch/powerpc/platforms/ \ | 163 | arch/powerpc/platforms/ \ |
163 | arch/powerpc/math-emu/ \ | 164 | arch/powerpc/math-emu/ \ |
164 | arch/powerpc/crypto/ \ | 165 | arch/powerpc/crypto/ \ |
165 | arch/powerpc/net/ | 166 | arch/powerpc/net/ |
166 | core-$(CONFIG_XMON) += arch/powerpc/xmon/ | 167 | core-$(CONFIG_XMON) += arch/powerpc/xmon/ |
167 | core-$(CONFIG_KVM) += arch/powerpc/kvm/ | 168 | core-$(CONFIG_KVM) += arch/powerpc/kvm/ |
168 | core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ | 169 | core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ |
169 | 170 | ||
170 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ | 171 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ |
171 | 172 | ||
172 | # Default to zImage, override when needed | 173 | # Default to zImage, override when needed |
173 | all: zImage | 174 | all: zImage |
174 | 175 | ||
175 | # With make 3.82 we cannot mix normal and wildcard targets | 176 | # With make 3.82 we cannot mix normal and wildcard targets |
176 | BOOT_TARGETS1 := zImage zImage.initrd uImage | 177 | BOOT_TARGETS1 := zImage zImage.initrd uImage |
177 | BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% | 178 | BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% |
178 | 179 | ||
179 | PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) | 180 | PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) |
180 | 181 | ||
181 | boot := arch/$(ARCH)/boot | 182 | boot := arch/$(ARCH)/boot |
182 | 183 | ||
183 | ifeq ($(CONFIG_RELOCATABLE),y) | 184 | ifeq ($(CONFIG_RELOCATABLE),y) |
184 | quiet_cmd_relocs_check = CALL $< | 185 | quiet_cmd_relocs_check = CALL $< |
185 | cmd_relocs_check = perl $< "$(OBJDUMP)" "$(obj)/vmlinux" | 186 | cmd_relocs_check = perl $< "$(OBJDUMP)" "$(obj)/vmlinux" |
186 | 187 | ||
187 | PHONY += relocs_check | 188 | PHONY += relocs_check |
188 | relocs_check: arch/powerpc/relocs_check.pl vmlinux | 189 | relocs_check: arch/powerpc/relocs_check.pl vmlinux |
189 | $(call cmd,relocs_check) | 190 | $(call cmd,relocs_check) |
190 | 191 | ||
191 | zImage: relocs_check | 192 | zImage: relocs_check |
192 | endif | 193 | endif |
193 | 194 | ||
194 | $(BOOT_TARGETS1): vmlinux | 195 | $(BOOT_TARGETS1): vmlinux |
195 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 196 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
196 | $(BOOT_TARGETS2): vmlinux | 197 | $(BOOT_TARGETS2): vmlinux |
197 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 198 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
198 | 199 | ||
199 | 200 | ||
200 | bootwrapper_install: | 201 | bootwrapper_install: |
201 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 202 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
202 | 203 | ||
203 | %.dtb: scripts | 204 | %.dtb: scripts |
204 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 205 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
205 | 206 | ||
206 | define archhelp | 207 | define archhelp |
207 | @echo '* zImage - Build default images selected by kernel config' | 208 | @echo '* zImage - Build default images selected by kernel config' |
208 | @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' | 209 | @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' |
209 | @echo ' uImage - U-Boot native image format' | 210 | @echo ' uImage - U-Boot native image format' |
210 | @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' | 211 | @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' |
211 | @echo ' versions which do not support device trees' | 212 | @echo ' versions which do not support device trees' |
212 | @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' | 213 | @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' |
213 | @echo ' simpleImage.<dt> - Firmware independent image.' | 214 | @echo ' simpleImage.<dt> - Firmware independent image.' |
214 | @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' | 215 | @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' |
215 | @echo ' install - Install kernel using' | 216 | @echo ' install - Install kernel using' |
216 | @echo ' (your) ~/bin/$(INSTALLKERNEL) or' | 217 | @echo ' (your) ~/bin/$(INSTALLKERNEL) or' |
217 | @echo ' (distribution) /sbin/$(INSTALLKERNEL) or' | 218 | @echo ' (distribution) /sbin/$(INSTALLKERNEL) or' |
218 | @echo ' install to $$(INSTALL_PATH) and run lilo' | 219 | @echo ' install to $$(INSTALL_PATH) and run lilo' |
219 | @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' | 220 | @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' |
220 | @echo '' | 221 | @echo '' |
221 | @echo ' Targets with <dt> embed a device tree blob inside the image' | 222 | @echo ' Targets with <dt> embed a device tree blob inside the image' |
222 | @echo ' These targets support board with firmware that does not' | 223 | @echo ' These targets support board with firmware that does not' |
223 | @echo ' support passing a device tree directly. Replace <dt> with the' | 224 | @echo ' support passing a device tree directly. Replace <dt> with the' |
224 | @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' | 225 | @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' |
225 | @echo ' (minus the .dts extension).' | 226 | @echo ' (minus the .dts extension).' |
226 | endef | 227 | endef |
227 | 228 | ||
228 | install: | 229 | install: |
229 | $(Q)$(MAKE) $(build)=$(boot) install | 230 | $(Q)$(MAKE) $(build)=$(boot) install |
230 | 231 | ||
231 | vdso_install: | 232 | vdso_install: |
232 | ifeq ($(CONFIG_PPC64),y) | 233 | ifeq ($(CONFIG_PPC64),y) |
233 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ | 234 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ |
234 | endif | 235 | endif |
235 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ | 236 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ |
236 | 237 | ||
237 | archclean: | 238 | archclean: |
238 | $(Q)$(MAKE) $(clean)=$(boot) | 239 | $(Q)$(MAKE) $(clean)=$(boot) |
239 | 240 | ||
240 | archprepare: checkbin | 241 | archprepare: checkbin |
241 | 242 | ||
242 | # Use the file '.tmp_gas_check' for binutils tests, as gas won't output | 243 | # Use the file '.tmp_gas_check' for binutils tests, as gas won't output |
243 | # to stdout and these checks are run even on install targets. | 244 | # to stdout and these checks are run even on install targets. |
244 | TOUT := .tmp_gas_check | 245 | TOUT := .tmp_gas_check |
245 | 246 | ||
246 | # Check gcc and binutils versions: | 247 | # Check gcc and binutils versions: |
247 | # - gcc-3.4 and binutils-2.14 are a fatal combination | 248 | # - gcc-3.4 and binutils-2.14 are a fatal combination |
248 | # - Require gcc 4.0 or above on 64-bit | 249 | # - Require gcc 4.0 or above on 64-bit |
249 | # - gcc-4.2.0 has issues compiling modules on 64-bit | 250 | # - gcc-4.2.0 has issues compiling modules on 64-bit |
250 | checkbin: | 251 | checkbin: |
251 | @if test "$(call cc-version)" = "0304" ; then \ | 252 | @if test "$(call cc-version)" = "0304" ; then \ |
252 | if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ | 253 | if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ |
253 | echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ | 254 | echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \ |
254 | echo 'correctly with gcc-3.4 and your version of binutils.'; \ | 255 | echo 'correctly with gcc-3.4 and your version of binutils.'; \ |
255 | echo '*** Please upgrade your binutils or downgrade your gcc'; \ | 256 | echo '*** Please upgrade your binutils or downgrade your gcc'; \ |
256 | false; \ | 257 | false; \ |
257 | fi ; \ | 258 | fi ; \ |
258 | fi | 259 | fi |
259 | @if test "$(call cc-version)" -lt "0400" \ | 260 | @if test "$(call cc-version)" -lt "0400" \ |
260 | && test "x${CONFIG_PPC64}" = "xy" ; then \ | 261 | && test "x${CONFIG_PPC64}" = "xy" ; then \ |
261 | echo -n "Sorry, GCC v4.0 or above is required to build " ; \ | 262 | echo -n "Sorry, GCC v4.0 or above is required to build " ; \ |
262 | echo "the 64-bit powerpc kernel." ; \ | 263 | echo "the 64-bit powerpc kernel." ; \ |
263 | false ; \ | 264 | false ; \ |
264 | fi | 265 | fi |
265 | @if test "$(call cc-fullversion)" = "040200" \ | 266 | @if test "$(call cc-fullversion)" = "040200" \ |
266 | && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ | 267 | && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ |
267 | echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ | 268 | echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ |
268 | echo 'kernel with modules enabled.' ; \ | 269 | echo 'kernel with modules enabled.' ; \ |
269 | echo -n '*** Please use a different GCC version or ' ; \ | 270 | echo -n '*** Please use a different GCC version or ' ; \ |
270 | echo 'disable kernel modules' ; \ | 271 | echo 'disable kernel modules' ; \ |
271 | false ; \ | 272 | false ; \ |
272 | fi | 273 | fi |
273 | 274 | ||
274 | CLEAN_FILES += $(TOUT) | 275 | CLEAN_FILES += $(TOUT) |
275 | 276 | ||
276 | 277 |