config.mk 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2003
  4. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. ifdef CONFIG_SYS_BIG_ENDIAN
  6. 32bit-emul := elf32btsmip
  7. 64bit-emul := elf64btsmip
  8. 32bit-bfd := elf32-tradbigmips
  9. 64bit-bfd := elf64-tradbigmips
  10. PLATFORM_CPPFLAGS += -EB
  11. KBUILD_LDFLAGS += -EB
  12. endif
  13. ifdef CONFIG_SYS_LITTLE_ENDIAN
  14. 32bit-emul := elf32ltsmip
  15. 64bit-emul := elf64ltsmip
  16. 32bit-bfd := elf32-tradlittlemips
  17. 64bit-bfd := elf64-tradlittlemips
  18. PLATFORM_CPPFLAGS += -EL
  19. KBUILD_LDFLAGS += -EL
  20. endif
  21. ifdef CONFIG_32BIT
  22. PLATFORM_CPPFLAGS += -mabi=32
  23. KBUILD_LDFLAGS += -m $(32bit-emul)
  24. OBJCOPYFLAGS += -O $(32bit-bfd)
  25. CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
  26. endif
  27. ifdef CONFIG_64BIT
  28. PLATFORM_CPPFLAGS += -mabi=64
  29. KBUILD_LDFLAGS += -m$(64bit-emul)
  30. OBJCOPYFLAGS += -O $(64bit-bfd)
  31. CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
  32. endif
  33. PLATFORM_CPPFLAGS += -D__MIPS__
  34. PLATFORM_ELFFLAGS += -B mips $(OBJCOPYFLAGS)
  35. #
  36. # From Linux arch/mips/Makefile
  37. #
  38. # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
  39. # code since it only slows down the whole thing. At some point we might make
  40. # use of global pointer optimizations but their use of $28 conflicts with
  41. # the current pointer optimization.
  42. #
  43. # The DECStation requires an ECOFF kernel for remote booting, other MIPS
  44. # machines may also. Since BFD is incredibly buggy with respect to
  45. # crossformat linking we rely on the elf2ecoff tool for format conversion.
  46. #
  47. # cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
  48. # cflags-y += -msoft-float
  49. # LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
  50. # MODFLAGS += -mlong-calls
  51. #
  52. ifndef CONFIG_SPL_BUILD
  53. OBJCOPYFLAGS += -j .data.reloc -j .dtb.init.rodata
  54. LDFLAGS_FINAL += --emit-relocs
  55. endif
  56. PLATFORM_CPPFLAGS += -G 0 -mno-abicalls -fno-pic
  57. PLATFORM_CPPFLAGS += -msoft-float
  58. KBUILD_LDFLAGS += -G 0 -static -n -nostdlib
  59. PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
  60. LDFLAGS_FINAL += --gc-sections
  61. OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list
  62. LDFLAGS_STANDALONE += --gc-sections