xref: /linux/arch/x86/boot/startup/Makefile (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
15a67da1fSArd Biesheuvel# SPDX-License-Identifier: GPL-2.0
25a67da1fSArd Biesheuvel
34f2d1bbcSArd BiesheuvelKBUILD_AFLAGS		+= -D__DISABLE_EXPORTS
44cecebf2SArd BiesheuvelKBUILD_CFLAGS		+= -D__DISABLE_EXPORTS -mcmodel=small -fPIC \
54cecebf2SArd Biesheuvel			   -Os -DDISABLE_BRANCH_PROFILING \
64cecebf2SArd Biesheuvel			   $(DISABLE_STACKLEAK_PLUGIN) \
74cecebf2SArd Biesheuvel			   -fno-stack-protector -D__NO_FORTIFY \
8*121c335bSArd Biesheuvel			   -fno-jump-tables \
94cecebf2SArd Biesheuvel			   -include $(srctree)/include/linux/hidden.h
104cecebf2SArd Biesheuvel
11498cb872SNathan Chancellor# disable ftrace hooks and LTO
124cecebf2SArd BiesheuvelKBUILD_CFLAGS	:= $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS))
13498cb872SNathan ChancellorKBUILD_CFLAGS	:= $(filter-out $(CC_FLAGS_LTO),$(KBUILD_CFLAGS))
144cecebf2SArd BiesheuvelKASAN_SANITIZE	:= n
154cecebf2SArd BiesheuvelKCSAN_SANITIZE	:= n
164cecebf2SArd BiesheuvelKMSAN_SANITIZE	:= n
174cecebf2SArd BiesheuvelUBSAN_SANITIZE	:= n
184cecebf2SArd BiesheuvelKCOV_INSTRUMENT	:= n
194cecebf2SArd Biesheuvel
20dbe0ad77SArd Biesheuvelobj-$(CONFIG_X86_64)		+= gdt_idt.o map_kernel.o
21a3cbbb47SArd Biesheuvelobj-$(CONFIG_AMD_MEM_ENCRYPT)	+= sme.o sev-startup.o
224f2d1bbcSArd Biesheuvel
235a67da1fSArd Biesheuvellib-$(CONFIG_X86_64)		+= la57toggle.o
244f2d1bbcSArd Biesheuvellib-$(CONFIG_EFI_MIXED)		+= efi-mixed.o
25d9fa398fSArd Biesheuvel
26d9fa398fSArd Biesheuvel#
27d9fa398fSArd Biesheuvel# Disable objtool validation for all library code, which is intended
28d9fa398fSArd Biesheuvel# to be linked into the decompressor or the EFI stub but not vmlinux
29d9fa398fSArd Biesheuvel#
30d9fa398fSArd Biesheuvel$(patsubst %.o,$(obj)/%.o,$(lib-y)): OBJECT_FILES_NON_STANDARD := y
31