Makefile 986 B

1234567891011121314151617181920212223242526
  1. #
  2. # The stub may be linked into the kernel proper or into a separate boot binary,
  3. # but in either case, it executes before the kernel does (with MMU disabled) so
  4. # things like ftrace and stack-protector are likely to cause trouble if left
  5. # enabled, even if doing so doesn't break the build.
  6. #
  7. cflags-$(CONFIG_X86_32) := -march=i386
  8. cflags-$(CONFIG_X86_64) := -mcmodel=small
  9. cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
  10. -fPIC -fno-strict-aliasing -mno-red-zone \
  11. -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING
  12. cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS))
  13. cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
  14. -fno-builtin -fpic -mno-single-pic-base
  15. KBUILD_CFLAGS := $(cflags-y) \
  16. $(call cc-option,-ffreestanding) \
  17. $(call cc-option,-fno-stack-protector)
  18. GCOV_PROFILE := n
  19. lib-y := efi-stub-helper.o
  20. lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o
  21. CFLAGS_fdt.o += -I$(srctree)/scripts/dtc/libfdt/