xref: /openbmc/linux/arch/x86/Makefile.um (revision d3402925)
1# SPDX-License-Identifier: GPL-2.0
2core-y += arch/x86/crypto/
3
4#
5# Disable SSE and other FP/SIMD instructions to match normal x86
6#
7KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
8KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
9
10ifeq ($(CONFIG_X86_32),y)
11START := 0x8048000
12
13KBUILD_LDFLAGS		+= -m elf_i386
14ELF_ARCH		:= i386
15ELF_FORMAT 		:= elf32-i386
16CHECKFLAGS	+= -D__i386__
17
18KBUILD_CFLAGS		+= $(call cc-option,-m32)
19KBUILD_AFLAGS		+= $(call cc-option,-m32)
20LINK-y			+= $(call cc-option,-m32)
21
22LDS_EXTRA		:= -Ui386
23export LDS_EXTRA
24
25# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
26include $(srctree)/arch/x86/Makefile_32.cpu
27
28# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
29cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
30
31# Prevent sprintf in nfsd from being converted to strcpy and resulting in
32# an unresolved reference.
33cflags-y += -ffreestanding
34
35KBUILD_CFLAGS += $(cflags-y)
36
37else
38
39START := 0x60000000
40
41KBUILD_CFLAGS += -fno-builtin -m64
42
43CHECKFLAGS  += -m64 -D__x86_64__
44KBUILD_AFLAGS += -m64
45KBUILD_LDFLAGS += -m elf_x86_64
46KBUILD_CPPFLAGS += -m64
47
48ELF_ARCH := i386:x86-64
49ELF_FORMAT := elf64-x86-64
50
51# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
52
53LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64
54LINK-y += -m64
55
56endif
57