Skip to content

Commit c32969d

Browse files
benh-debianglaubitz
authored andcommitted
sh: Do not use hyphen in exported variable name
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 commits 2bfbe78 "kbuild: Do not use hyphen in exported variable name" and 82977af "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: 7b022d0 ("sh: Tidy up the ldscript output format specifier.") Signed-off-by: Ben Hutchings <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent 19272b3 commit c32969d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

arch/sh/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ UTS_MACHINE := sh
103103
LDFLAGS_vmlinux += -e _stext
104104

105105
ifdef CONFIG_CPU_LITTLE_ENDIAN
106-
ld-bfd := elf32-sh-linux
107-
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
106+
ld_bfd := elf32-sh-linux
107+
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld_bfd)
108108
KBUILD_LDFLAGS += -EL
109109
else
110-
ld-bfd := elf32-shbig-linux
111-
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
110+
ld_bfd := elf32-shbig-linux
111+
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld_bfd)
112112
KBUILD_LDFLAGS += -EB
113113
endif
114114

115-
export ld-bfd
115+
export ld_bfd
116116

117117
# Mach groups
118118
machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se

arch/sh/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727

2828
ccflags-remove-$(CONFIG_MCOUNT) += -pg
2929

30-
LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
30+
LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(IMAGE_OFFSET) -e startup \
3131
-T $(obj)/../../kernel/vmlinux.lds
3232

3333
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -51,7 +51,7 @@ $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
5151

5252
OBJCOPYFLAGS += -R .empty_zero_page
5353

54-
LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
54+
LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
5555

5656
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
5757
$(call if_changed,ld)

arch/sh/boot/romimage/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mmcif-obj-$(CONFIG_CPU_SUBTYPE_SH7724) := $(obj)/mmcif-sh7724.o
1313
load-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-load-y)
1414
obj-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-obj-y)
1515

16-
LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(load-y) -e romstart \
16+
LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(load-y) -e romstart \
1717
-T $(obj)/../../kernel/vmlinux.lds
1818

1919
$(obj)/vmlinux: $(obj)/head.o $(obj-y) $(obj)/piggy.o FORCE
@@ -24,7 +24,7 @@ OBJCOPYFLAGS += -j .empty_zero_page
2424
$(obj)/zeropage.bin: vmlinux FORCE
2525
$(call if_changed,objcopy)
2626

27-
LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
27+
LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
2828

2929
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE
3030
$(call if_changed,ld)

0 commit comments

Comments
 (0)