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