1*83d290c5STom Rini# SPDX-License-Identifier: GPL-2.0+ 2a47a12beSStefan Roese# 3fa11dbe5SWolfgang Denk# (C) Copyright 2000-2010 4a47a12beSStefan Roese# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 5a47a12beSStefan Roese 69b6e2c36SMasahiro Yamadaifeq ($(CROSS_COMPILE),) 79b6e2c36SMasahiro YamadaCROSS_COMPILE := ppc_8xx- 89b6e2c36SMasahiro Yamadaendif 9a47a12beSStefan Roese 108ae86b76SWolfgang DenkCONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 116dc1ecebSHaiying WangLDFLAGS_FINAL += --gc-sections 12039b7739SChris PackhamLDFLAGS_FINAL += --bss-plt 137682a998SRob HerringPLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \ 147682a998SRob Herring-fdata-sections -mcall-linux 157682a998SRob Herring 16b9f06b36STom RiniPF_CPPFLAGS_POWERPC := $(call cc-option,-fno-ira-hoist-pressure,) 17b9f06b36STom RiniPLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2 -m32 $(PF_CPPFLAGS_POWERPC) 187682a998SRob HerringPLATFORM_LDFLAGS += -m32 -melf32ppclinux 19a47a12beSStefan Roese 20a47a12beSStefan Roese# 21a47a12beSStefan Roese# When cross-compiling on NetBSD, we have to define __PPC__ or else we 22a47a12beSStefan Roese# will pick up a va_list declaration that is incompatible with the 23a47a12beSStefan Roese# actual argument lists emitted by the compiler. 24a47a12beSStefan Roese# 25a47a12beSStefan Roese# [Tested on NetBSD/i386 1.5 + cross-powerpc-netbsd-1.3] 26a47a12beSStefan Roese 27a47a12beSStefan Roeseifeq ($(CROSS_COMPILE),powerpc-netbsd-) 28a47a12beSStefan RoesePLATFORM_CPPFLAGS+= -D__PPC__ 29a47a12beSStefan Roeseendif 30a47a12beSStefan Roeseifeq ($(CROSS_COMPILE),powerpc-openbsd-) 31a47a12beSStefan RoesePLATFORM_CPPFLAGS+= -D__PPC__ 32a47a12beSStefan Roeseendif 336ec63f41SScott Wood 346ec63f41SScott Wood# Only test once 356ec63f41SScott Woodifneq ($(CONFIG_SPL_BUILD),y) 36d57d60cfSMasahiro Yamadaarchprepare: checkgcc4 37d57d60cfSMasahiro Yamada 38d57d60cfSMasahiro Yamada# GCC 3.x is reported to have problems generating the type of relocation 39d57d60cfSMasahiro Yamada# that U-Boot wants. 40d57d60cfSMasahiro Yamada# See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html 41d57d60cfSMasahiro Yamadacheckgcc4: 426e2f1538STom Rini @if test "$(call cc-name)" = "gcc" -a \ 436e2f1538STom Rini $(call cc-version) -lt 0400; then \ 44d57d60cfSMasahiro Yamada echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \ 45d57d60cfSMasahiro Yamada false; \ 46d57d60cfSMasahiro Yamada fi 476ec63f41SScott Woodendif 48