config.mk 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2000-2010
  4. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. LDFLAGS_FINAL += --gc-sections
  6. LDFLAGS_FINAL += --bss-plt
  7. PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \
  8. -fdata-sections -mcall-linux
  9. PF_CPPFLAGS_POWERPC := $(call cc-option,-fno-ira-hoist-pressure,)
  10. PLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2 -m32 $(PF_CPPFLAGS_POWERPC)
  11. KBUILD_LDFLAGS += -m32 -melf32ppclinux
  12. #
  13. # When cross-compiling on NetBSD, we have to define __PPC__ or else we
  14. # will pick up a va_list declaration that is incompatible with the
  15. # actual argument lists emitted by the compiler.
  16. #
  17. # [Tested on NetBSD/i386 1.5 + cross-powerpc-netbsd-1.3]
  18. ifeq ($(CROSS_COMPILE),powerpc-netbsd-)
  19. PLATFORM_CPPFLAGS+= -D__PPC__
  20. endif
  21. ifeq ($(CROSS_COMPILE),powerpc-openbsd-)
  22. PLATFORM_CPPFLAGS+= -D__PPC__
  23. endif
  24. # Only test once
  25. ifneq ($(CONFIG_SPL_BUILD),y)
  26. archprepare: checkgcc4
  27. # GCC 3.x is reported to have problems generating the type of relocation
  28. # that U-Boot wants.
  29. # See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html
  30. checkgcc4:
  31. @if test "$(call cc-name)" = "gcc" -a \
  32. $(call cc-version) -lt 0400; then \
  33. echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \
  34. false; \
  35. fi
  36. endif