1 # 1 # 2 # arch/arm/Makefile !! 2 # sparc/Makefile 3 # 3 # 4 # This file is included by the global makefile !! 4 # Makefile for the architecture dependent flags and dependencies on the 5 # architecture-specific flags and dependencies !! 5 # Sparc and sparc64. 6 # 6 # 7 # This file is subject to the terms and condit !! 7 # Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu) 8 # License. See the file "COPYING" in the main !! 8 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 9 # for more details. << 10 # << 11 # Copyright (C) 1995-2001 by Russell King << 12 << 13 LDFLAGS_vmlinux := --no-undefined -X --pic-ven << 14 ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) << 15 LDFLAGS_vmlinux += --be8 << 16 KBUILD_LDFLAGS_MODULE += --be8 << 17 endif << 18 << 19 GZFLAGS :=-9 << 20 #KBUILD_CFLAGS +=-pipe << 21 << 22 # Never generate .eh_frame << 23 KBUILD_CFLAGS += $(call cc-option,-fno-dwarf << 24 << 25 # Disable FDPIC ABI << 26 KBUILD_CFLAGS += $(call cc-option,-mno-fdpic << 27 << 28 # This should work on most of the modern platf << 29 KBUILD_DEFCONFIG := multi_v7_defconfig << 30 << 31 # defines filename extension depending memory << 32 ifeq ($(CONFIG_MMU),) << 33 MMUEXT := -nommu << 34 KBUILD_CFLAGS += $(call cc-option,-mno-unali << 35 endif << 36 << 37 ifeq ($(CONFIG_FRAME_POINTER),y) << 38 KBUILD_CFLAGS +=-fno-omit-frame-pointer << 39 ifeq ($(CONFIG_CC_IS_GCC),y) << 40 KBUILD_CFLAGS += -mapcs -mno-sched-prolog << 41 endif << 42 endif << 43 9 44 ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) !! 10 # We are not yet configured - so test on arch 45 KBUILD_CPPFLAGS += -mbig-endian !! 11 ifeq ($(ARCH),sparc) 46 CHECKFLAGS += -D__ARMEB__ !! 12 KBUILD_DEFCONFIG := sparc32_defconfig 47 KBUILD_LDFLAGS += -EB << 48 else 13 else 49 KBUILD_CPPFLAGS += -mlittle-endian !! 14 KBUILD_DEFCONFIG := sparc64_defconfig 50 CHECKFLAGS += -D__ARMEL__ << 51 KBUILD_LDFLAGS += -EL << 52 endif 15 endif 53 16 >> 17 ifeq ($(CONFIG_SPARC32),y) >> 18 ##### >> 19 # sparc32 54 # 20 # 55 # The Scalar Replacement of Aggregates (SRA) o !! 21 56 # later may result in code being generated tha << 57 # char struct members incorrectly. So disable << 58 # (https://gcc.gnu.org/bugzilla/show_bug.cgi?i << 59 # 22 # 60 KBUILD_CFLAGS += $(call cc-option,-fno-ipa-s !! 23 # Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level >> 24 # debugging of the kernel to get the proper debugging information. 61 25 62 # This selects which instruction set is used. !! 26 AS := $(AS) -32 63 arch-$(CONFIG_CPU_32v7M) :=-march=armv7 !! 27 LDFLAGS := -m elf32_sparc 64 arch-$(CONFIG_CPU_32v7) :=-march=armv7 !! 28 CHECKFLAGS += -D__sparc__ 65 arch-$(CONFIG_CPU_32v6) :=-march=armv6 !! 29 export BITS := 32 66 # Only override the compiler option if ARMv6. !! 30 UTS_MACHINE := sparc 67 # always available in ARMv7 !! 31 68 ifeq ($(CONFIG_CPU_32v6),y) !! 32 #KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7 69 arch-$(CONFIG_CPU_32v6K) :=-march=armv6 !! 33 KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 70 endif !! 34 KBUILD_AFLAGS += -m32 -Wa,-Av8 71 arch-$(CONFIG_CPU_32v5) :=-march=armv5 !! 35 72 arch-$(CONFIG_CPU_32v4T) :=-march=armv4 !! 36 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000 73 arch-$(CONFIG_CPU_32v4) :=-march=armv4 !! 37 # Since 2.5.40, the first stage is left not btfix-ed. 74 arch-$(CONFIG_CPU_32v3) :=-march=armv3 !! 38 # Actual linking is done with "make image". 75 !! 39 LDFLAGS_vmlinux = -r 76 # Note that GCC does not numerically define an << 77 # macro, but instead defines a whole series of << 78 # testing for a specific architecture or later << 79 cpp-$(CONFIG_CPU_32v7M) :=-D__LINUX_AR << 80 cpp-$(CONFIG_CPU_32v7) :=-D__LINUX_AR << 81 cpp-$(CONFIG_CPU_32v6) :=-D__LINUX_AR << 82 # Only override the compiler option if ARMv6. << 83 # always available in ARMv7 << 84 ifeq ($(CONFIG_CPU_32v6),y) << 85 cpp-$(CONFIG_CPU_32v6K) :=-D__LINUX_AR << 86 endif << 87 cpp-$(CONFIG_CPU_32v5) :=-D__LINUX_AR << 88 cpp-$(CONFIG_CPU_32v4T) :=-D__LINUX_AR << 89 cpp-$(CONFIG_CPU_32v4) :=-D__LINUX_AR << 90 cpp-$(CONFIG_CPU_32v3) :=-D__LINUX_AR << 91 << 92 # This selects how we optimise for the process << 93 tune-$(CONFIG_CPU_ARM7TDMI) :=-mtune=arm7t << 94 tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7t << 95 tune-$(CONFIG_CPU_ARM740T) :=-mtune=arm7t << 96 tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9t << 97 tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9t << 98 tune-$(CONFIG_CPU_ARM946E) :=-mtune=arm9e << 99 tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9t << 100 tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9t << 101 tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9t << 102 tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9t << 103 tune-$(CONFIG_CPU_FA526) :=-mtune=arm9t << 104 tune-$(CONFIG_CPU_SA110) :=-mtune=stron << 105 tune-$(CONFIG_CPU_SA1100) :=-mtune=stron << 106 tune-$(CONFIG_CPU_XSCALE) :=-mtune=xscal << 107 tune-$(CONFIG_CPU_XSC3) :=-mtune=xscal << 108 tune-$(CONFIG_CPU_FEROCEON) :=-mtune=xscal << 109 tune-$(CONFIG_CPU_V6) :=-mtune=arm11 << 110 tune-$(CONFIG_CPU_V6K) :=-mtune=arm11 << 111 40 112 ifeq ($(CONFIG_AEABI),y) << 113 CFLAGS_ABI :=-mabi=aapcs-linux -mfpu=vfp << 114 else 41 else 115 CFLAGS_ABI :=$(call cc-option,-mapcs-32,- !! 42 ##### 116 endif !! 43 # sparc64 117 !! 44 # 118 ifeq ($(CONFIG_ARM_UNWIND),y) << 119 CFLAGS_ABI +=-funwind-tables << 120 endif << 121 << 122 ifeq ($(CONFIG_CC_IS_CLANG),y) << 123 CFLAGS_ABI += -meabi gnu << 124 endif << 125 45 126 ifeq ($(CONFIG_CURRENT_POINTER_IN_TPIDRURO),y) !! 46 CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64 127 KBUILD_CFLAGS += -mtp=cp15 << 128 endif << 129 47 130 # Accept old syntax despite ".syntax unified" !! 48 LDFLAGS := -m elf64_sparc 131 AFLAGS_NOWARN :=$(call as-option,-Wa$(comma) !! 49 export BITS := 64 >> 50 UTS_MACHINE := sparc64 132 51 133 # The GCC option -ffreestanding is required in !! 52 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \ 134 # ARM/NEON intrinsics in a non C99-compliant e !! 53 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \ 135 CC_FLAGS_FPU := -ffreestanding !! 54 -Wa,--undeclared-regs 136 # Enable <arm_neon.h> !! 55 KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3) 137 CC_FLAGS_FPU += -isystem $(shell $(CC) -pri !! 56 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs 138 CC_FLAGS_FPU += -march=armv7-a -mfloat-abi= << 139 << 140 ifeq ($(CONFIG_THUMB2_KERNEL),y) << 141 CFLAGS_ISA :=-Wa,-mimplicit-it=always $(A << 142 AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mt << 143 CFLAGS_ISA +=-mthumb << 144 else << 145 CFLAGS_ISA :=$(call cc-option,-marm,) $(A << 146 AFLAGS_ISA :=$(CFLAGS_ISA) << 147 endif << 148 57 149 # Need -Uarm for gcc < 3.x !! 58 ifeq ($(CONFIG_MCOUNT),y) 150 KBUILD_CPPFLAGS +=$(cpp-y) !! 59 KBUILD_CFLAGS += -pg 151 KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) << 152 KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) << 153 << 154 CHECKFLAGS += -D__arm__ << 155 << 156 # Text offset. This list is sorted numerically << 157 # provide a means to avoid/resolve conflicts i << 158 # Note: the 32kB below this value is reserved << 159 # during boot, and this offset is critical to << 160 # kexec-tools. << 161 textofs-y := 0x00008000 << 162 # RTD1195 has Boot ROM at start of address spa << 163 textofs-$(CONFIG_ARCH_REALTEK) := 0x00108000 << 164 # SA1111 DMA bug: we don't want the kernel to << 165 ifeq ($(CONFIG_ARCH_SA1100),y) << 166 textofs-$(CONFIG_SA1111) := 0x00208000 << 167 endif << 168 textofs-$(CONFIG_ARCH_QCOM_RESERVE_SMEM) := 0x << 169 textofs-$(CONFIG_ARCH_MESON) := 0x00208000 << 170 textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 << 171 << 172 # Machine directory name. This list is sorted << 173 # by CONFIG_* macro name. << 174 machine-$(CONFIG_ARCH_ACTIONS) += act << 175 machine-$(CONFIG_ARCH_ALPINE) += alp << 176 machine-$(CONFIG_ARCH_ARTPEC) += art << 177 machine-$(CONFIG_ARCH_ASPEED) += asp << 178 machine-$(CONFIG_ARCH_AT91) += at9 << 179 machine-$(CONFIG_ARCH_AXXIA) += axx << 180 machine-$(CONFIG_ARCH_BCM) += bcm << 181 machine-$(CONFIG_ARCH_BERLIN) += ber << 182 machine-$(CONFIG_ARCH_CLPS711X) += clp << 183 machine-$(CONFIG_ARCH_DAVINCI) += dav << 184 machine-$(CONFIG_ARCH_DIGICOLOR) += dig << 185 machine-$(CONFIG_ARCH_DOVE) += dov << 186 machine-$(CONFIG_ARCH_EXYNOS) += exy << 187 machine-$(CONFIG_ARCH_FOOTBRIDGE) += foo << 188 machine-$(CONFIG_ARCH_GEMINI) += gem << 189 machine-$(CONFIG_ARCH_HIGHBANK) += hig << 190 machine-$(CONFIG_ARCH_HISI) += his << 191 machine-$(CONFIG_ARCH_HPE) += hpe << 192 machine-$(CONFIG_ARCH_IXP4XX) += ixp << 193 machine-$(CONFIG_ARCH_KEYSTONE) += key << 194 machine-$(CONFIG_ARCH_LPC18XX) += lpc << 195 machine-$(CONFIG_ARCH_LPC32XX) += lpc << 196 machine-$(CONFIG_ARCH_MESON) += mes << 197 machine-$(CONFIG_ARCH_MMP) += mmp << 198 machine-$(CONFIG_ARCH_MV78XX0) += mv7 << 199 machine-$(CONFIG_ARCH_MVEBU) += mve << 200 machine-$(CONFIG_ARCH_MXC) += imx << 201 machine-$(CONFIG_ARCH_MEDIATEK) += med << 202 machine-$(CONFIG_ARCH_MILBEAUT) += mil << 203 machine-$(CONFIG_ARCH_MXS) += mxs << 204 machine-$(CONFIG_ARCH_MSTARV7) += mst << 205 machine-$(CONFIG_ARCH_NOMADIK) += nom << 206 machine-$(CONFIG_ARCH_NPCM) += npc << 207 machine-$(CONFIG_ARCH_OMAP1) += oma << 208 machine-$(CONFIG_ARCH_OMAP2PLUS) += oma << 209 machine-$(CONFIG_ARCH_ORION5X) += ori << 210 machine-$(CONFIG_ARCH_PXA) += pxa << 211 machine-$(CONFIG_ARCH_QCOM) += qco << 212 machine-$(CONFIG_ARCH_REALTEK) += rea << 213 machine-$(CONFIG_ARCH_ROCKCHIP) += roc << 214 machine-$(CONFIG_ARCH_RPC) += rpc << 215 machine-$(CONFIG_PLAT_SAMSUNG) += s3c << 216 machine-$(CONFIG_ARCH_S5PV210) += s5p << 217 machine-$(CONFIG_ARCH_SA1100) += sa1 << 218 machine-$(CONFIG_ARCH_RENESAS) += shm << 219 machine-$(CONFIG_ARCH_INTEL_SOCFPGA) += soc << 220 machine-$(CONFIG_ARCH_STI) += sti << 221 machine-$(CONFIG_ARCH_STM32) += stm << 222 machine-$(CONFIG_ARCH_SUNXI) += sun << 223 machine-$(CONFIG_ARCH_TEGRA) += teg << 224 machine-$(CONFIG_ARCH_U8500) += ux5 << 225 machine-$(CONFIG_ARCH_VT8500) += vt8 << 226 machine-$(CONFIG_ARCH_ZYNQ) += zyn << 227 machine-$(CONFIG_PLAT_VERSATILE) += ver << 228 machine-$(CONFIG_PLAT_SPEAR) += spe << 229 << 230 # legacy platforms provide their own mach/*.h << 231 # these three are mutually exclusive << 232 machdirs-$(CONFIG_ARCH_FOOTBRIDGE) += arc << 233 machdirs-$(CONFIG_ARCH_RPC) += arc << 234 machdirs-$(CONFIG_ARCH_SA1100) += arc << 235 KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/% << 236 << 237 # The byte offset of the kernel image in RAM f << 238 TEXT_OFFSET := $(textofs-y) << 239 << 240 export TEXT_OFFSET GZFLAGS MMUEXT << 241 << 242 # If we have a machine-specific directory, the << 243 core-y += $(patsubst << 244 # For cleaning << 245 core- += $(patsubst << 246 << 247 core-$(CONFIG_PLAT_ORION) += arch/arm/pl << 248 << 249 libs-y := arch/arm/li << 250 << 251 # Default target when executing plain make << 252 boot := arch/arm/boot << 253 ifeq ($(CONFIG_XIP_KERNEL),y) << 254 KBUILD_IMAGE := $(boot)/xipImage << 255 else << 256 KBUILD_IMAGE := $(boot)/zImage << 257 endif 60 endif 258 61 259 ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y) << 260 prepare: stack_protector_prepare << 261 ifeq ($(CONFIG_CC_HAVE_STACKPROTECTOR_TLS),y) << 262 stack_protector_prepare: prepare0 << 263 $(eval KBUILD_CFLAGS += \ << 264 -mstack-protector-guard=tls \ << 265 -mstack-protector-guard-offset << 266 awk '{if ($$2 == "TSK_ << 267 include/genera << 268 else << 269 stack_protector_prepare: prepare0 << 270 $(eval SSP_PLUGIN_CFLAGS := \ << 271 -fplugin-arg-arm_ssp_per_task_ << 272 awk '{if ($$2 == "TSK_ << 273 include/genera << 274 $(eval KBUILD_CFLAGS += $(SSP_PLUGIN_C << 275 $(eval GCC_PLUGINS_CFLAGS += $(SSP_PLU << 276 endif << 277 endif 62 endif 278 63 279 all: $(notdir $(KBUILD_IMAGE)) !! 64 head-y := arch/sparc/kernel/head_$(BITS).o >> 65 head-y += arch/sparc/kernel/init_task.o 280 66 >> 67 core-y += arch/sparc/kernel/ >> 68 core-y += arch/sparc/mm/ arch/sparc/math-emu/ 281 69 282 archheaders: !! 70 libs-y += arch/sparc/prom/ 283 $(Q)$(MAKE) $(build)=arch/arm/tools ua !! 71 libs-y += arch/sparc/lib/ 284 72 285 archprepare: !! 73 drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ 286 $(Q)$(MAKE) $(build)=arch/arm/tools ka << 287 74 288 # Convert bzImage to zImage !! 75 # Export what is needed by arch/sparc/boot/Makefile 289 bzImage: zImage !! 76 export VMLINUX_INIT VMLINUX_MAIN >> 77 VMLINUX_INIT := $(head-y) $(init-y) >> 78 VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ >> 79 VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y) >> 80 VMLINUX_MAIN += $(drivers-y) $(net-y) 290 81 291 BOOT_TARGETS = zImage Image xipImage bootpI !! 82 ifdef CONFIG_KALLSYMS 292 INSTALL_TARGETS = zinstall uinstall install !! 83 export kallsyms.o := .tmp_kallsyms2.o >> 84 endif 293 85 294 PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TAR !! 86 boot := arch/sparc/boot 295 87 296 bootpImage uImage: zImage !! 88 # Default target 297 zImage: Image !! 89 all: zImage 298 90 299 $(BOOT_TARGETS): vmlinux !! 91 image zImage tftpboot.img vmlinux.aout: vmlinux 300 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ 92 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 301 @$(kecho) ' Kernel: $(boot)/$@ is rea << 302 << 303 $(INSTALL_TARGETS): KBUILD_IMAGE = $(boot)/$(p << 304 $(INSTALL_TARGETS): << 305 $(call cmd,install) << 306 93 307 vdso-install-$(CONFIG_VDSO) += arch/arm/vdso/v !! 94 archclean: >> 95 $(Q)$(MAKE) $(clean)=$(boot) 308 96 309 # My testing targets (bypasses dependencies) !! 97 # This is the image used for packaging 310 bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/b !! 98 KBUILD_IMAGE := $(boot)/zImage 311 << 312 include $(srctree)/scripts/Makefile.defconf << 313 PHONY += multi_v7_lpae_defconfig << 314 multi_v7_lpae_defconfig: << 315 $(call merge_into_defconfig,multi_v7_d << 316 99 >> 100 # Don't use tabs in echo arguments. >> 101 ifeq ($(ARCH),sparc) 317 define archhelp 102 define archhelp 318 echo '* zImage - Compressed kernel i !! 103 echo '* image - kernel image ($(boot)/image)' 319 echo ' Image - Uncompressed kernel !! 104 echo '* zImage - stripped kernel image ($(boot)/zImage)' 320 echo '* xipImage - XIP kernel image, i !! 105 echo ' tftpboot.img - image prepared for tftp' 321 echo ' uImage - U-Boot wrapped zIma << 322 echo ' bootpImage - Combined zImage and << 323 echo ' (supply initrd imag << 324 echo ' install - Install uncompresse << 325 echo ' zinstall - Install compressed << 326 echo ' uinstall - Install U-Boot wrap << 327 echo ' Install using (your << 328 echo ' (distribution) /sbi << 329 echo ' install to $$(INSTA << 330 echo << 331 echo ' multi_v7_lpae_defconfig - multi << 332 endef 106 endef >> 107 else >> 108 define archhelp >> 109 echo '* vmlinux - standard sparc64 kernel' >> 110 echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)' >> 111 echo ' vmlinux.aout - a.out kernel for sparc64' >> 112 echo ' tftpboot.img - image prepared for tftp' >> 113 endef >> 114 endif
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.