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" and "archdep" for cleaning up and making dependencies for >> 7 # this architecture 6 # 8 # 7 # This file is subject to the terms and condit 9 # This file is subject to the terms and conditions of the GNU General Public 8 # License. See the file "COPYING" in the main 10 # License. See the file "COPYING" in the main directory of this archive 9 # for more details. 11 # for more details. 10 # 12 # 11 # Copyright (C) 1995-2001 by Russell King !! 13 # Copyright (C) 1994 by Linus Torvalds >> 14 # >> 15 # 19990713 Artur Skawina <skawina@geocities.com> >> 16 # Added '-march' and '-mpreferred-stack-boundary' support >> 17 # >> 18 >> 19 LD=$(CROSS_COMPILE)ld -m elf_i386 >> 20 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S >> 21 LDFLAGS=-e stext >> 22 LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) >> 23 >> 24 CFLAGS += -pipe 12 25 13 LDFLAGS_vmlinux :=--no-undefined -X --pic-vene !! 26 # prevent gcc from keeping the stack 16 byte aligned >> 27 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 14 28 15 ifeq ($(CONFIG_RELOCATABLE), y) !! 29 ifdef CONFIG_M386 16 # Pass --no-apply-dynamic-relocs to restore pr !! 30 CFLAGS += -march=i386 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 31 endif 90 32 91 # Tell the assembler to support instructions f !! 33 ifdef CONFIG_M486 92 # architecture. !! 34 CFLAGS += -march=i486 93 # << 94 # For non-integrated assemblers we'll pass thi << 95 # integrated assemblers we'll define ARM64_ASM << 96 # inline usage. << 97 # << 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 35 endif 111 36 112 ifdef asm-arch !! 37 ifdef CONFIG_M586 113 KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \ !! 38 CFLAGS += -march=i586 114 -DARM64_ASM_ARCH='"$(asm-ar << 115 endif 39 endif 116 40 117 ifeq ($(CONFIG_SHADOW_CALL_STACK), y) !! 41 ifdef CONFIG_M586TSC 118 KBUILD_CFLAGS += -ffixed-x18 !! 42 CFLAGS += -march=i586 119 KBUILD_RUSTFLAGS += -Zfixed-x18 << 120 endif 43 endif 121 44 122 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) !! 45 ifdef CONFIG_M586MMX 123 KBUILD_CPPFLAGS += -mbig-endian !! 46 CFLAGS += -march=i586 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 << 130 KBUILD_CPPFLAGS += -mlittle-endian << 131 CHECKFLAGS += -D__AARCH64EL__ << 132 # Same as above, prefer ELF but fall back to l << 133 KBUILD_LDFLAGS += -EL $(call ld-option, -maar << 134 UTS_MACHINE := aarch64 << 135 endif 47 endif 136 48 137 ifeq ($(CONFIG_LD_IS_LLD), y) !! 49 ifdef CONFIG_M686 138 KBUILD_LDFLAGS += -z norelro !! 50 CFLAGS += -march=i686 139 endif 51 endif 140 52 141 CHECKFLAGS += -D__aarch64__ !! 53 ifdef CONFIG_MPENTIUMIII >> 54 CFLAGS += -march=i686 >> 55 endif 142 56 143 ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS),y !! 57 ifdef CONFIG_MPENTIUM4 144 KBUILD_CPPFLAGS += -DCC_USING_PATCHABLE_FUNC !! 58 CFLAGS += -march=i686 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 59 endif 150 60 151 ifeq ($(CONFIG_KASAN_SW_TAGS), y) !! 61 ifdef CONFIG_MK6 152 KASAN_SHADOW_SCALE_SHIFT := 4 !! 62 CFLAGS += $(call check_gcc,-march=k6,-march=i586) 153 else ifeq ($(CONFIG_KASAN_GENERIC), y) << 154 KASAN_SHADOW_SCALE_SHIFT := 3 << 155 endif 63 endif 156 64 157 KBUILD_CFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( !! 65 ifdef CONFIG_MK7 158 KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT= !! 66 CFLAGS += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4) 159 KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$( !! 67 endif 160 68 161 libs-y := arch/arm64/lib/ $(libs-y) !! 69 ifdef CONFIG_MCRUSOE 162 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/ !! 70 CFLAGS += -march=i686 >> 71 CFLAGS += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) >> 72 endif 163 73 164 # Default target when executing plain make !! 74 ifdef CONFIG_MGEODE_LX 165 boot := arch/arm64/boot !! 75 CFLAGS += -march=i686 >> 76 endif 166 77 167 BOOT_TARGETS := Image vmlinuz.efi image.fit !! 78 ifdef CONFIG_MWINCHIPC6 >> 79 CFLAGS += -march=i586 >> 80 endif 168 81 169 PHONY += $(BOOT_TARGETS) !! 82 ifdef CONFIG_MWINCHIP2 >> 83 CFLAGS += -march=i586 >> 84 endif 170 85 171 ifeq ($(CONFIG_EFI_ZBOOT),) !! 86 ifdef CONFIG_MWINCHIP3D 172 KBUILD_IMAGE := $(boot)/Image.gz !! 87 CFLAGS += -march=i586 173 else << 174 KBUILD_IMAGE := $(boot)/vmlinuz.efi << 175 endif 88 endif 176 89 177 all: $(notdir $(KBUILD_IMAGE)) !! 90 ifdef CONFIG_MCYRIXIII >> 91 CFLAGS += $(call check_gcc,-march=c3,-march=i486) >> 92 CFLAGS += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) >> 93 endif 178 94 179 image.fit: dtbs !! 95 ifdef CONFIG_MVIAC3_2 >> 96 CFLAGS += $(call check_gcc,-march=c3-2,-march=i686) >> 97 endif 180 98 181 vmlinuz.efi image.fit: Image !! 99 # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use 182 $(BOOT_TARGETS): vmlinux !! 100 # a lot more stack due to the lack of sharing of stacklots. 183 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 101 # CFLAGS += $(call if_gcc4,,$(call check_gcc,-fno-unit-at-a-time,)) >> 102 # Disable unit-at-a-time on gcc >= 4 too, because it removes seemingly unused >> 103 # variables which are indeed module params. >> 104 CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) 184 105 185 Image.%: Image !! 106 HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 186 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ << 187 107 188 ifeq ($(CONFIG_COMPRESSED_INSTALL),y) !! 108 SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib 189 DEFAULT_KBUILD_IMAGE = $(KBUILD_IMAGE) << 190 else << 191 DEFAULT_KBUILD_IMAGE = $(boot)/Image << 192 endif << 193 109 194 install: KBUILD_IMAGE := $(DEFAULT_KBUILD_IMAG !! 110 CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES) 195 install zinstall: !! 111 LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a 196 $(call cmd,install) << 197 112 198 archprepare: !! 113 ifdef CONFIG_MATH_EMULATION 199 $(Q)$(MAKE) $(build)=arch/arm64/tools !! 114 SUBDIRS += arch/i386/math-emu 200 ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) !! 115 DRIVERS += arch/i386/math-emu/math.o 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 116 endif 210 117 211 ifeq ($(KBUILD_EXTMOD),) !! 118 arch/i386/kernel: dummy 212 # We need to generate vdso-offsets.h before co !! 119 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel 213 # In order to do that, we should use the archp !! 120 214 # asm-offsets.h is included in some files used !! 121 arch/i386/mm: dummy 215 # asm-offsets.h is built in prepare0, for whic !! 122 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm 216 # Therefore we need to generate the header aft !! 123 217 # this hack. !! 124 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 218 prepare: vdso_prepare !! 125 219 vdso_prepare: prepare0 !! 126 vmlinux: arch/i386/vmlinux.lds 220 $(Q)$(MAKE) $(build)=arch/arm64/kernel !! 127 221 include/generated/vdso-offsets.h arch/ !! 128 FORCE: ; 222 ifdef CONFIG_COMPAT_VDSO !! 129 223 $(Q)$(MAKE) $(build)=arch/arm64/kernel !! 130 .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ 224 arch/arm64/kernel/vdso32/vdso.so !! 131 clean archclean archmrproper archdep 225 endif !! 132 226 endif !! 133 zImage: vmlinux >> 134 @$(MAKEBOOT) zImage >> 135 >> 136 bzImage: vmlinux >> 137 @$(MAKEBOOT) bzImage >> 138 >> 139 compressed: zImage >> 140 >> 141 zlilo: vmlinux >> 142 @$(MAKEBOOT) BOOTIMAGE=zImage zlilo >> 143 >> 144 tmp: >> 145 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo >> 146 bzlilo: vmlinux >> 147 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo >> 148 >> 149 zdisk: vmlinux >> 150 @$(MAKEBOOT) BOOTIMAGE=zImage zdisk >> 151 >> 152 bzdisk: vmlinux >> 153 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk 227 154 228 vdso-install-y += arc !! 155 install: vmlinux 229 vdso-install-$(CONFIG_COMPAT_VDSO) += arc !! 156 @$(MAKEBOOT) BOOTIMAGE=bzImage install 230 157 231 include $(srctree)/scripts/Makefile.defconf !! 158 archclean: >> 159 @$(MAKEBOOT) clean 232 160 233 PHONY += virtconfig !! 161 archmrproper: 234 virtconfig: << 235 $(call merge_into_defconfig_override,d << 236 162 237 define archhelp !! 163 archdep: 238 echo '* Image.gz - Compressed kernel i !! 164 @$(MAKEBOOT) dep 239 echo ' Image - Uncompressed kernel << 240 echo ' image.fit - Flat Image Tree (ar << 241 echo ' install - Install kernel (com << 242 echo ' zinstall - Install compressed << 243 echo ' Install using (your << 244 echo ' (distribution) /sbi << 245 echo ' install to $$(INSTA << 246 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.