config.mk 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # (C) Copyright 2003
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. #
  5. # SPDX-License-Identifier: GPL-2.0+
  6. #
  7. CROSS_COMPILE ?= mips_4KC-
  8. # Handle special prefix in ELDK 4.0 toolchain
  9. ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
  10. ENDIANNESS := -EL
  11. endif
  12. ifdef CONFIG_SYS_LITTLE_ENDIAN
  13. ENDIANNESS := -EL
  14. endif
  15. ifdef CONFIG_SYS_BIG_ENDIAN
  16. ENDIANNESS := -EB
  17. endif
  18. # Default to EB if no endianess is configured
  19. ENDIANNESS ?= -EB
  20. PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
  21. #
  22. # From Linux arch/mips/Makefile
  23. #
  24. # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
  25. # code since it only slows down the whole thing. At some point we might make
  26. # use of global pointer optimizations but their use of $28 conflicts with
  27. # the current pointer optimization.
  28. #
  29. # The DECStation requires an ECOFF kernel for remote booting, other MIPS
  30. # machines may also. Since BFD is incredibly buggy with respect to
  31. # crossformat linking we rely on the elf2ecoff tool for format conversion.
  32. #
  33. # cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
  34. # cflags-y += -msoft-float
  35. # LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
  36. # MODFLAGS += -mlong-calls
  37. #
  38. # On the other hand, we want PIC in the U-Boot code to relocate it from ROM
  39. # to RAM. $28 is always used as gp.
  40. #
  41. PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic $(ENDIANNESS)
  42. PLATFORM_CPPFLAGS += -msoft-float
  43. PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib $(ENDIANNESS)
  44. PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
  45. LDFLAGS_FINAL += --gc-sections -pie
  46. OBJCOPYFLAGS += --remove-section=.dynsym