xref: /openbmc/linux/arch/x86/Makefile.um (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
25c48b108SAl Virocore-y += arch/x86/crypto/
35c48b108SAl Viro
488498186SDavid Gow#
588498186SDavid Gow# Disable SSE and other FP/SIMD instructions to match normal x86
6*a3046a61SDavid Gow# This is required to work around issues in older LLVM versions, but breaks
7*a3046a61SDavid Gow# GCC versions < 11. See:
8*a3046a61SDavid Gow# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652
988498186SDavid Gow#
10*a3046a61SDavid Gowifeq ($(CONFIG_CC_IS_CLANG),y)
1188498186SDavid GowKBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
1288498186SDavid GowKBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
13*a3046a61SDavid Gowendif
1488498186SDavid Gow
155c48b108SAl Viroifeq ($(CONFIG_X86_32),y)
165c48b108SAl ViroSTART := 0x8048000
175c48b108SAl Viro
18d503ac53SMasahiro YamadaKBUILD_LDFLAGS		+= -m elf_i386
195c48b108SAl ViroELF_ARCH		:= i386
205c48b108SAl ViroELF_FORMAT 		:= elf32-i386
215c48b108SAl ViroCHECKFLAGS	+= -D__i386__
225c48b108SAl Viro
235c48b108SAl ViroKBUILD_CFLAGS		+= $(call cc-option,-m32)
245c48b108SAl ViroKBUILD_AFLAGS		+= $(call cc-option,-m32)
255c48b108SAl ViroLINK-y			+= $(call cc-option,-m32)
265c48b108SAl Viro
273cb42092SAl ViroLDS_EXTRA		:= -Ui386
283cb42092SAl Viroexport LDS_EXTRA
293cb42092SAl Viro
305c48b108SAl Viro# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
3167d7c302SMasahiro Yamadainclude $(srctree)/arch/x86/Makefile_32.cpu
325c48b108SAl Viro
335c48b108SAl Viro# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
345c48b108SAl Virocflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
355c48b108SAl Viro
365c48b108SAl Viro# Prevent sprintf in nfsd from being converted to strcpy and resulting in
375c48b108SAl Viro# an unresolved reference.
385c48b108SAl Virocflags-y += -ffreestanding
395c48b108SAl Viro
405c48b108SAl ViroKBUILD_CFLAGS += $(cflags-y)
415c48b108SAl Viro
425c48b108SAl Viroelse
435c48b108SAl Viro
445c48b108SAl ViroSTART := 0x60000000
455c48b108SAl Viro
465c48b108SAl ViroKBUILD_CFLAGS += -fno-builtin -m64
475c48b108SAl Viro
485c48b108SAl ViroCHECKFLAGS  += -m64 -D__x86_64__
495c48b108SAl ViroKBUILD_AFLAGS += -m64
50d503ac53SMasahiro YamadaKBUILD_LDFLAGS += -m elf_x86_64
515c48b108SAl ViroKBUILD_CPPFLAGS += -m64
525c48b108SAl Viro
535c48b108SAl ViroELF_ARCH := i386:x86-64
545c48b108SAl ViroELF_FORMAT := elf64-x86-64
555c48b108SAl Viro
565c48b108SAl Viro# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
575c48b108SAl Viro
58386093c6SJohannes BergLINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64
595c48b108SAl ViroLINK-y += -m64
605c48b108SAl Viro
615c48b108SAl Viroendif
62