>> 1 # SPDX-License-Identifier: GPL-2.0 1 # 2 # 2 # arch/arm64/Makefile !! 3 # sparc/Makefile 3 # 4 # 4 # This file is included by the global makefile !! 5 # Makefile for the architecture dependent flags and dependencies on the 5 # architecture-specific flags and dependencies !! 6 # Sparc and sparc64. 6 # 7 # 7 # This file is subject to the terms and condit !! 8 # Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu) 8 # License. See the file "COPYING" in the main !! 9 # 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-vene << 14 << 15 ifeq ($(CONFIG_RELOCATABLE), y) << 16 # Pass --no-apply-dynamic-relocs to restore pr << 17 # for relative relocs, since this leads to bet << 18 # with the relocation offsets always being zer << 19 LDFLAGS_vmlinux += -shared -Bsymbolic << 20 $(call ld-option, --no << 21 endif << 22 << 23 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) << 24 ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_8434 << 25 LDFLAGS_vmlinux += --fix-cortex-a53-843419 << 26 endif << 27 endif << 28 << 29 cc_has_k_constraint := $(call try-run,echo << 30 'int main(void) { << 31 asm volatile("and w0, w0, %w0" << 32 return 0; << 33 }' | $(CC) -S -x c -o "$$TMP" -,,-DCON << 34 << 35 ifeq ($(CONFIG_BROKEN_GAS_INST),y) << 36 $(warning Detected assembler with broken .inst << 37 endif << 38 << 39 # The GCC option -ffreestanding is required in << 40 # ARM/NEON intrinsics in a non C99-compliant e << 41 CC_FLAGS_FPU := -ffreestanding << 42 # Enable <arm_neon.h> << 43 CC_FLAGS_FPU += -isystem $(shell $(CC) -pri << 44 CC_FLAGS_NO_FPU := -mgeneral-regs-only << 45 << 46 KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU) \ << 47 $(compat_vdso) $(cc_has_k_c << 48 KBUILD_CFLAGS += $(call cc-disable-warning, << 49 KBUILD_AFLAGS += $(compat_vdso) << 50 << 51 KBUILD_RUSTFLAGS += --target=aarch64-unknown-n << 52 << 53 KBUILD_CFLAGS += $(call cc-option,-mabi=lp64 << 54 KBUILD_AFLAGS += $(call cc-option,-mabi=lp64 << 55 << 56 # Avoid generating .eh_frame* sections. << 57 ifneq ($(CONFIG_UNWIND_TABLES),y) << 58 KBUILD_CFLAGS += -fno-asynchronous-unwind-ta << 59 KBUILD_AFLAGS += -fno-asynchronous-unwind-ta << 60 KBUILD_RUSTFLAGS += -Cforce-unwind-tables=n << 61 else << 62 KBUILD_CFLAGS += -fasynchronous-unwind-table << 63 KBUILD_AFLAGS += -fasynchronous-unwind-table << 64 KBUILD_RUSTFLAGS += -Cforce-unwind-tables=y -Z << 65 endif << 66 10 67 ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y) !! 11 # We are not yet configured - so test on arch 68 prepare: stack_protector_prepare !! 12 ifeq ($(ARCH),sparc64) 69 stack_protector_prepare: prepare0 !! 13 KBUILD_DEFCONFIG := sparc64_defconfig 70 $(eval KBUILD_CFLAGS += -mstack-protec << 71 -mstack-protec << 72 -mstack-protec << 73 awk '{if ($$2 == "TSK_ << 74 includ << 75 endif << 76 << 77 ifeq ($(CONFIG_ARM64_BTI_KERNEL),y) << 78 KBUILD_CFLAGS += -mbranch-protection=pac-ret << 79 KBUILD_RUSTFLAGS += -Zbranch-protection=bti, << 80 else ifeq ($(CONFIG_ARM64_PTR_AUTH_KERNEL),y) << 81 KBUILD_RUSTFLAGS += -Zbranch-protection=pac- << 82 ifeq ($(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET),y << 83 KBUILD_CFLAGS += -mbranch-protection=pac-r << 84 else << 85 KBUILD_CFLAGS += -msign-return-address=non << 86 endif << 87 else 14 else 88 KBUILD_CFLAGS += $(call cc-option,-mbranch-p !! 15 KBUILD_DEFCONFIG := sparc32_defconfig 89 endif 16 endif 90 17 91 # Tell the assembler to support instructions f !! 18 ifeq ($(CONFIG_SPARC32),y) 92 # architecture. !! 19 ##### 93 # !! 20 # sparc32 94 # For non-integrated assemblers we'll pass thi << 95 # integrated assemblers we'll define ARM64_ASM << 96 # inline usage. << 97 # 21 # 98 # We cannot pass the same arch flag to the com << 99 # freely generate instructions which are not s << 100 # versions, which would prevent a single kerne << 101 # hardware. << 102 ifeq ($(CONFIG_AS_HAS_ARMV8_5), y) << 103 asm-arch := armv8.5-a << 104 else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y) << 105 asm-arch := armv8.4-a << 106 else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y) << 107 asm-arch := armv8.3-a << 108 else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y) << 109 asm-arch := armv8.2-a << 110 endif << 111 22 112 ifdef asm-arch !! 23 CHECKFLAGS += -D__sparc__ 113 KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \ !! 24 KBUILD_LDFLAGS := -m elf32_sparc 114 -DARM64_ASM_ARCH='"$(asm-ar !! 25 export BITS := 32 115 endif !! 26 UTS_MACHINE := sparc 116 27 117 ifeq ($(CONFIG_SHADOW_CALL_STACK), y) !! 28 # We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some 118 KBUILD_CFLAGS += -ffixed-x18 !! 29 # versions of gcc. Some gcc versions won't pass -Av8 to binutils when you 119 KBUILD_RUSTFLAGS += -Zfixed-x18 !! 30 # give -mcpu=v8. This silently worked with older bintutils versions but 120 endif !! 31 # does not any more. >> 32 KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 >> 33 KBUILD_CFLAGS += -Wa,-Av8 >> 34 >> 35 KBUILD_AFLAGS += -m32 -Wa,-Av8 121 36 122 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) << 123 KBUILD_CPPFLAGS += -mbig-endian << 124 CHECKFLAGS += -D__AARCH64EB__ << 125 # Prefer the baremetal ELF build target, but n << 126 # it so fall back to the standard linux versio << 127 KBUILD_LDFLAGS += -EB $(call ld-option, -maar << 128 UTS_MACHINE := aarch64_be << 129 else 37 else 130 KBUILD_CPPFLAGS += -mlittle-endian !! 38 ##### 131 CHECKFLAGS += -D__AARCH64EL__ !! 39 # sparc64 132 # Same as above, prefer ELF but fall back to l !! 40 # 133 KBUILD_LDFLAGS += -EL $(call ld-option, -maar << 134 UTS_MACHINE := aarch64 << 135 endif << 136 41 137 ifeq ($(CONFIG_LD_IS_LLD), y) !! 42 CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ 138 KBUILD_LDFLAGS += -z norelro !! 43 KBUILD_LDFLAGS := -m elf64_sparc 139 endif !! 44 export BITS := 64 >> 45 UTS_MACHINE := sparc64 140 46 141 CHECKFLAGS += -D__aarch64__ !! 47 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow >> 48 KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare >> 49 KBUILD_CFLAGS += -Wa,--undeclared-regs >> 50 KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3) >> 51 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs 142 52 143 ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS),y !! 53 ifeq ($(CONFIG_MCOUNT),y) 144 KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNC !! 54 KBUILD_CFLAGS += -pg 145 CC_FLAGS_FTRACE := -fpatchable-function-entr << 146 else ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_ARGS), << 147 KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNC << 148 CC_FLAGS_FTRACE := -fpatchable-function-entr << 149 endif 55 endif 150 56 151 ifeq ($(CONFIG_KASAN_SW_TAGS), y) << 152 KASAN_SHADOW_SCALE_SHIFT := 4 << 153 else ifeq ($(CONFIG_KASAN_GENERIC), y) << 154 KASAN_SHADOW_SCALE_SHIFT := 3 << 155 endif 57 endif 156 58 157 KBUILD_CFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( !! 59 libs-y += arch/sparc/prom/ 158 KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT= !! 60 libs-y += arch/sparc/lib/ 159 KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( << 160 << 161 libs-y := arch/arm64/lib/ $(libs-y) << 162 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/ << 163 << 164 # Default target when executing plain make << 165 boot := arch/arm64/boot << 166 << 167 BOOT_TARGETS := Image vmlinuz.efi image.fit << 168 61 169 PHONY += $(BOOT_TARGETS) !! 62 drivers-$(CONFIG_PM) += arch/sparc/power/ >> 63 drivers-$(CONFIG_VIDEO) += arch/sparc/video/ 170 64 171 ifeq ($(CONFIG_EFI_ZBOOT),) !! 65 boot := arch/sparc/boot 172 KBUILD_IMAGE := $(boot)/Image.gz << 173 else << 174 KBUILD_IMAGE := $(boot)/vmlinuz.efi << 175 endif << 176 << 177 all: $(notdir $(KBUILD_IMAGE)) << 178 66 179 image.fit: dtbs !! 67 # Default target 180 !! 68 all: zImage 181 vmlinuz.efi image.fit: Image << 182 $(BOOT_TARGETS): vmlinux << 183 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ << 184 69 185 Image.%: Image !! 70 image zImage uImage tftpboot.img vmlinux.aout: vmlinux 186 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ 71 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 187 72 188 ifeq ($(CONFIG_COMPRESSED_INSTALL),y) !! 73 install: 189 DEFAULT_KBUILD_IMAGE = $(KBUILD_IMAGE) << 190 else << 191 DEFAULT_KBUILD_IMAGE = $(boot)/Image << 192 endif << 193 << 194 install: KBUILD_IMAGE := $(DEFAULT_KBUILD_IMAG << 195 install zinstall: << 196 $(call cmd,install) 74 $(call cmd,install) 197 75 198 archprepare: !! 76 archheaders: 199 $(Q)$(MAKE) $(build)=arch/arm64/tools !! 77 $(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all 200 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) << 201 ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843 << 202 @echo "warning: ld does not support -- << 203 endif << 204 endif << 205 ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y) << 206 ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y) << 207 @echo "warning: LSE atomics not suppor << 208 endif << 209 endif << 210 << 211 ifeq ($(KBUILD_EXTMOD),) << 212 # We need to generate vdso-offsets.h before co << 213 # In order to do that, we should use the archp << 214 # asm-offsets.h is included in some files used << 215 # asm-offsets.h is built in prepare0, for whic << 216 # Therefore we need to generate the header aft << 217 # this hack. << 218 prepare: vdso_prepare << 219 vdso_prepare: prepare0 << 220 $(Q)$(MAKE) $(build)=arch/arm64/kernel << 221 include/generated/vdso-offsets.h arch/ << 222 ifdef CONFIG_COMPAT_VDSO << 223 $(Q)$(MAKE) $(build)=arch/arm64/kernel << 224 arch/arm64/kernel/vdso32/vdso.so << 225 endif << 226 endif << 227 << 228 vdso-install-y += arc << 229 vdso-install-$(CONFIG_COMPAT_VDSO) += arc << 230 78 231 include $(srctree)/scripts/Makefile.defconf !! 79 vdso-install-$(CONFIG_SPARC64) += arch/sparc/vdso/vdso64.so.dbg >> 80 vdso-install-$(CONFIG_COMPAT) += arch/sparc/vdso/vdso32.so.dbg 232 81 233 PHONY += virtconfig !! 82 # This is the image used for packaging 234 virtconfig: !! 83 KBUILD_IMAGE := $(boot)/zImage 235 $(call merge_into_defconfig_override,d << 236 84 >> 85 # Don't use tabs in echo arguments. 237 define archhelp 86 define archhelp 238 echo '* Image.gz - Compressed kernel i !! 87 echo '* vmlinux - standard SPARC kernel' 239 echo ' Image - Uncompressed kernel !! 88 echo ' image - kernel image ($(boot)/image)' 240 echo ' image.fit - Flat Image Tree (ar !! 89 echo '* zImage - stripped/compressed kernel image ($(boot)/zImage)' 241 echo ' install - Install kernel (com !! 90 echo ' uImage - U-Boot SPARC32 Image (only for LEON)' 242 echo ' zinstall - Install compressed !! 91 echo ' vmlinux.aout - a.out kernel for SPARC64' 243 echo ' Install using (your !! 92 echo ' tftpboot.img - image prepared for tftp' 244 echo ' (distribution) /sbi << 245 echo ' install to $$(INSTA << 246 endef 93 endef
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.