]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sh: Do not use hyphen in exported variable name
authorBen Hutchings <benh@debian.org>
Thu, 17 Jul 2025 14:47:32 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:22:35 +0000 (16:22 +0200)
[ Upstream commit c32969d0362a790fbc6117e0b6a737a7e510b843 ]

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
2bfbe7881ee0 "kbuild: Do not use hyphen in exported variable name"
and 82977af93a0d "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: 7b022d07a0fd ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/sh/Makefile
arch/sh/boot/compressed/Makefile
arch/sh/boot/romimage/Makefile

index 2faebfd72ecab5a4f1aa85c1dd1da40d8e66e08d..8e8e24227fffd80304ecd605ce96b76e2d90da69 100644 (file)
@@ -103,16 +103,16 @@ UTS_MACHINE               := sh
 LDFLAGS_vmlinux                += -e _stext
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
-ld-bfd                 := elf32-sh-linux
-LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
+ld_bfd                 := elf32-sh-linux
+LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64 --oformat $(ld_bfd)
 KBUILD_LDFLAGS         += -EL
 else
-ld-bfd                 := elf32-shbig-linux
-LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
+ld_bfd                 := elf32-shbig-linux
+LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64+4 --oformat $(ld_bfd)
 KBUILD_LDFLAGS         += -EB
 endif
 
-export ld-bfd
+export ld_bfd
 
 head-y := arch/sh/kernel/head_32.o
 
index 589d2d8a573dbde48d0b45ff08f38333f58b7b21..d4baaaace17f57cc3ed3e241910eac2430843abe 100644 (file)
@@ -30,7 +30,7 @@ endif
 
 ccflags-remove-$(CONFIG_MCOUNT) += -pg
 
-LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
+LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(IMAGE_OFFSET) -e startup \
                   -T $(obj)/../../kernel/vmlinux.lds
 
 #
@@ -68,7 +68,7 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
 
 OBJCOPYFLAGS += -R .empty_zero_page
 
-LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
+LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T
 
 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
        $(call if_changed,ld)
index c7c8be58400cd9b2dfba20c85060434089e418a2..17b03df0a8de4da6567225e61a73cedf585b3063 100644 (file)
@@ -13,7 +13,7 @@ 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 \
+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
@@ -24,7 +24,7 @@ OBJCOPYFLAGS += -j .empty_zero_page
 $(obj)/zeropage.bin: vmlinux FORCE
        $(call if_changed,objcopy)
 
-LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
+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)