1 # 1 # 2 # arch/arm64/Makefile !! 2 # i386/Makefile 3 # 3 # 4 # This file is included by the global makefile 4 # This file is included by the global makefile so that you can add your own 5 # architecture-specific flags and dependencies !! 5 # architecture-specific flags and dependencies. Remember to do have actions >> 6 # for "archclean" cleaning up for this architecture. 6 # 7 # 7 # This file is subject to the terms and condit 8 # This file is subject to the terms and conditions of the GNU General Public 8 # License. See the file "COPYING" in the main 9 # License. See the file "COPYING" in the main directory of this archive 9 # for more details. 10 # for more details. 10 # 11 # 11 # Copyright (C) 1995-2001 by Russell King !! 12 # Copyright (C) 1994 by Linus Torvalds >> 13 # >> 14 # 19990713 Artur Skawina <skawina@geocities.com> >> 15 # Added '-march' and '-mpreferred-stack-boundary' support >> 16 # 12 17 13 LDFLAGS_vmlinux :=--no-undefined -X --pic-vene !! 18 LDFLAGS := -m elf_i386 >> 19 OBJCOPYFLAGS := -O binary -R .note -R .comment -S >> 20 LDFLAGS_vmlinux := 14 21 15 ifeq ($(CONFIG_RELOCATABLE), y) !! 22 CFLAGS += -pipe 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 << 67 ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y) << 68 prepare: stack_protector_prepare << 69 stack_protector_prepare: prepare0 << 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 << 88 KBUILD_CFLAGS += $(call cc-option,-mbranch-p << 89 endif << 90 23 91 # Tell the assembler to support instructions f !! 24 # prevent gcc from keeping the stack 16 byte aligned 92 # architecture. !! 25 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 93 # !! 26 94 # For non-integrated assemblers we'll pass thi !! 27 align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0)) 95 # integrated assemblers we'll define ARM64_ASM !! 28 96 # inline usage. !! 29 cflags-$(CONFIG_M386) += -march=i386 97 # !! 30 cflags-$(CONFIG_M486) += -march=i486 98 # We cannot pass the same arch flag to the com !! 31 cflags-$(CONFIG_M586) += -march=i586 99 # freely generate instructions which are not s !! 32 cflags-$(CONFIG_M586TSC) += -march=i586 100 # versions, which would prevent a single kerne !! 33 cflags-$(CONFIG_M586MMX) += $(call check_gcc,-march=pentium-mmx,-march=i586) 101 # hardware. !! 34 cflags-$(CONFIG_M686) += -march=i686 102 ifeq ($(CONFIG_AS_HAS_ARMV8_5), y) !! 35 cflags-$(CONFIG_MPENTIUMII) += $(call check_gcc,-march=pentium2,-march=i686) 103 asm-arch := armv8.5-a !! 36 cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686) 104 else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y) !! 37 cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686) 105 asm-arch := armv8.4-a !! 38 cflags-$(CONFIG_MK6) += $(call check_gcc,-march=k6,-march=i586) 106 else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y) !! 39 # Please note, that patches that add -march=athlon-xp and friends are pointless. 107 asm-arch := armv8.3-a !! 40 # They make zero difference whatsosever to performance at this time. 108 else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y) !! 41 cflags-$(CONFIG_MK7) += $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4) 109 asm-arch := armv8.2-a !! 42 cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)) 110 endif !! 43 cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 111 !! 44 cflags-$(CONFIG_MWINCHIPC6) += $(call check_gcc,-march=winchip-c6,-march=i586) 112 ifdef asm-arch !! 45 cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586) 113 KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \ !! 46 cflags-$(CONFIG_MWINCHIP3D) += $(call check_gcc,-march=winchip2,-march=i586) 114 -DARM64_ASM_ARCH='"$(asm-ar !! 47 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 115 endif !! 48 cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) 116 !! 49 117 ifeq ($(CONFIG_SHADOW_CALL_STACK), y) !! 50 CFLAGS += $(cflags-y) 118 KBUILD_CFLAGS += -ffixed-x18 !! 51 119 KBUILD_RUSTFLAGS += -Zfixed-x18 !! 52 # Default subarch .c files 120 endif !! 53 mcore-y := mach-default 121 !! 54 122 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) !! 55 # Voyager subarch support 123 KBUILD_CPPFLAGS += -mbig-endian !! 56 mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager 124 CHECKFLAGS += -D__AARCH64EB__ !! 57 mcore-$(CONFIG_X86_VOYAGER) := mach-voyager 125 # Prefer the baremetal ELF build target, but n !! 58 126 # it so fall back to the standard linux versio !! 59 # VISWS subarch support 127 KBUILD_LDFLAGS += -EB $(call ld-option, -maar !! 60 mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws 128 UTS_MACHINE := aarch64_be !! 61 mcore-$(CONFIG_X86_VISWS) := mach-visws 129 else !! 62 130 KBUILD_CPPFLAGS += -mlittle-endian !! 63 # NUMAQ subarch support 131 CHECKFLAGS += -D__AARCH64EL__ !! 64 mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq 132 # Same as above, prefer ELF but fall back to l !! 65 mcore-$(CONFIG_X86_NUMAQ) := mach-default 133 KBUILD_LDFLAGS += -EL $(call ld-option, -maar !! 66 134 UTS_MACHINE := aarch64 !! 67 # BIGSMP subarch support 135 endif !! 68 mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp 136 !! 69 mcore-$(CONFIG_X86_BIGSMP) := mach-default 137 ifeq ($(CONFIG_LD_IS_LLD), y) !! 70 138 KBUILD_LDFLAGS += -z norelro !! 71 #Summit subarch support 139 endif !! 72 mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit 140 !! 73 mcore-$(CONFIG_X86_SUMMIT) := mach-default 141 CHECKFLAGS += -D__aarch64__ !! 74 142 !! 75 # generic subarchitecture 143 ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS),y !! 76 mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic 144 KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNC !! 77 mcore-$(CONFIG_X86_GENERICARCH) := mach-default 145 CC_FLAGS_FTRACE := -fpatchable-function-entr !! 78 core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/ 146 else ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_ARGS), !! 79 147 KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNC !! 80 # ES7000 subarch support 148 CC_FLAGS_FTRACE := -fpatchable-function-entr !! 81 mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000 149 endif !! 82 mcore-$(CONFIG_X86_ES7000) := mach-es7000 150 !! 83 151 ifeq ($(CONFIG_KASAN_SW_TAGS), y) !! 84 # default subarch .h files 152 KASAN_SHADOW_SCALE_SHIFT := 4 !! 85 mflags-y += -Iinclude/asm-i386/mach-default 153 else ifeq ($(CONFIG_KASAN_GENERIC), y) !! 86 154 KASAN_SHADOW_SCALE_SHIFT := 3 !! 87 head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 155 endif !! 88 156 !! 89 libs-y += arch/i386/lib/ 157 KBUILD_CFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( !! 90 core-y += arch/i386/kernel/ \ 158 KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT= !! 91 arch/i386/mm/ \ 159 KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( !! 92 arch/i386/$(mcore-y)/ 160 !! 93 drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ 161 libs-y := arch/arm64/lib/ $(libs-y) !! 94 drivers-$(CONFIG_PCI) += arch/i386/pci/ 162 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/ !! 95 # must be linked after kernel/ 163 !! 96 drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ 164 # Default target when executing plain make !! 97 drivers-$(CONFIG_PM) += arch/i386/power/ 165 boot := arch/arm64/boot !! 98 166 !! 99 CFLAGS += $(mflags-y) 167 BOOT_TARGETS := Image vmlinuz.efi image.fit !! 100 AFLAGS += $(mflags-y) 168 !! 101 169 PHONY += $(BOOT_TARGETS) !! 102 boot := arch/i386/boot 170 !! 103 171 ifeq ($(CONFIG_EFI_ZBOOT),) !! 104 .PHONY: zImage bzImage compressed zlilo bzlilo \ 172 KBUILD_IMAGE := $(boot)/Image.gz !! 105 zdisk bzdisk fdimage fdimage144 fdimage288 install 173 else !! 106 174 KBUILD_IMAGE := $(boot)/vmlinuz.efi !! 107 all: bzImage 175 endif !! 108 176 !! 109 BOOTIMAGE=arch/i386/boot/bzImage 177 all: $(notdir $(KBUILD_IMAGE)) !! 110 zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage 178 !! 111 179 image.fit: dtbs !! 112 zImage bzImage: vmlinux 180 !! 113 $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) 181 vmlinuz.efi image.fit: Image !! 114 182 $(BOOT_TARGETS): vmlinux !! 115 compressed: zImage 183 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 116 184 !! 117 zlilo bzlilo: vmlinux 185 Image.%: Image !! 118 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo 186 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 119 187 !! 120 zdisk bzdisk: vmlinux 188 ifeq ($(CONFIG_COMPRESSED_INSTALL),y) !! 121 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 189 DEFAULT_KBUILD_IMAGE = $(KBUILD_IMAGE) !! 122 190 else !! 123 install fdimage fdimage144 fdimage288: vmlinux 191 DEFAULT_KBUILD_IMAGE = $(boot)/Image !! 124 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 192 endif !! 125 193 !! 126 prepare: include/asm-$(ARCH)/asm_offsets.h 194 install: KBUILD_IMAGE := $(DEFAULT_KBUILD_IMAG !! 127 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h 195 install zinstall: !! 128 196 $(call cmd,install) !! 129 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ 197 !! 130 include/config/MARKER 198 archprepare: !! 131 199 $(Q)$(MAKE) $(build)=arch/arm64/tools !! 132 include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s 200 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) !! 133 $(call filechk,gen-asm-offsets) 201 ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843 !! 134 202 @echo "warning: ld does not support -- !! 135 archclean: 203 endif !! 136 $(Q)$(MAKE) $(clean)=arch/i386/boot 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 << 231 include $(srctree)/scripts/Makefile.defconf << 232 << 233 PHONY += virtconfig << 234 virtconfig: << 235 $(call merge_into_defconfig_override,d << 236 137 237 define archhelp 138 define archhelp 238 echo '* Image.gz - Compressed kernel i !! 139 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' 239 echo ' Image - Uncompressed kernel !! 140 echo ' install - Install kernel using' 240 echo ' image.fit - Flat Image Tree (ar !! 141 echo ' (your) ~/bin/installkernel or' 241 echo ' install - Install kernel (com !! 142 echo ' (distribution) /sbin/installkernel or' 242 echo ' zinstall - Install compressed !! 143 echo ' install to $$(INSTALL_PATH) and run lilo' 243 echo ' Install using (your !! 144 echo ' bzdisk - Create a boot floppy in /dev/fd0' 244 echo ' (distribution) /sbi !! 145 echo ' fdimage - Create a boot floppy image' 245 echo ' install to $$(INSTA << 246 endef 146 endef >> 147 >> 148 CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.