18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci# Unified Makefile for i386 and x86_64
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci# select defconfig based on actual architecture
58c2ecf20Sopenharmony_ciifeq ($(ARCH),x86)
68c2ecf20Sopenharmony_ci  ifeq ($(shell uname -m),x86_64)
78c2ecf20Sopenharmony_ci        KBUILD_DEFCONFIG := x86_64_defconfig
88c2ecf20Sopenharmony_ci  else
98c2ecf20Sopenharmony_ci        KBUILD_DEFCONFIG := i386_defconfig
108c2ecf20Sopenharmony_ci  endif
118c2ecf20Sopenharmony_cielse
128c2ecf20Sopenharmony_ci        KBUILD_DEFCONFIG := $(ARCH)_defconfig
138c2ecf20Sopenharmony_ciendif
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci# For gcc stack alignment is specified with -mpreferred-stack-boundary,
168c2ecf20Sopenharmony_ci# clang has the option -mstack-alignment for that purpose.
178c2ecf20Sopenharmony_ciifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
188c2ecf20Sopenharmony_ci      cc_stack_align4 := -mpreferred-stack-boundary=2
198c2ecf20Sopenharmony_ci      cc_stack_align8 := -mpreferred-stack-boundary=3
208c2ecf20Sopenharmony_cielse ifneq ($(call cc-option, -mstack-alignment=16),)
218c2ecf20Sopenharmony_ci      cc_stack_align4 := -mstack-alignment=4
228c2ecf20Sopenharmony_ci      cc_stack_align8 := -mstack-alignment=8
238c2ecf20Sopenharmony_ciendif
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci# How to compile the 16-bit code.  Note we always compile for -march=i386;
268c2ecf20Sopenharmony_ci# that way we can complain to the user if the CPU is insufficient.
278c2ecf20Sopenharmony_ci#
288c2ecf20Sopenharmony_ci# The -m16 option is supported by GCC >= 4.9 and clang >= 3.5. For
298c2ecf20Sopenharmony_ci# older versions of GCC, include an *assembly* header to make sure that
308c2ecf20Sopenharmony_ci# gcc doesn't play any games behind our back.
318c2ecf20Sopenharmony_ciCODE16GCC_CFLAGS := -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h
328c2ecf20Sopenharmony_ciM16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciREALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \
358c2ecf20Sopenharmony_ci		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
368c2ecf20Sopenharmony_ci		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
378c2ecf20Sopenharmony_ci		   -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciREALMODE_CFLAGS += -ffreestanding
408c2ecf20Sopenharmony_ciREALMODE_CFLAGS += -fno-stack-protector
418c2ecf20Sopenharmony_ciREALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member)
428c2ecf20Sopenharmony_ciREALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4))
438c2ecf20Sopenharmony_ciREALMODE_CFLAGS += $(CLANG_FLAGS)
448c2ecf20Sopenharmony_ciexport REALMODE_CFLAGS
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci# BITS is used as extension for files which are available in a 32 bit
478c2ecf20Sopenharmony_ci# and a 64 bit version to simplify shared Makefiles.
488c2ecf20Sopenharmony_ci# e.g.: obj-y += foo_$(BITS).o
498c2ecf20Sopenharmony_ciexport BITS
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#
528c2ecf20Sopenharmony_ci# Prevent GCC from generating any FP code by mistake.
538c2ecf20Sopenharmony_ci#
548c2ecf20Sopenharmony_ci# This must happen before we try the -mpreferred-stack-boundary, see:
558c2ecf20Sopenharmony_ci#
568c2ecf20Sopenharmony_ci#    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
578c2ecf20Sopenharmony_ci#
588c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
598c2ecf20Sopenharmony_ciKBUILD_CFLAGS += $(call cc-option,-mno-avx,)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci# Intel CET isn't enabled in the kernel
628c2ecf20Sopenharmony_ciKBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciifeq ($(CONFIG_X86_32),y)
658c2ecf20Sopenharmony_ci        BITS := 32
668c2ecf20Sopenharmony_ci        UTS_MACHINE := i386
678c2ecf20Sopenharmony_ci        CHECKFLAGS += -D__i386__
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci        biarch := $(call cc-option,-m32)
708c2ecf20Sopenharmony_ci        KBUILD_AFLAGS += $(biarch)
718c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(biarch)
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci        # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
768c2ecf20Sopenharmony_ci        # with nonstandard options
778c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -fno-pic
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci        # Align the stack to the register width instead of using the default
808c2ecf20Sopenharmony_ci        # alignment of 16 bytes. This reduces stack usage and the number of
818c2ecf20Sopenharmony_ci        # alignment instructions.
828c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align4))
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci        # CPU-specific tuning. Anything which can be shared with UML should go here.
858c2ecf20Sopenharmony_ci        include arch/x86/Makefile_32.cpu
868c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(cflags-y)
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci        # temporary until string.h is fixed
898c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -ffreestanding
908c2ecf20Sopenharmony_cielse
918c2ecf20Sopenharmony_ci        BITS := 64
928c2ecf20Sopenharmony_ci        UTS_MACHINE := x86_64
938c2ecf20Sopenharmony_ci        CHECKFLAGS += -D__x86_64__
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci        biarch := -m64
968c2ecf20Sopenharmony_ci        KBUILD_AFLAGS += -m64
978c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -m64
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci        # Align jump targets to 1 byte, not the default 16 bytes:
1008c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci        # Pack loops tightly as well:
1038c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci        # Don't autogenerate traditional x87 instructions
1068c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
1078c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci        # By default gcc and clang use a stack alignment of 16 bytes for x86.
1108c2ecf20Sopenharmony_ci        # However the standard kernel entry on x86-64 leaves the stack on an
1118c2ecf20Sopenharmony_ci        # 8-byte boundary. If the compiler isn't informed about the actual
1128c2ecf20Sopenharmony_ci        # alignment it will generate extra alignment instructions for the
1138c2ecf20Sopenharmony_ci        # default alignment which keep the stack *mis*aligned.
1148c2ecf20Sopenharmony_ci        # Furthermore an alignment to the register width reduces stack usage
1158c2ecf20Sopenharmony_ci        # and the number of alignment instructions.
1168c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align8))
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci	# Use -mskip-rax-setup if supported.
1198c2ecf20Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci        # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
1228c2ecf20Sopenharmony_ci        cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
1238c2ecf20Sopenharmony_ci        cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci        cflags-$(CONFIG_MCORE2) += \
1268c2ecf20Sopenharmony_ci                $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
1278c2ecf20Sopenharmony_ci	cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
1288c2ecf20Sopenharmony_ci		$(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
1298c2ecf20Sopenharmony_ci        cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
1308c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += $(cflags-y)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -mno-red-zone
1338c2ecf20Sopenharmony_ci        KBUILD_CFLAGS += -mcmodel=kernel
1348c2ecf20Sopenharmony_ciendif
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ciifdef CONFIG_X86_X32
1378c2ecf20Sopenharmony_ci	x32_ld_ok := $(call try-run,\
1388c2ecf20Sopenharmony_ci			/bin/echo -e '1: .quad 1b' | \
1398c2ecf20Sopenharmony_ci			$(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" - && \
1408c2ecf20Sopenharmony_ci			$(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
1418c2ecf20Sopenharmony_ci			$(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
1428c2ecf20Sopenharmony_ci        ifeq ($(x32_ld_ok),y)
1438c2ecf20Sopenharmony_ci                CONFIG_X86_X32_ABI := y
1448c2ecf20Sopenharmony_ci                KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
1458c2ecf20Sopenharmony_ci                KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
1468c2ecf20Sopenharmony_ci        else
1478c2ecf20Sopenharmony_ci                $(warning CONFIG_X86_X32 enabled but no binutils support)
1488c2ecf20Sopenharmony_ci        endif
1498c2ecf20Sopenharmony_ciendif
1508c2ecf20Sopenharmony_ciexport CONFIG_X86_X32_ABI
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#
1538c2ecf20Sopenharmony_ci# If the function graph tracer is used with mcount instead of fentry,
1548c2ecf20Sopenharmony_ci# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
1558c2ecf20Sopenharmony_ci# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
1568c2ecf20Sopenharmony_ci#
1578c2ecf20Sopenharmony_ciifdef CONFIG_FUNCTION_GRAPH_TRACER
1588c2ecf20Sopenharmony_ci  ifndef CONFIG_HAVE_FENTRY
1598c2ecf20Sopenharmony_ci	ACCUMULATE_OUTGOING_ARGS := 1
1608c2ecf20Sopenharmony_ci  else
1618c2ecf20Sopenharmony_ci    ifeq ($(call cc-option-yn, -mfentry), n)
1628c2ecf20Sopenharmony_ci	ACCUMULATE_OUTGOING_ARGS := 1
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci	# GCC ignores '-maccumulate-outgoing-args' when used with '-Os'.
1658c2ecf20Sopenharmony_ci	# If '-Os' is enabled, disable it and print a warning.
1668c2ecf20Sopenharmony_ci        ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
1678c2ecf20Sopenharmony_ci          undefine CONFIG_CC_OPTIMIZE_FOR_SIZE
1688c2ecf20Sopenharmony_ci          $(warning Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE.  Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER.)
1698c2ecf20Sopenharmony_ci        endif
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci    endif
1728c2ecf20Sopenharmony_ci  endif
1738c2ecf20Sopenharmony_ciendif
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ciifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
1768c2ecf20Sopenharmony_ci	# This compiler flag is not supported by Clang:
1778c2ecf20Sopenharmony_ci	KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
1788c2ecf20Sopenharmony_ciendif
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci# Workaround for a gcc prelease that unfortunately was shipped in a suse release
1818c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -Wno-sign-compare
1828c2ecf20Sopenharmony_ci#
1838c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -fno-asynchronous-unwind-tables
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci# Avoid indirect branches in kernel to deal with Spectre
1868c2ecf20Sopenharmony_ciifdef CONFIG_RETPOLINE
1878c2ecf20Sopenharmony_ci  KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
1888c2ecf20Sopenharmony_ci  # Additionally, avoid generating expensive indirect jumps which
1898c2ecf20Sopenharmony_ci  # are subject to retpolines for small number of switch cases.
1908c2ecf20Sopenharmony_ci  # clang turns off jump table generation by default when under
1918c2ecf20Sopenharmony_ci  # retpoline builds, however, gcc does not for x86. This has
1928c2ecf20Sopenharmony_ci  # only been fixed starting from gcc stable version 8.4.0 and
1938c2ecf20Sopenharmony_ci  # onwards, but not for older ones. See gcc bug #86952.
1948c2ecf20Sopenharmony_ci  ifndef CONFIG_CC_IS_CLANG
1958c2ecf20Sopenharmony_ci    KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables)
1968c2ecf20Sopenharmony_ci  endif
1978c2ecf20Sopenharmony_ciendif
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ciifdef CONFIG_SLS
2008c2ecf20Sopenharmony_ci  KBUILD_CFLAGS += -mharden-sls=all
2018c2ecf20Sopenharmony_ciendif
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ciKBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ciifdef CONFIG_X86_NEED_RELOCS
2068c2ecf20Sopenharmony_ciLDFLAGS_vmlinux := --emit-relocs --discard-none
2078c2ecf20Sopenharmony_cielse
2088c2ecf20Sopenharmony_ciLDFLAGS_vmlinux :=
2098c2ecf20Sopenharmony_ciendif
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci#
2128c2ecf20Sopenharmony_ci# The 64-bit kernel must be aligned to 2MB.  Pass -z max-page-size=0x200000 to
2138c2ecf20Sopenharmony_ci# the linker to force 2MB page size regardless of the default page size used
2148c2ecf20Sopenharmony_ci# by the linker.
2158c2ecf20Sopenharmony_ci#
2168c2ecf20Sopenharmony_ciifdef CONFIG_X86_64
2178c2ecf20Sopenharmony_ciLDFLAGS_vmlinux += -z max-page-size=0x200000
2188c2ecf20Sopenharmony_ciendif
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ciarchscripts: scripts_basic
2228c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=arch/x86/tools relocs
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci###
2258c2ecf20Sopenharmony_ci# Syscall table generation
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ciarchheaders:
2288c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci###
2318c2ecf20Sopenharmony_ci# Kernel objects
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_cihead-y := arch/x86/kernel/head_$(BITS).o
2348c2ecf20Sopenharmony_cihead-y += arch/x86/kernel/head$(BITS).o
2358c2ecf20Sopenharmony_cihead-y += arch/x86/kernel/ebda.o
2368c2ecf20Sopenharmony_cihead-y += arch/x86/kernel/platform-quirks.o
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_cilibs-y  += arch/x86/lib/
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci# See arch/x86/Kbuild for content of core part of the kernel
2418c2ecf20Sopenharmony_cicore-y += arch/x86/
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci# drivers-y are linked after core-y
2448c2ecf20Sopenharmony_cidrivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
2458c2ecf20Sopenharmony_cidrivers-$(CONFIG_PCI)            += arch/x86/pci/
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci# must be linked after kernel/
2488c2ecf20Sopenharmony_cidrivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci# suspend and hibernation support
2518c2ecf20Sopenharmony_cidrivers-$(CONFIG_PM) += arch/x86/power/
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_cidrivers-$(CONFIG_FB) += arch/x86/video/
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci####
2568c2ecf20Sopenharmony_ci# boot loader support. Several targets are kept for legacy purposes
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ciboot := arch/x86/boot
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ciBOOT_TARGETS = bzdisk fdimage fdimage144 fdimage288 isoimage
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ciPHONY += bzImage $(BOOT_TARGETS)
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci# Default kernel to build
2658c2ecf20Sopenharmony_ciall: bzImage
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci# KBUILD_IMAGE specify target image being built
2688c2ecf20Sopenharmony_ciKBUILD_IMAGE := $(boot)/bzImage
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_cibzImage: vmlinux
2718c2ecf20Sopenharmony_ciifeq ($(CONFIG_X86_DECODER_SELFTEST),y)
2728c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=arch/x86/tools posttest
2738c2ecf20Sopenharmony_ciendif
2748c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
2758c2ecf20Sopenharmony_ci	$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
2768c2ecf20Sopenharmony_ci	$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci$(BOOT_TARGETS): vmlinux
2798c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(boot) $@
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ciPHONY += install bzlilo
2828c2ecf20Sopenharmony_ciinstall bzlilo:
2838c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(boot) $@
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ciPHONY += vdso_install
2868c2ecf20Sopenharmony_civdso_install:
2878c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=arch/x86/entry/vdso $@
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ciarchprepare: checkbin
2908c2ecf20Sopenharmony_cicheckbin:
2918c2ecf20Sopenharmony_ciifndef CONFIG_CC_HAS_ASM_GOTO
2928c2ecf20Sopenharmony_ci	@echo Compiler lacks asm-goto support.
2938c2ecf20Sopenharmony_ci	@exit 1
2948c2ecf20Sopenharmony_ciendif
2958c2ecf20Sopenharmony_ciifdef CONFIG_RETPOLINE
2968c2ecf20Sopenharmony_ciifeq ($(RETPOLINE_CFLAGS),)
2978c2ecf20Sopenharmony_ci	@echo "You are building kernel with non-retpoline compiler." >&2
2988c2ecf20Sopenharmony_ci	@echo "Please update your compiler." >&2
2998c2ecf20Sopenharmony_ci	@false
3008c2ecf20Sopenharmony_ciendif
3018c2ecf20Sopenharmony_ciendif
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ciarchclean:
3048c2ecf20Sopenharmony_ci	$(Q)rm -rf $(objtree)/arch/i386
3058c2ecf20Sopenharmony_ci	$(Q)rm -rf $(objtree)/arch/x86_64
3068c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(clean)=$(boot)
3078c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(clean)=arch/x86/tools
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_cidefine archhelp
3108c2ecf20Sopenharmony_ci  echo  '* bzImage      - Compressed kernel image (arch/x86/boot/bzImage)'
3118c2ecf20Sopenharmony_ci  echo  '  install      - Install kernel using'
3128c2ecf20Sopenharmony_ci  echo  '                  (your) ~/bin/$(INSTALLKERNEL) or'
3138c2ecf20Sopenharmony_ci  echo  '                  (distribution) /sbin/$(INSTALLKERNEL) or'
3148c2ecf20Sopenharmony_ci  echo  '                  install to $$(INSTALL_PATH) and run lilo'
3158c2ecf20Sopenharmony_ci  echo  '  fdimage      - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
3168c2ecf20Sopenharmony_ci  echo  '  fdimage144   - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
3178c2ecf20Sopenharmony_ci  echo  '  fdimage288   - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)'
3188c2ecf20Sopenharmony_ci  echo  '  isoimage     - Create a boot CD-ROM image (arch/x86/boot/image.iso)'
3198c2ecf20Sopenharmony_ci  echo  '                  bzdisk/fdimage*/isoimage also accept:'
3208c2ecf20Sopenharmony_ci  echo  '                  FDARGS="..."  arguments for the booted kernel'
3218c2ecf20Sopenharmony_ci  echo  '                  FDINITRD=file initrd for the booted kernel'
3228c2ecf20Sopenharmony_ciendef
323