Makefile-i386 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. core-y += arch/um/sys-i386/ arch/x86/crypto/
  2. TOP_ADDR := $(CONFIG_TOP_ADDR)
  3. ifeq ($(CONFIG_MODE_SKAS),y)
  4. ifneq ($(CONFIG_MODE_TT),y)
  5. START := 0x8048000
  6. endif
  7. endif
  8. LDFLAGS += -m elf_i386
  9. ELF_ARCH := $(SUBARCH)
  10. ELF_FORMAT := elf32-$(SUBARCH)
  11. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  12. HEADER_ARCH := x86
  13. ifeq ("$(origin SUBARCH)", "command line")
  14. ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
  15. CFLAGS += $(call cc-option,-m32)
  16. AFLAGS += $(call cc-option,-m32)
  17. LINK-y += $(call cc-option,-m32)
  18. UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
  19. export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
  20. endif
  21. endif
  22. CFLAGS += -DCONFIG_X86_32
  23. AFLAGS += -DCONFIG_X86_32
  24. CONFIG_X86_32 := y
  25. export CONFIG_X86_32
  26. ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
  27. # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
  28. include $(srctree)/arch/i386/Makefile.cpu
  29. # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
  30. cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
  31. # Prevent sprintf in nfsd from being converted to strcpy and resulting in
  32. # an unresolved reference.
  33. cflags-y += -ffreestanding
  34. CFLAGS += $(cflags-y)