Makefile.um 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # SPDX-License-Identifier: GPL-2.0
  2. core-y += arch/x86/crypto/
  3. ifeq ($(CONFIG_X86_32),y)
  4. START := 0x8048000
  5. KBUILD_LDFLAGS += -m elf_i386
  6. ELF_ARCH := i386
  7. ELF_FORMAT := elf32-i386
  8. CHECKFLAGS += -D__i386__
  9. KBUILD_CFLAGS += $(call cc-option,-m32)
  10. KBUILD_AFLAGS += $(call cc-option,-m32)
  11. LINK-y += $(call cc-option,-m32)
  12. LDS_EXTRA := -Ui386
  13. export LDS_EXTRA
  14. # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
  15. include arch/x86/Makefile_32.cpu
  16. # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
  17. cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
  18. # Prevent sprintf in nfsd from being converted to strcpy and resulting in
  19. # an unresolved reference.
  20. cflags-y += -ffreestanding
  21. KBUILD_CFLAGS += $(cflags-y)
  22. else
  23. START := 0x60000000
  24. KBUILD_CFLAGS += -fno-builtin -m64
  25. CHECKFLAGS += -m64 -D__x86_64__
  26. KBUILD_AFLAGS += -m64
  27. KBUILD_LDFLAGS += -m elf_x86_64
  28. KBUILD_CPPFLAGS += -m64
  29. ELF_ARCH := i386:x86-64
  30. ELF_FORMAT := elf64-x86-64
  31. # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
  32. LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
  33. LINK-y += -m64
  34. endif