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