xref: /linux/arch/x86/Makefile (revision f82811e22b480a203a438d8e1f29af9c93ccbb0c)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
274b469f2SSam Ravnborg# Unified Makefile for i386 and x86_64
374b469f2SSam Ravnborg
42266cfd5SSam Ravnborg# select defconfig based on actual architecture
5d746d647SSam Ravnborgifeq ($(ARCH),x86)
6f9bb7f6aSArnd Bergmann  ifeq ($(shell uname -m | sed -e 's/i.86/i386/'),i386)
7d746d647SSam Ravnborg        KBUILD_DEFCONFIG := i386_defconfig
8f9bb7f6aSArnd Bergmann  else
9f9bb7f6aSArnd Bergmann        KBUILD_DEFCONFIG := x86_64_defconfig
10ffee0de4SDavid Woodhouse  endif
11d746d647SSam Ravnborgelse
122266cfd5SSam Ravnborg        KBUILD_DEFCONFIG := $(ARCH)_defconfig
13d746d647SSam Ravnborgendif
142266cfd5SSam Ravnborg
15b2f825bfSPeter Zijlstraifdef CONFIG_CC_IS_GCC
16b2f825bfSPeter ZijlstraRETPOLINE_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
17b2f825bfSPeter ZijlstraRETPOLINE_VDSO_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
18b2f825bfSPeter Zijlstraendif
19b2f825bfSPeter Zijlstraifdef CONFIG_CC_IS_CLANG
20b2f825bfSPeter ZijlstraRETPOLINE_CFLAGS	:= -mretpoline-external-thunk
21b2f825bfSPeter ZijlstraRETPOLINE_VDSO_CFLAGS	:= -mretpoline
22b2f825bfSPeter Zijlstraendif
2327b5de62SNathan ChancellorRETPOLINE_CFLAGS	+= $(call cc-option,-mindirect-branch-cs-prefix)
24f43b9876SPeter Zijlstra
25f43b9876SPeter Zijlstraifdef CONFIG_RETHUNK
26f43b9876SPeter ZijlstraRETHUNK_CFLAGS		:= -mfunction-return=thunk-extern
27f43b9876SPeter ZijlstraRETPOLINE_CFLAGS	+= $(RETHUNK_CFLAGS)
28f43b9876SPeter Zijlstraendif
29f43b9876SPeter Zijlstra
30efc72a66SJosh Poimboeufexport RETHUNK_CFLAGS
31b2f825bfSPeter Zijlstraexport RETPOLINE_CFLAGS
32b2f825bfSPeter Zijlstraexport RETPOLINE_VDSO_CFLAGS
33b2f825bfSPeter Zijlstra
34d77698dfSMatthias Kaehlcke# For gcc stack alignment is specified with -mpreferred-stack-boundary,
35d77698dfSMatthias Kaehlcke# clang has the option -mstack-alignment for that purpose.
36d77698dfSMatthias Kaehlckeifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
378f918697SMatthias Kaehlcke      cc_stack_align4 := -mpreferred-stack-boundary=2
388f918697SMatthias Kaehlcke      cc_stack_align8 := -mpreferred-stack-boundary=3
398f918697SMatthias Kaehlckeelse ifneq ($(call cc-option, -mstack-alignment=16),)
408f918697SMatthias Kaehlcke      cc_stack_align4 := -mstack-alignment=4
418f918697SMatthias Kaehlcke      cc_stack_align8 := -mstack-alignment=8
42d77698dfSMatthias Kaehlckeendif
43d77698dfSMatthias Kaehlcke
441c678da3SDavid Woodhouse# How to compile the 16-bit code.  Note we always compile for -march=i386;
451c678da3SDavid Woodhouse# that way we can complain to the user if the CPU is insufficient.
46b3bee1e7SAlexey DobriyanREALMODE_CFLAGS	:= -std=gnu11 -m16 -g -Os -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \
471c678da3SDavid Woodhouse		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
481c678da3SDavid Woodhouse		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
499fcb51c1SArnd Bergmann		   -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)
50032a2c4fSMatthias Kaehlcke
51685969e0SMasahiro YamadaREALMODE_CFLAGS += -ffreestanding
52893ab004SMasahiro YamadaREALMODE_CFLAGS += -fno-stack-protector
53989ceac7SNick DesaulniersREALMODE_CFLAGS += -Wno-address-of-packed-member
54989ceac7SNick DesaulniersREALMODE_CFLAGS += $(cc_stack_align4)
558abe7fc2SJohn MillikinREALMODE_CFLAGS += $(CLANG_FLAGS)
561c678da3SDavid Woodhouseexport REALMODE_CFLAGS
571c678da3SDavid Woodhouse
580a6ef376SSam Ravnborg# BITS is used as extension for files which are available in a 32 bit
590a6ef376SSam Ravnborg# and a 64 bit version to simplify shared Makefiles.
600a6ef376SSam Ravnborg# e.g.: obj-y += foo_$(BITS).o
610a6ef376SSam Ravnborgexport BITS
6274b469f2SSam Ravnborg
63b2c51106SAndy Lutomirski#
64b2c51106SAndy Lutomirski# Prevent GCC from generating any FP code by mistake.
65b2c51106SAndy Lutomirski#
66b2c51106SAndy Lutomirski# This must happen before we try the -mpreferred-stack-boundary, see:
67b2c51106SAndy Lutomirski#
68b2c51106SAndy Lutomirski#    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
69b2c51106SAndy Lutomirski#
70989ceac7SNick DesaulniersKBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
71*f82811e2SJamie CunliffeKBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
7209498135SMiguel OjedaKBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
73b2c51106SAndy Lutomirski
74156ff4a5SPeter Zijlstraifeq ($(CONFIG_X86_KERNEL_IBT),y)
75156ff4a5SPeter Zijlstra#
76156ff4a5SPeter Zijlstra# Kernel IBT has S_CET.NOTRACK_EN=0, as such the compilers must not generate
77156ff4a5SPeter Zijlstra# NOTRACK prefixes. Current generation compilers unconditionally employ NOTRACK
78156ff4a5SPeter Zijlstra# for jump-tables, as such, disable jump-tables for now.
79156ff4a5SPeter Zijlstra#
80156ff4a5SPeter Zijlstra# (jump-tables are implicitly disabled by RETPOLINE)
81156ff4a5SPeter Zijlstra#
82156ff4a5SPeter Zijlstra#   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104816
83156ff4a5SPeter Zijlstra#
84156ff4a5SPeter ZijlstraKBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables)
856a5c032cSMatthew MaurerKBUILD_RUSTFLAGS += -Zcf-protection=branch -Zno-jump-tables
86156ff4a5SPeter Zijlstraelse
87256b92afSBorislav PetkovKBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
88156ff4a5SPeter Zijlstraendif
89256b92afSBorislav Petkov
90d746d647SSam Ravnborgifeq ($(CONFIG_X86_32),y)
910a6ef376SSam Ravnborg        BITS := 32
928c6531f7SAndreas Herrmann        UTS_MACHINE := i386
934ba7e5cdSSam Ravnborg        CHECKFLAGS += -D__i386__
940a6ef376SSam Ravnborg
95989ceac7SNick Desaulniers        KBUILD_AFLAGS += -m32
96989ceac7SNick Desaulniers        KBUILD_CFLAGS += -m32
970a6ef376SSam Ravnborg
980a6ef376SSam Ravnborg        KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
990a6ef376SSam Ravnborg
100484d90eeSAndrew Boie        # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
101484d90eeSAndrew Boie        # with nonstandard options
102484d90eeSAndrew Boie        KBUILD_CFLAGS += -fno-pic
103484d90eeSAndrew Boie
104d77698dfSMatthias Kaehlcke        # Align the stack to the register width instead of using the default
105d77698dfSMatthias Kaehlcke        # alignment of 16 bytes. This reduces stack usage and the number of
106d77698dfSMatthias Kaehlcke        # alignment instructions.
107989ceac7SNick Desaulniers        KBUILD_CFLAGS += $(cc_stack_align4)
1080a6ef376SSam Ravnborg
1090a6ef376SSam Ravnborg        # CPU-specific tuning. Anything which can be shared with UML should go here.
110d8285639SMasahiro Yamada        include $(srctree)/arch/x86/Makefile_32.cpu
1110a6ef376SSam Ravnborg        KBUILD_CFLAGS += $(cflags-y)
1120a6ef376SSam Ravnborg
1130a6ef376SSam Ravnborg        # temporary until string.h is fixed
1140a6ef376SSam Ravnborg        KBUILD_CFLAGS += -ffreestanding
1153fb0fdb3SAndy Lutomirski
1163fb0fdb3SAndy Lutomirski        ifeq ($(CONFIG_STACKPROTECTOR),y)
1173fb0fdb3SAndy Lutomirski                ifeq ($(CONFIG_SMP),y)
1183fb0fdb3SAndy Lutomirski			KBUILD_CFLAGS += -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard
1193fb0fdb3SAndy Lutomirski                else
1203fb0fdb3SAndy Lutomirski			KBUILD_CFLAGS += -mstack-protector-guard=global
1213fb0fdb3SAndy Lutomirski                endif
1223fb0fdb3SAndy Lutomirski        endif
1230a6ef376SSam Ravnborgelse
1240a6ef376SSam Ravnborg        BITS := 64
1250a6ef376SSam Ravnborg        UTS_MACHINE := x86_64
1261f2f01b1SLuc Van Oostenryck        CHECKFLAGS += -D__x86_64__
1270a6ef376SSam Ravnborg
1280a6ef376SSam Ravnborg        KBUILD_AFLAGS += -m64
1290a6ef376SSam Ravnborg        KBUILD_CFLAGS += -m64
1300a6ef376SSam Ravnborg
131be6cb027SIngo Molnar        # Align jump targets to 1 byte, not the default 16 bytes:
1322c4fd1acSMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
133be6cb027SIngo Molnar
13452648e83SIngo Molnar        # Pack loops tightly as well:
1352c4fd1acSMatthias Kaehlcke        KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
13652648e83SIngo Molnar
1375c630089SRasmus Villemoes        # Don't autogenerate traditional x87 instructions
138989ceac7SNick Desaulniers        KBUILD_CFLAGS += -mno-80387
1398f2dd677SBehan Webster        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
1405551a34eSH. Peter Anvin
141d77698dfSMatthias Kaehlcke        # By default gcc and clang use a stack alignment of 16 bytes for x86.
142d77698dfSMatthias Kaehlcke        # However the standard kernel entry on x86-64 leaves the stack on an
143d77698dfSMatthias Kaehlcke        # 8-byte boundary. If the compiler isn't informed about the actual
144d77698dfSMatthias Kaehlcke        # alignment it will generate extra alignment instructions for the
145d77698dfSMatthias Kaehlcke        # default alignment which keep the stack *mis*aligned.
146d77698dfSMatthias Kaehlcke        # Furthermore an alignment to the register width reduces stack usage
147d77698dfSMatthias Kaehlcke        # and the number of alignment instructions.
148989ceac7SNick Desaulniers        KBUILD_CFLAGS += $(cc_stack_align8)
149d9b0cde9SH.J. Lu
150d9ee948dSH.J. Lu	# Use -mskip-rax-setup if supported.
151d9ee948dSH.J. Lu	KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
152d9ee948dSH.J. Lu
1530a6ef376SSam Ravnborg        # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
154989ceac7SNick Desaulniers        cflags-$(CONFIG_MK8)		+= -march=k8
155989ceac7SNick Desaulniers        cflags-$(CONFIG_MPSC)		+= -march=nocona
156989ceac7SNick Desaulniers        cflags-$(CONFIG_MCORE2)		+= -march=core2
157989ceac7SNick Desaulniers        cflags-$(CONFIG_MATOM)		+= -march=atom
158989ceac7SNick Desaulniers        cflags-$(CONFIG_GENERIC_CPU)	+= -mtune=generic
1590a6ef376SSam Ravnborg        KBUILD_CFLAGS += $(cflags-y)
1600a6ef376SSam Ravnborg
16109498135SMiguel Ojeda        rustflags-$(CONFIG_MK8)		+= -Ctarget-cpu=k8
16209498135SMiguel Ojeda        rustflags-$(CONFIG_MPSC)	+= -Ctarget-cpu=nocona
16309498135SMiguel Ojeda        rustflags-$(CONFIG_MCORE2)	+= -Ctarget-cpu=core2
16409498135SMiguel Ojeda        rustflags-$(CONFIG_MATOM)	+= -Ctarget-cpu=atom
16509498135SMiguel Ojeda        rustflags-$(CONFIG_GENERIC_CPU)	+= -Ztune-cpu=generic
16609498135SMiguel Ojeda        KBUILD_RUSTFLAGS += $(rustflags-y)
16709498135SMiguel Ojeda
1680a6ef376SSam Ravnborg        KBUILD_CFLAGS += -mno-red-zone
1690a6ef376SSam Ravnborg        KBUILD_CFLAGS += -mcmodel=kernel
17009498135SMiguel Ojeda        KBUILD_RUSTFLAGS += -Cno-redzone=y
17109498135SMiguel Ojeda        KBUILD_RUSTFLAGS += -Ccode-model=kernel
1725d707e9cSTejun Heoendif
1730a6ef376SSam Ravnborg
1743f135e57SJosh Poimboeuf#
1753f135e57SJosh Poimboeuf# If the function graph tracer is used with mcount instead of fentry,
1763f135e57SJosh Poimboeuf# '-maccumulate-outgoing-args' is needed to prevent a GCC bug
1773f135e57SJosh Poimboeuf# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109)
1783f135e57SJosh Poimboeuf#
1793f135e57SJosh Poimboeufifdef CONFIG_FUNCTION_GRAPH_TRACER
1803f135e57SJosh Poimboeuf  ifndef CONFIG_HAVE_FENTRY
1813f135e57SJosh Poimboeuf	ACCUMULATE_OUTGOING_ARGS := 1
1823f135e57SJosh Poimboeuf  endif
1833f135e57SJosh Poimboeufendif
1843f135e57SJosh Poimboeuf
1853f135e57SJosh Poimboeufifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
1864a1bec46SNick Desaulniers	# This compiler flag is not supported by Clang:
1874a1bec46SNick Desaulniers	KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
1883f135e57SJosh Poimboeufendif
1893f135e57SJosh Poimboeuf
19025dfeeb7SSam Ravnborg# Workaround for a gcc prelease that unfortunately was shipped in a suse release
19125dfeeb7SSam RavnborgKBUILD_CFLAGS += -Wno-sign-compare
19225dfeeb7SSam Ravnborg#
19325dfeeb7SSam RavnborgKBUILD_CFLAGS += -fno-asynchronous-unwind-tables
1940a6ef376SSam Ravnborg
19576b04384SDavid Woodhouse# Avoid indirect branches in kernel to deal with Spectre
19676b04384SDavid Woodhouseifdef CONFIG_RETPOLINE
1974cd24de3SZhenzhong Duan  KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
198ce02ef06SDaniel Borkmann  # Additionally, avoid generating expensive indirect jumps which
199ce02ef06SDaniel Borkmann  # are subject to retpolines for small number of switch cases.
200ce02ef06SDaniel Borkmann  # clang turns off jump table generation by default when under
201a9d57ef1SDaniel Borkmann  # retpoline builds, however, gcc does not for x86. This has
202a9d57ef1SDaniel Borkmann  # only been fixed starting from gcc stable version 8.4.0 and
203a9d57ef1SDaniel Borkmann  # onwards, but not for older ones. See gcc bug #86952.
204a9d57ef1SDaniel Borkmann  ifndef CONFIG_CC_IS_CLANG
205989ceac7SNick Desaulniers    KBUILD_CFLAGS += -fno-jump-tables
206a9d57ef1SDaniel Borkmann  endif
20776b04384SDavid Woodhouseendif
20876b04384SDavid Woodhouse
209e463a09aSPeter Zijlstraifdef CONFIG_SLS
210e463a09aSPeter Zijlstra  KBUILD_CFLAGS += -mharden-sls=all
211e463a09aSPeter Zijlstraendif
212e463a09aSPeter Zijlstra
213931ab636SPeter Zijlstraifdef CONFIG_CALL_PADDING
214bea75b33SThomas GleixnerPADDING_CFLAGS := -fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES)
215bea75b33SThomas GleixnerKBUILD_CFLAGS += $(PADDING_CFLAGS)
216bea75b33SThomas Gleixnerexport PADDING_CFLAGS
217bea75b33SThomas Gleixnerendif
218bea75b33SThomas Gleixner
2190024430eSNathan ChancellorKBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
2200024430eSNathan Chancellor
2210024430eSNathan Chancellorifdef CONFIG_LTO_CLANG
222fccb3d3eSMasahiro Yamadaifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000),y)
2232398ce80STor VicKBUILD_LDFLAGS	+= -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8)
2242398ce80STor Vicendif
2250024430eSNathan Chancellorendif
226587af649SArvind Sankar
227587af649SArvind Sankarifdef CONFIG_X86_NEED_RELOCS
228587af649SArvind SankarLDFLAGS_vmlinux := --emit-relocs --discard-none
229587af649SArvind Sankarelse
230587af649SArvind SankarLDFLAGS_vmlinux :=
231587af649SArvind Sankarendif
232587af649SArvind Sankar
233587af649SArvind Sankar#
234587af649SArvind Sankar# The 64-bit kernel must be aligned to 2MB.  Pass -z max-page-size=0x200000 to
235587af649SArvind Sankar# the linker to force 2MB page size regardless of the default page size used
236587af649SArvind Sankar# by the linker.
237587af649SArvind Sankar#
238587af649SArvind Sankarifdef CONFIG_X86_64
239587af649SArvind SankarLDFLAGS_vmlinux += -z max-page-size=0x200000
240587af649SArvind Sankarendif
241587af649SArvind Sankar
24283109d5dSKees Cook
2433ce9e53eSMichal Marekarchscripts: scripts_basic
2446520fe55SH. Peter Anvin	$(Q)$(MAKE) $(build)=arch/x86/tools relocs
2456520fe55SH. Peter Anvin
2460a6ef376SSam Ravnborg###
247303395acSH. Peter Anvin# Syscall table generation
248303395acSH. Peter Anvin
249303395acSH. Peter Anvinarchheaders:
2501f57d5d8SIngo Molnar	$(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
251303395acSH. Peter Anvin
252303395acSH. Peter Anvin###
2530a6ef376SSam Ravnborg# Kernel objects
2540a6ef376SSam Ravnborg
2550a6ef376SSam Ravnborglibs-y  += arch/x86/lib/
2560a6ef376SSam Ravnborg
257c33621b4SKai Huangcore-y += arch/x86/virt/
258c33621b4SKai Huang
2590a6ef376SSam Ravnborg# drivers-y are linked after core-y
2600a6ef376SSam Ravnborgdrivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
2610a6ef376SSam Ravnborgdrivers-$(CONFIG_PCI)            += arch/x86/pci/
2620a6ef376SSam Ravnborg
263cf7700feSRafael J. Wysocki# suspend and hibernation support
2640a6ef376SSam Ravnborgdrivers-$(CONFIG_PM) += arch/x86/power/
265cf7700feSRafael J. Wysocki
26655bffc81SJavier Martinez Canillasdrivers-$(CONFIG_FB_CORE) += arch/x86/video/
2670a6ef376SSam Ravnborg
2680a6ef376SSam Ravnborg####
2690a6ef376SSam Ravnborg# boot loader support. Several targets are kept for legacy purposes
2700a6ef376SSam Ravnborg
2710a6ef376SSam Ravnborgboot := arch/x86/boot
2720a6ef376SSam Ravnborg
273f279b49fSH. Peter Anvin (Intel)BOOT_TARGETS = bzdisk fdimage fdimage144 fdimage288 hdimage isoimage
274f9c5107cSH. Peter Anvin
275f9c5107cSH. Peter AnvinPHONY += bzImage $(BOOT_TARGETS)
2760a6ef376SSam Ravnborg
2770a6ef376SSam Ravnborg# Default kernel to build
2780a6ef376SSam Ravnborgall: bzImage
2790a6ef376SSam Ravnborg
2800a6ef376SSam Ravnborg# KBUILD_IMAGE specify target image being built
2810a6ef376SSam RavnborgKBUILD_IMAGE := $(boot)/bzImage
2820a6ef376SSam Ravnborg
283f9c5107cSH. Peter AnvinbzImage: vmlinux
284ca0e9badSMasami Hiramatsuifeq ($(CONFIG_X86_DECODER_SELFTEST),y)
285ca0e9badSMasami Hiramatsu	$(Q)$(MAKE) $(build)=arch/x86/tools posttest
286ca0e9badSMasami Hiramatsuendif
2870a6ef376SSam Ravnborg	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
2880a6ef376SSam Ravnborg	$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
28941b3eae6SJan Beulich	$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
2900a6ef376SSam Ravnborg
291f9c5107cSH. Peter Anvin$(BOOT_TARGETS): vmlinux
292f9c5107cSH. Peter Anvin	$(Q)$(MAKE) $(build)=$(boot) $@
2930a6ef376SSam Ravnborg
2946d61b8e6SMasahiro YamadaPHONY += install
2956d61b8e6SMasahiro Yamadainstall:
296f774f5bbSMasahiro Yamada	$(call cmd,install)
2971648e4f8SH. Peter Anvin
29856769ba4SMasahiro Yamadavdso-install-$(CONFIG_X86_64)		+= arch/x86/entry/vdso/vdso64.so.dbg
29956769ba4SMasahiro Yamadavdso-install-$(CONFIG_X86_X32_ABI)	+= arch/x86/entry/vdso/vdsox32.so.dbg
30056769ba4SMasahiro Yamadavdso-install-$(CONFIG_X86_32)		+= arch/x86/entry/vdso/vdso32.so.dbg
30156769ba4SMasahiro Yamadavdso-install-$(CONFIG_IA32_EMULATION)	+= arch/x86/entry/vdso/vdso32.so.dbg
3020a6ef376SSam Ravnborg
303829fe4aaSBen Hutchingsarchprepare: checkbin
304829fe4aaSBen Hutchingscheckbin:
30525896d07SMasahiro Yamadaifdef CONFIG_RETPOLINE
30625896d07SMasahiro Yamadaifeq ($(RETPOLINE_CFLAGS),)
30725896d07SMasahiro Yamada	@echo "You are building kernel with non-retpoline compiler." >&2
30825896d07SMasahiro Yamada	@echo "Please update your compiler." >&2
30925896d07SMasahiro Yamada	@false
31025896d07SMasahiro Yamadaendif
31125896d07SMasahiro Yamadaendif
312829fe4aaSBen Hutchings
313b9f174c8SOmar Sandovalifdef CONFIG_UNWINDER_ORC
314b9f174c8SOmar Sandovalorc_hash_h := arch/$(SRCARCH)/include/generated/asm/orc_hash.h
315b9f174c8SOmar Sandovalorc_hash_sh := $(srctree)/scripts/orc_hash.sh
316b9f174c8SOmar Sandovaltargets += $(orc_hash_h)
317b9f174c8SOmar Sandovalquiet_cmd_orc_hash = GEN     $@
318b9f174c8SOmar Sandoval      cmd_orc_hash = mkdir -p $(dir $@); \
319b9f174c8SOmar Sandoval		     $(CONFIG_SHELL) $(orc_hash_sh) < $< > $@
320b9f174c8SOmar Sandoval$(orc_hash_h): $(srctree)/arch/x86/include/asm/orc_types.h $(orc_hash_sh) FORCE
321b9f174c8SOmar Sandoval	$(call if_changed,orc_hash)
322b9f174c8SOmar Sandovalarchprepare: $(orc_hash_h)
323b9f174c8SOmar Sandovalendif
324b9f174c8SOmar Sandoval
3250a6ef376SSam Ravnborgarchclean:
3260a6ef376SSam Ravnborg	$(Q)rm -rf $(objtree)/arch/i386
3270a6ef376SSam Ravnborg	$(Q)rm -rf $(objtree)/arch/x86_64
3280a6ef376SSam Ravnborg
3290a6ef376SSam Ravnborgdefine archhelp
3300a6ef376SSam Ravnborg  echo  '* bzImage		- Compressed kernel image (arch/x86/boot/bzImage)'
331ac5d0887SBorislav Petkov  echo  '  install		- Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
332ac5d0887SBorislav Petkov  echo  '			  (distribution) /sbin/$(INSTALLKERNEL) or install to '
333ac5d0887SBorislav Petkov  echo  '			  $$(INSTALL_PATH) and run lilo'
334ac5d0887SBorislav Petkov  echo  ''
33537f30e21SAndi Kleen  echo  '  fdimage		- Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
33637f30e21SAndi Kleen  echo  '  fdimage144		- Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
33737f30e21SAndi Kleen  echo  '  fdimage288		- Create 2.8MB boot floppy image (arch/x86/boot/fdimage)'
338f279b49fSH. Peter Anvin (Intel)  echo  '  hdimage		- Create a BIOS/EFI hard disk image (arch/x86/boot/hdimage)'
33937f30e21SAndi Kleen  echo  '  isoimage		- Create a boot CD-ROM image (arch/x86/boot/image.iso)'
340f279b49fSH. Peter Anvin (Intel)  echo  '			  bzdisk/fdimage*/hdimage/isoimage also accept:'
34137f30e21SAndi Kleen  echo  '			  FDARGS="..."  arguments for the booted kernel'
34237f30e21SAndi Kleen  echo  '			  FDINITRD=file initrd for the booted kernel'
343fbaf0aa8SBorislav Petkov
3440a6ef376SSam Ravnborgendef
345