Makefile.um 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # SPDX-License-Identifier: GPL-2.0
  2. core-y += arch/x86/crypto/
  3. #
  4. # Disable SSE and other FP/SIMD instructions to match normal x86
  5. # This is required to work around issues in older LLVM versions, but breaks
  6. # GCC versions < 11. See:
  7. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652
  8. #
  9. ifeq ($(CONFIG_CC_IS_CLANG),y)
  10. KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
  11. KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
  12. KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
  13. endif
  14. ifeq ($(CONFIG_X86_32),y)
  15. START := 0x8048000
  16. KBUILD_LDFLAGS += -m elf_i386
  17. ELF_ARCH := i386
  18. ELF_FORMAT := elf32-i386
  19. CHECKFLAGS += -D__i386__
  20. KBUILD_CFLAGS += $(call cc-option,-m32)
  21. KBUILD_AFLAGS += $(call cc-option,-m32)
  22. LINK-y += $(call cc-option,-m32)
  23. LDS_EXTRA := -Ui386
  24. export LDS_EXTRA
  25. # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
  26. include $(srctree)/arch/x86/Makefile_32.cpu
  27. # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
  28. cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
  29. # Prevent sprintf in nfsd from being converted to strcpy and resulting in
  30. # an unresolved reference.
  31. cflags-y += -ffreestanding
  32. KBUILD_CFLAGS += $(cflags-y)
  33. else
  34. START := 0x60000000
  35. KBUILD_CFLAGS += -fno-builtin -m64
  36. CHECKFLAGS += -m64 -D__x86_64__
  37. KBUILD_AFLAGS += -m64
  38. KBUILD_LDFLAGS += -m elf_x86_64
  39. KBUILD_CPPFLAGS += -m64
  40. ELF_ARCH := i386:x86-64
  41. ELF_FORMAT := elf64-x86-64
  42. # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
  43. LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64
  44. LINK-y += -m64
  45. endif