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 165d6d30ecSNathan ChancellorRETPOLINE_CFLAGS := -mindirect-branch=thunk-extern -mindirect-branch-register 175d6d30ecSNathan ChancellorRETPOLINE_VDSO_CFLAGS := -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 250911b8c5SBreno Leitaoifdef CONFIG_MITIGATION_RETHUNK 26f43b9876SPeter ZijlstraRETHUNK_CFLAGS := -mfunction-return=thunk-extern 27d7868550SMiguel OjedaRETHUNK_RUSTFLAGS := -Zfunction-return=thunk-extern 28f43b9876SPeter ZijlstraRETPOLINE_CFLAGS += $(RETHUNK_CFLAGS) 29d7868550SMiguel OjedaRETPOLINE_RUSTFLAGS += $(RETHUNK_RUSTFLAGS) 30f43b9876SPeter Zijlstraendif 31f43b9876SPeter Zijlstra 32efc72a66SJosh Poimboeufexport RETHUNK_CFLAGS 33d7868550SMiguel Ojedaexport RETHUNK_RUSTFLAGS 34b2f825bfSPeter Zijlstraexport RETPOLINE_CFLAGS 35d7868550SMiguel Ojedaexport RETPOLINE_RUSTFLAGS 36b2f825bfSPeter Zijlstraexport RETPOLINE_VDSO_CFLAGS 37b2f825bfSPeter Zijlstra 38d77698dfSMatthias Kaehlcke# For gcc stack alignment is specified with -mpreferred-stack-boundary, 39d77698dfSMatthias Kaehlcke# clang has the option -mstack-alignment for that purpose. 40d8720812SNathan Chancellorifdef CONFIG_CC_IS_GCC 418f918697SMatthias Kaehlcke cc_stack_align4 := -mpreferred-stack-boundary=2 428f918697SMatthias Kaehlcke cc_stack_align8 := -mpreferred-stack-boundary=3 43d8720812SNathan Chancellorendif 44d8720812SNathan Chancellorifdef CONFIG_CC_IS_CLANG 458f918697SMatthias Kaehlcke cc_stack_align4 := -mstack-alignment=4 468f918697SMatthias Kaehlcke cc_stack_align8 := -mstack-alignment=8 47d77698dfSMatthias Kaehlckeendif 48d77698dfSMatthias Kaehlcke 491c678da3SDavid Woodhouse# How to compile the 16-bit code. Note we always compile for -march=i386; 501c678da3SDavid Woodhouse# that way we can complain to the user if the CPU is insufficient. 51*5ff8ad39SNathan ChancellorREALMODE_CFLAGS := -std=gnu11 -fms-extensions -m16 -g -Os \ 52*5ff8ad39SNathan Chancellor -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \ 531c678da3SDavid Woodhouse -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ 541c678da3SDavid Woodhouse -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ 559fcb51c1SArnd Bergmann -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none) 56032a2c4fSMatthias Kaehlcke 57685969e0SMasahiro YamadaREALMODE_CFLAGS += -ffreestanding 58893ab004SMasahiro YamadaREALMODE_CFLAGS += -fno-stack-protector 59989ceac7SNick DesaulniersREALMODE_CFLAGS += -Wno-address-of-packed-member 60989ceac7SNick DesaulniersREALMODE_CFLAGS += $(cc_stack_align4) 618abe7fc2SJohn MillikinREALMODE_CFLAGS += $(CLANG_FLAGS) 622afa7994SThomas Zimmermannifdef CONFIG_CC_IS_CLANG 632afa7994SThomas ZimmermannREALMODE_CFLAGS += -Wno-gnu 64*5ff8ad39SNathan ChancellorREALMODE_CFLAGS += -Wno-microsoft-anon-tag 652afa7994SThomas Zimmermannendif 661c678da3SDavid Woodhouseexport REALMODE_CFLAGS 671c678da3SDavid Woodhouse 680a6ef376SSam Ravnborg# BITS is used as extension for files which are available in a 32 bit 690a6ef376SSam Ravnborg# and a 64 bit version to simplify shared Makefiles. 700a6ef376SSam Ravnborg# e.g.: obj-y += foo_$(BITS).o 710a6ef376SSam Ravnborgexport BITS 7274b469f2SSam Ravnborg 73b2c51106SAndy Lutomirski# 74b2c51106SAndy Lutomirski# Prevent GCC from generating any FP code by mistake. 75b2c51106SAndy Lutomirski# 76b2c51106SAndy Lutomirski# This must happen before we try the -mpreferred-stack-boundary, see: 77b2c51106SAndy Lutomirski# 78b2c51106SAndy Lutomirski# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 79b2c51106SAndy Lutomirski# 800d6e9ec8SPeter ZijlstraKBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a 81f82811e2SJamie CunliffeKBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json 8209498135SMiguel OjedaKBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 83b2c51106SAndy Lutomirski 84b0b8a15bSSamuel Holland# 85b0b8a15bSSamuel Holland# CFLAGS for compiling floating point code inside the kernel. 86b0b8a15bSSamuel Holland# 87b0b8a15bSSamuel HollandCC_FLAGS_FPU := -msse -msse2 88b0b8a15bSSamuel Hollandifdef CONFIG_CC_IS_GCC 89b0b8a15bSSamuel HollandCC_FLAGS_FPU += -mhard-float 90b0b8a15bSSamuel Hollandendif 91b0b8a15bSSamuel Holland 92156ff4a5SPeter Zijlstraifeq ($(CONFIG_X86_KERNEL_IBT),y) 93156ff4a5SPeter Zijlstra# 94156ff4a5SPeter Zijlstra# Kernel IBT has S_CET.NOTRACK_EN=0, as such the compilers must not generate 95156ff4a5SPeter Zijlstra# NOTRACK prefixes. Current generation compilers unconditionally employ NOTRACK 96156ff4a5SPeter Zijlstra# for jump-tables, as such, disable jump-tables for now. 97156ff4a5SPeter Zijlstra# 98156ff4a5SPeter Zijlstra# (jump-tables are implicitly disabled by RETPOLINE) 99156ff4a5SPeter Zijlstra# 100156ff4a5SPeter Zijlstra# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104816 101156ff4a5SPeter Zijlstra# 102156ff4a5SPeter ZijlstraKBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables) 103789521b4SMiguel OjedaKBUILD_RUSTFLAGS += -Zcf-protection=branch $(if $(call rustc-min-version,109300),-Cjump-tables=n,-Zno-jump-tables) 104156ff4a5SPeter Zijlstraelse 105256b92afSBorislav PetkovKBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 106156ff4a5SPeter Zijlstraendif 107256b92afSBorislav Petkov 108d746d647SSam Ravnborgifeq ($(CONFIG_X86_32),y) 1090a6ef376SSam Ravnborg BITS := 32 1108c6531f7SAndreas Herrmann UTS_MACHINE := i386 1114ba7e5cdSSam Ravnborg CHECKFLAGS += -D__i386__ 1120a6ef376SSam Ravnborg 113989ceac7SNick Desaulniers KBUILD_AFLAGS += -m32 114989ceac7SNick Desaulniers KBUILD_CFLAGS += -m32 1150a6ef376SSam Ravnborg 1160a6ef376SSam Ravnborg KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return 1170a6ef376SSam Ravnborg 118484d90eeSAndrew Boie # Never want PIC in a 32-bit kernel, prevent breakage with GCC built 119484d90eeSAndrew Boie # with nonstandard options 120484d90eeSAndrew Boie KBUILD_CFLAGS += -fno-pic 121484d90eeSAndrew Boie 122d77698dfSMatthias Kaehlcke # Align the stack to the register width instead of using the default 123d77698dfSMatthias Kaehlcke # alignment of 16 bytes. This reduces stack usage and the number of 124d77698dfSMatthias Kaehlcke # alignment instructions. 125989ceac7SNick Desaulniers KBUILD_CFLAGS += $(cc_stack_align4) 1260a6ef376SSam Ravnborg 1270a6ef376SSam Ravnborg # CPU-specific tuning. Anything which can be shared with UML should go here. 128d8285639SMasahiro Yamada include $(srctree)/arch/x86/Makefile_32.cpu 1290a6ef376SSam Ravnborg KBUILD_CFLAGS += $(cflags-y) 1300a6ef376SSam Ravnborg 131d70da124SKees Cook ifneq ($(call clang-min-version, 160000),y) 13216cb16e0SKees Cook # https://github.com/llvm/llvm-project/issues/53645 1330a6ef376SSam Ravnborg KBUILD_CFLAGS += -ffreestanding 13416cb16e0SKees Cook endif 1353fb0fdb3SAndy Lutomirski 13680d47defSBrian Gerst percpu_seg := fs 1370a6ef376SSam Ravnborgelse 1380a6ef376SSam Ravnborg BITS := 64 1390a6ef376SSam Ravnborg UTS_MACHINE := x86_64 1401f2f01b1SLuc Van Oostenryck CHECKFLAGS += -D__x86_64__ 1410a6ef376SSam Ravnborg 1420a6ef376SSam Ravnborg KBUILD_AFLAGS += -m64 1430a6ef376SSam Ravnborg KBUILD_CFLAGS += -m64 1440a6ef376SSam Ravnborg 145be6cb027SIngo Molnar # Align jump targets to 1 byte, not the default 16 bytes: 1462c4fd1acSMatthias Kaehlcke KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1) 147be6cb027SIngo Molnar 14852648e83SIngo Molnar # Pack loops tightly as well: 1492c4fd1acSMatthias Kaehlcke KBUILD_CFLAGS += $(call cc-option,-falign-loops=1) 15052648e83SIngo Molnar 1515c630089SRasmus Villemoes # Don't autogenerate traditional x87 instructions 152989ceac7SNick Desaulniers KBUILD_CFLAGS += -mno-80387 1530a42d732SNathan Chancellor KBUILD_CFLAGS += -mno-fp-ret-in-387 1545551a34eSH. Peter Anvin 155d77698dfSMatthias Kaehlcke # By default gcc and clang use a stack alignment of 16 bytes for x86. 156d77698dfSMatthias Kaehlcke # However the standard kernel entry on x86-64 leaves the stack on an 157d77698dfSMatthias Kaehlcke # 8-byte boundary. If the compiler isn't informed about the actual 158d77698dfSMatthias Kaehlcke # alignment it will generate extra alignment instructions for the 159d77698dfSMatthias Kaehlcke # default alignment which keep the stack *mis*aligned. 160d77698dfSMatthias Kaehlcke # Furthermore an alignment to the register width reduces stack usage 161d77698dfSMatthias Kaehlcke # and the number of alignment instructions. 162989ceac7SNick Desaulniers KBUILD_CFLAGS += $(cc_stack_align8) 163d9b0cde9SH.J. Lu 164d9ee948dSH.J. Lu # Use -mskip-rax-setup if supported. 165337927d9SNathan Chancellor KBUILD_CFLAGS += -mskip-rax-setup 166d9ee948dSH.J. Lu 167ea1dcca1STor Vicifdef CONFIG_X86_NATIVE_CPU 168ea1dcca1STor Vic KBUILD_CFLAGS += -march=native 169ea1dcca1STor Vic KBUILD_RUSTFLAGS += -Ctarget-cpu=native 170ea1dcca1STor Vicelse 171f388f60cSArnd Bergmann KBUILD_CFLAGS += -march=x86-64 -mtune=generic 172f388f60cSArnd Bergmann KBUILD_RUSTFLAGS += -Ctarget-cpu=x86-64 -Ztune-cpu=generic 173ea1dcca1STor Vicendif 17409498135SMiguel Ojeda 1750a6ef376SSam Ravnborg KBUILD_CFLAGS += -mno-red-zone 1760a6ef376SSam Ravnborg KBUILD_CFLAGS += -mcmodel=kernel 17709498135SMiguel Ojeda KBUILD_RUSTFLAGS += -Cno-redzone=y 17809498135SMiguel Ojeda KBUILD_RUSTFLAGS += -Ccode-model=kernel 17980d47defSBrian Gerst 18080d47defSBrian Gerst percpu_seg := gs 18180d47defSBrian Gerstendif 18280d47defSBrian Gerst 18380d47defSBrian Gerstifeq ($(CONFIG_STACKPROTECTOR),y) 18480d47defSBrian Gerst ifeq ($(CONFIG_SMP),y) 18580d47defSBrian Gerst KBUILD_CFLAGS += -mstack-protector-guard-reg=$(percpu_seg) 18680d47defSBrian Gerst KBUILD_CFLAGS += -mstack-protector-guard-symbol=__ref_stack_chk_guard 18780d47defSBrian Gerst else 18880d47defSBrian Gerst KBUILD_CFLAGS += -mstack-protector-guard=global 18980d47defSBrian Gerst endif 1905d707e9cSTejun Heoendif 1910a6ef376SSam Ravnborg 1923f135e57SJosh Poimboeuf# 1933f135e57SJosh Poimboeuf# If the function graph tracer is used with mcount instead of fentry, 1943f135e57SJosh Poimboeuf# '-maccumulate-outgoing-args' is needed to prevent a GCC bug 1953f135e57SJosh Poimboeuf# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109) 1963f135e57SJosh Poimboeuf# 1973f135e57SJosh Poimboeufifdef CONFIG_FUNCTION_GRAPH_TRACER 1983f135e57SJosh Poimboeuf ifndef CONFIG_HAVE_FENTRY 1993f135e57SJosh Poimboeuf ACCUMULATE_OUTGOING_ARGS := 1 2003f135e57SJosh Poimboeuf endif 2013f135e57SJosh Poimboeufendif 2023f135e57SJosh Poimboeuf 2033f135e57SJosh Poimboeufifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) 2044a1bec46SNick Desaulniers # This compiler flag is not supported by Clang: 2054a1bec46SNick Desaulniers KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,) 2063f135e57SJosh Poimboeufendif 2073f135e57SJosh Poimboeuf 20825dfeeb7SSam Ravnborg# Workaround for a gcc prelease that unfortunately was shipped in a suse release 20925dfeeb7SSam RavnborgKBUILD_CFLAGS += -Wno-sign-compare 21025dfeeb7SSam Ravnborg# 21125dfeeb7SSam RavnborgKBUILD_CFLAGS += -fno-asynchronous-unwind-tables 2120a6ef376SSam Ravnborg 21376b04384SDavid Woodhouse# Avoid indirect branches in kernel to deal with Spectre 214aefb2f2eSBreno Leitaoifdef CONFIG_MITIGATION_RETPOLINE 2154cd24de3SZhenzhong Duan KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) 216d7868550SMiguel Ojeda KBUILD_RUSTFLAGS += $(RETPOLINE_RUSTFLAGS) 217ce02ef06SDaniel Borkmann # Additionally, avoid generating expensive indirect jumps which 218ce02ef06SDaniel Borkmann # are subject to retpolines for small number of switch cases. 219284a3ac4SMiguel Ojeda # LLVM turns off jump table generation by default when under 220a9d57ef1SDaniel Borkmann # retpoline builds, however, gcc does not for x86. This has 221a9d57ef1SDaniel Borkmann # only been fixed starting from gcc stable version 8.4.0 and 222a9d57ef1SDaniel Borkmann # onwards, but not for older ones. See gcc bug #86952. 223a9d57ef1SDaniel Borkmann ifndef CONFIG_CC_IS_CLANG 224989ceac7SNick Desaulniers KBUILD_CFLAGS += -fno-jump-tables 225a9d57ef1SDaniel Borkmann endif 22676b04384SDavid Woodhouseendif 22776b04384SDavid Woodhouse 2287b75782fSBreno Leitaoifdef CONFIG_MITIGATION_SLS 229e463a09aSPeter Zijlstra KBUILD_CFLAGS += -mharden-sls=all 230e463a09aSPeter Zijlstraendif 231e463a09aSPeter Zijlstra 232931ab636SPeter Zijlstraifdef CONFIG_CALL_PADDING 233bea75b33SThomas GleixnerPADDING_CFLAGS := -fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES) 234bea75b33SThomas GleixnerKBUILD_CFLAGS += $(PADDING_CFLAGS) 235bea75b33SThomas Gleixnerexport PADDING_CFLAGS 236ca627e63SMatthew Maurer 237ca627e63SMatthew MaurerPADDING_RUSTFLAGS := -Zpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES) 238ca627e63SMatthew MaurerKBUILD_RUSTFLAGS += $(PADDING_RUSTFLAGS) 239ca627e63SMatthew Maurerexport PADDING_RUSTFLAGS 240bea75b33SThomas Gleixnerendif 241bea75b33SThomas Gleixner 2420024430eSNathan ChancellorKBUILD_LDFLAGS += -m elf_$(UTS_MACHINE) 2430024430eSNathan Chancellor 244587af649SArvind Sankar# 245587af649SArvind Sankar# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to 246587af649SArvind Sankar# the linker to force 2MB page size regardless of the default page size used 247587af649SArvind Sankar# by the linker. 248587af649SArvind Sankar# 249587af649SArvind Sankarifdef CONFIG_X86_64 250587af649SArvind SankarLDFLAGS_vmlinux += -z max-page-size=0x200000 251587af649SArvind Sankarendif 252587af649SArvind Sankar 25383109d5dSKees Cook 2543ce9e53eSMichal Marekarchscripts: scripts_basic 2556520fe55SH. Peter Anvin $(Q)$(MAKE) $(build)=arch/x86/tools relocs 2566520fe55SH. Peter Anvin 2570a6ef376SSam Ravnborg### 258303395acSH. Peter Anvin# Syscall table generation 259303395acSH. Peter Anvin 260303395acSH. Peter Anvinarchheaders: 2611f57d5d8SIngo Molnar $(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all 262303395acSH. Peter Anvin 263303395acSH. Peter Anvin### 26484132633SH. Peter Anvin (Intel)# <asm/cpufeaturemasks.h> header generation 26584132633SH. Peter Anvin (Intel) 26684132633SH. Peter Anvin (Intel)cpufeaturemasks.hdr := arch/x86/include/generated/asm/cpufeaturemasks.h 26784132633SH. Peter Anvin (Intel)cpufeaturemasks.awk := $(srctree)/arch/x86/tools/cpufeaturemasks.awk 26884132633SH. Peter Anvin (Intel)cpufeatures_hdr := $(srctree)/arch/x86/include/asm/cpufeatures.h 26984132633SH. Peter Anvin (Intel)targets += $(cpufeaturemasks.hdr) 2701e7857b2SLinus Torvalds filechk_gen_featuremasks = $(AWK) -f $(cpufeaturemasks.awk) $(cpufeatures_hdr) $(KCONFIG_CONFIG) 27184132633SH. Peter Anvin (Intel) 27284132633SH. Peter Anvin (Intel)$(cpufeaturemasks.hdr): $(cpufeaturemasks.awk) $(cpufeatures_hdr) $(KCONFIG_CONFIG) FORCE 27384132633SH. Peter Anvin (Intel) $(shell mkdir -p $(dir $@)) 2741e7857b2SLinus Torvalds $(call filechk,gen_featuremasks) 27584132633SH. Peter Anvin (Intel)archprepare: $(cpufeaturemasks.hdr) 27684132633SH. Peter Anvin (Intel) 27784132633SH. Peter Anvin (Intel)### 2780a6ef376SSam Ravnborg# Kernel objects 2790a6ef376SSam Ravnborg 2800a6ef376SSam Ravnborglibs-y += arch/x86/lib/ 2810a6ef376SSam Ravnborg 2820a6ef376SSam Ravnborg# drivers-y are linked after core-y 2830a6ef376SSam Ravnborgdrivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ 2840a6ef376SSam Ravnborgdrivers-$(CONFIG_PCI) += arch/x86/pci/ 2850a6ef376SSam Ravnborg 286cf7700feSRafael J. Wysocki# suspend and hibernation support 2870a6ef376SSam Ravnborgdrivers-$(CONFIG_PM) += arch/x86/power/ 288cf7700feSRafael J. Wysocki 289f25eae2cSThomas Zimmermanndrivers-$(CONFIG_VIDEO) += arch/x86/video/ 2900a6ef376SSam Ravnborg 2910a6ef376SSam Ravnborg#### 2920a6ef376SSam Ravnborg# boot loader support. Several targets are kept for legacy purposes 2930a6ef376SSam Ravnborg 2940a6ef376SSam Ravnborgboot := arch/x86/boot 2950a6ef376SSam Ravnborg 296f279b49fSH. Peter Anvin (Intel)BOOT_TARGETS = bzdisk fdimage fdimage144 fdimage288 hdimage isoimage 297f9c5107cSH. Peter Anvin 298f9c5107cSH. Peter AnvinPHONY += bzImage $(BOOT_TARGETS) 2990a6ef376SSam Ravnborg 3000a6ef376SSam Ravnborg# Default kernel to build 3010a6ef376SSam Ravnborgall: bzImage 3020a6ef376SSam Ravnborg 3030a6ef376SSam Ravnborg# KBUILD_IMAGE specify target image being built 3040a6ef376SSam RavnborgKBUILD_IMAGE := $(boot)/bzImage 3050a6ef376SSam Ravnborg 306f9c5107cSH. Peter AnvinbzImage: vmlinux 307ca0e9badSMasami Hiramatsuifeq ($(CONFIG_X86_DECODER_SELFTEST),y) 308ca0e9badSMasami Hiramatsu $(Q)$(MAKE) $(build)=arch/x86/tools posttest 309ca0e9badSMasami Hiramatsuendif 3100a6ef376SSam Ravnborg $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) 3110a6ef376SSam Ravnborg $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot 31241b3eae6SJan Beulich $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ 3130a6ef376SSam Ravnborg 314f9c5107cSH. Peter Anvin$(BOOT_TARGETS): vmlinux 315f9c5107cSH. Peter Anvin $(Q)$(MAKE) $(build)=$(boot) $@ 3160a6ef376SSam Ravnborg 3176d61b8e6SMasahiro YamadaPHONY += install 3186d61b8e6SMasahiro Yamadainstall: 319f774f5bbSMasahiro Yamada $(call cmd,install) 3201648e4f8SH. Peter Anvin 32156769ba4SMasahiro Yamadavdso-install-$(CONFIG_X86_64) += arch/x86/entry/vdso/vdso64.so.dbg 32256769ba4SMasahiro Yamadavdso-install-$(CONFIG_X86_X32_ABI) += arch/x86/entry/vdso/vdsox32.so.dbg 323289d0a47SMasahiro Yamadavdso-install-$(CONFIG_COMPAT_32) += arch/x86/entry/vdso/vdso32.so.dbg 3240a6ef376SSam Ravnborg 325829fe4aaSBen Hutchingsarchprepare: checkbin 326829fe4aaSBen Hutchingscheckbin: 327aefb2f2eSBreno Leitaoifdef CONFIG_MITIGATION_RETPOLINE 32825896d07SMasahiro Yamadaifeq ($(RETPOLINE_CFLAGS),) 32925896d07SMasahiro Yamada @echo "You are building kernel with non-retpoline compiler." >&2 33025896d07SMasahiro Yamada @echo "Please update your compiler." >&2 33125896d07SMasahiro Yamada @false 33225896d07SMasahiro Yamadaendif 33325896d07SMasahiro Yamadaendif 334829fe4aaSBen Hutchings 335b9f174c8SOmar Sandovalifdef CONFIG_UNWINDER_ORC 336b9f174c8SOmar Sandovalorc_hash_h := arch/$(SRCARCH)/include/generated/asm/orc_hash.h 337b9f174c8SOmar Sandovalorc_hash_sh := $(srctree)/scripts/orc_hash.sh 338b9f174c8SOmar Sandovaltargets += $(orc_hash_h) 339b9f174c8SOmar Sandovalquiet_cmd_orc_hash = GEN $@ 340b9f174c8SOmar Sandoval cmd_orc_hash = mkdir -p $(dir $@); \ 341b9f174c8SOmar Sandoval $(CONFIG_SHELL) $(orc_hash_sh) < $< > $@ 342b9f174c8SOmar Sandoval$(orc_hash_h): $(srctree)/arch/x86/include/asm/orc_types.h $(orc_hash_sh) FORCE 343b9f174c8SOmar Sandoval $(call if_changed,orc_hash) 344b9f174c8SOmar Sandovalarchprepare: $(orc_hash_h) 345b9f174c8SOmar Sandovalendif 346b9f174c8SOmar Sandoval 3470a6ef376SSam Ravnborgarchclean: 3480a6ef376SSam Ravnborg $(Q)rm -rf $(objtree)/arch/i386 3490a6ef376SSam Ravnborg $(Q)rm -rf $(objtree)/arch/x86_64 3500a6ef376SSam Ravnborg 3510a6ef376SSam Ravnborgdefine archhelp 3520a6ef376SSam Ravnborg echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' 353ac5d0887SBorislav Petkov echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or' 354ac5d0887SBorislav Petkov echo ' (distribution) /sbin/$(INSTALLKERNEL) or install to ' 355ac5d0887SBorislav Petkov echo ' $$(INSTALL_PATH) and run lilo' 356ac5d0887SBorislav Petkov echo '' 35737f30e21SAndi Kleen echo ' fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)' 35837f30e21SAndi Kleen echo ' fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)' 35937f30e21SAndi Kleen echo ' fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)' 360f279b49fSH. Peter Anvin (Intel) echo ' hdimage - Create a BIOS/EFI hard disk image (arch/x86/boot/hdimage)' 36137f30e21SAndi Kleen echo ' isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)' 362f279b49fSH. Peter Anvin (Intel) echo ' bzdisk/fdimage*/hdimage/isoimage also accept:' 36337f30e21SAndi Kleen echo ' FDARGS="..." arguments for the booted kernel' 36437f30e21SAndi Kleen echo ' FDINITRD=file initrd for the booted kernel' 365fbaf0aa8SBorislav Petkov 3660a6ef376SSam Ravnborgendef 367