Lines Matching +full:- +full:- +full:disable +full:- +full:avx2
1 # SPDX-License-Identifier: GPL-2.0
6 ifeq ($(shell uname -m | sed -e 's/i.86/i386/'),i386)
16 RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
17 RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
20 RETPOLINE_CFLAGS := -mretpoline-external-thunk
21 RETPOLINE_VDSO_CFLAGS := -mretpoline
23 RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix)
26 RETHUNK_CFLAGS := -mfunction-return=thunk-extern
34 # For gcc stack alignment is specified with -mpreferred-stack-boundary,
35 # clang has the option -mstack-alignment for that purpose.
36 ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
37 cc_stack_align4 := -mpreferred-stack-boundary=2
38 cc_stack_align8 := -mpreferred-stack-boundary=3
39 else ifneq ($(call cc-option, -mstack-alignment=16),)
40 cc_stack_align4 := -mstack-alignment=4
41 cc_stack_align8 := -mstack-alignment=8
44 # How to compile the 16-bit code. Note we always compile for -march=i386;
46 REALMODE_CFLAGS := -m16 -g -Os -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \
47 -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
48 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
49 -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)
51 REALMODE_CFLAGS += -ffreestanding
52 REALMODE_CFLAGS += -fno-stack-protector
53 REALMODE_CFLAGS += -Wno-address-of-packed-member
60 # e.g.: obj-y += foo_$(BITS).o
66 # This must happen before we try the -mpreferred-stack-boundary, see:
70 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
71 KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
77 # for jump-tables, as such, disable jump-tables for now.
79 # (jump-tables are implicitly disabled by RETPOLINE)
83 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables)
85 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
91 CHECKFLAGS += -D__i386__
93 KBUILD_AFLAGS += -m32
94 KBUILD_CFLAGS += -m32
96 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
98 # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
100 KBUILD_CFLAGS += -fno-pic
107 # CPU-specific tuning. Anything which can be shared with UML should go here.
109 KBUILD_CFLAGS += $(cflags-y)
112 KBUILD_CFLAGS += -ffreestanding
116 KBUILD_CFLAGS += -mstack-protector-guard-reg=fs \
117 -mstack-protector-guard-symbol=__ref_stack_chk_guard
119 KBUILD_CFLAGS += -mstack-protector-guard=global
125 CHECKFLAGS += -D__x86_64__
127 KBUILD_AFLAGS += -m64
128 KBUILD_CFLAGS += -m64
131 KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
134 KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
137 KBUILD_CFLAGS += -mno-80387
138 KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
141 # However the standard kernel entry on x86-64 leaves the stack on an
142 # 8-byte boundary. If the compiler isn't informed about the actual
149 # Use -mskip-rax-setup if supported.
150 KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
152 # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
153 cflags-$(CONFIG_MK8) += -march=k8
154 cflags-$(CONFIG_MPSC) += -march=nocona
155 cflags-$(CONFIG_MCORE2) += -march=core2
156 cflags-$(CONFIG_MATOM) += -march=atom
157 cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
158 KBUILD_CFLAGS += $(cflags-y)
160 rustflags-$(CONFIG_MK8) += -Ctarget-cpu=k8
161 rustflags-$(CONFIG_MPSC) += -Ctarget-cpu=nocona
162 rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2
163 rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=atom
164 rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic
165 KBUILD_RUSTFLAGS += $(rustflags-y)
167 KBUILD_CFLAGS += -mno-red-zone
168 KBUILD_CFLAGS += -mcmodel=kernel
169 KBUILD_RUSTFLAGS += -Cno-redzone=y
170 KBUILD_RUSTFLAGS += -Ccode-model=kernel
175 # '-maccumulate-outgoing-args' is needed to prevent a GCC bug
186 KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
190 KBUILD_CFLAGS += -Wno-sign-compare
192 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
204 KBUILD_CFLAGS += -fno-jump-tables
209 KBUILD_CFLAGS += -mharden-sls=all
213 PADDING_CFLAGS := -fpatchable-function-entry=$(CONFIG_FUNCTION_PADDING_BYTES),$(CONFIG_FUNCTION_PADDING_BYTES)
218 KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
221 ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000),y)
222 KBUILD_LDFLAGS += -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8)
227 LDFLAGS_vmlinux := --emit-relocs --discard-none
233 # The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to
238 LDFLAGS_vmlinux += -z max-page-size=0x200000
254 libs-y += arch/x86/lib/
256 # drivers-y are linked after core-y
257 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
258 drivers-$(CONFIG_PCI) += arch/x86/pci/
261 drivers-$(CONFIG_PM) += arch/x86/power/
263 drivers-$(CONFIG_FB_CORE) += arch/x86/video/
285 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
286 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
295 vdso-install-$(CONFIG_X86_64) += arch/x86/entry/vdso/vdso64.so.dbg
296 vdso-install-$(CONFIG_X86_X32_ABI) += arch/x86/entry/vdso/vdsox32.so.dbg
297 vdso-install-$(CONFIG_X86_32) += arch/x86/entry/vdso/vdso32.so.dbg
298 vdso-install-$(CONFIG_IA32_EMULATION) += arch/x86/entry/vdso/vdso32.so.dbg
304 @echo "You are building kernel with non-retpoline compiler." >&2
315 cmd_orc_hash = mkdir -p $(dir $@); \
323 $(Q)rm -rf $(objtree)/arch/i386
324 $(Q)rm -rf $(objtree)/arch/x86_64
327 echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
328 echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
332 echo ' fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
333 echo ' fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)'
334 echo ' fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)'
335 echo ' hdimage - Create a BIOS/EFI hard disk image (arch/x86/boot/hdimage)'
336 echo ' isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)'