config.mk 1.3 KB

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