mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-01 06:39:05 +00:00

arch/sh/Makefile defines and exports ld-bfd to be used by arch/sh/boot/compressed/Makefile and arch/sh/boot/romimage/Makefile. However some shells, including dash, will not pass through environment variables whose name includes a hyphen. Usually GNU make does not use a shell to recurse, but if e.g. $(srctree) contains '~' it will use a shell here. Other instances of this problem were previously fixed by commits2bfbe7881e
"kbuild: Do not use hyphen in exported variable name" and82977af93a
"sh: rename suffix-y to suffix_y". Rename the variable to ld_bfd. References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=4.13%7Erc5-1%7Eexp1&stamp=1502943967&raw=0 Fixes:7b022d07a0
("sh: Tidy up the ldscript output format specifier.") Signed-off-by: Ben Hutchings <benh@debian.org> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
31 lines
902 B
Makefile
31 lines
902 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# linux/arch/sh/boot/romimage/Makefile
|
|
#
|
|
# create an romImage file suitable for burning to flash/mmc from zImage
|
|
#
|
|
|
|
targets := vmlinux head.o zeropage.bin piggy.o
|
|
load-y := 0
|
|
|
|
mmcif-load-$(CONFIG_CPU_SUBTYPE_SH7724) := 0xe5200000 # ILRAM
|
|
mmcif-obj-$(CONFIG_CPU_SUBTYPE_SH7724) := $(obj)/mmcif-sh7724.o
|
|
load-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-load-y)
|
|
obj-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-obj-y)
|
|
|
|
LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(load-y) -e romstart \
|
|
-T $(obj)/../../kernel/vmlinux.lds
|
|
|
|
$(obj)/vmlinux: $(obj)/head.o $(obj-y) $(obj)/piggy.o FORCE
|
|
$(call if_changed,ld)
|
|
|
|
OBJCOPYFLAGS += -j .empty_zero_page
|
|
|
|
$(obj)/zeropage.bin: vmlinux FORCE
|
|
$(call if_changed,objcopy)
|
|
|
|
LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
|
|
|
|
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE
|
|
$(call if_changed,ld)
|