mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-06 05:04:26 +00:00
83b7e2a7f2
Currently, some linker scripts are found by common code in config.mk. Some are found using CONFIG_SYS_LDSCRIPT, but the code for that is sometimes in arch config.mk and sometimes in board config.mk. Some are found using an arch-specific rule for looking in CPUDIR, etc. Further, the powerpc config.mk rule relied on CONFIG_NAND_SPL when it really wanted CONFIG_NAND_U_BOOT -- which covered up the fact that not all NAND_U_BOOT builds actually wanted CPUDIR/u-boot-nand.lds. Replace all of this -- except for a handful of boards that are actually selecting a linker script in a unique way -- with centralized ldscript finding. If board code specifies LDSCRIPT, that will be used. Otherwise, if CONFIG_SYS_LDSCRIPT is specified, that will be used. If neither of these are specified, then the central config.mk will check for the existence of the following, in order: $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT) $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT) $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds $(TOPDIR)/$(CPUDIR)/u-boot.lds Some boards (sc3, cm5200, munices) provided their own u-boot.lds that were dead code, because they were overridden by a CPUDIR u-boot.lds under the old powerpc rules. These boards' own u-boot.lds have bitrotted and no longer work -- these lds files have been removed. Signed-off-by: Scott Wood <scottwood@freescale.com> Tested-by: Graeme Russ <graeme.russ@gmail.com>
44 lines
1.5 KiB
Makefile
44 lines
1.5 KiB
Makefile
#
|
|
# (C) Copyright 2000-2010
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
#
|
|
# See file CREDITS for list of people who contributed to this
|
|
# project.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation; either version 2 of
|
|
# the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
# MA 02111-1307 USA
|
|
#
|
|
|
|
CROSS_COMPILE ?= ppc_8xx-
|
|
|
|
CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
|
|
LDFLAGS_FINAL += --gc-sections
|
|
PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
|
|
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
|
|
PLATFORM_LDFLAGS += -n
|
|
|
|
#
|
|
# When cross-compiling on NetBSD, we have to define __PPC__ or else we
|
|
# will pick up a va_list declaration that is incompatible with the
|
|
# actual argument lists emitted by the compiler.
|
|
#
|
|
# [Tested on NetBSD/i386 1.5 + cross-powerpc-netbsd-1.3]
|
|
|
|
ifeq ($(CROSS_COMPILE),powerpc-netbsd-)
|
|
PLATFORM_CPPFLAGS+= -D__PPC__
|
|
endif
|
|
ifeq ($(CROSS_COMPILE),powerpc-openbsd-)
|
|
PLATFORM_CPPFLAGS+= -D__PPC__
|
|
endif
|