sh: Do not use hyphen in exported variable names
authorBen Hutchings <ben@decadent.org.uk>
Sat, 19 Aug 2017 20:42:09 +0000 (21:42 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 26 Sep 2019 12:19:06 +0000 (13:19 +0100)
arch/sh/Makefile defines and exports ld-bfd to be used by
arch/sh/boot/Makefile and arch/sh/boot/compressed/Makefile.  Similarly
arch/sh/boot/Makefile defines and exports suffix-y to be used by
arch/sh/boot/compressed/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.

Rename these variables to ld_bfd and suffix_y.

References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=4.13%7Erc5-1%7Eexp1&stamp=1502943967&raw=0
Fixes: ef9b542fce00 ("sh: bzip2/lzma uImage support.")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/sh
Gbp-Pq: Name sh-boot-do-not-use-hyphen-in-exported-variable-name.patch

arch/sh/Makefile
arch/sh/boot/Makefile
arch/sh/boot/compressed/Makefile
arch/sh/boot/romimage/Makefile

index 185702f2ced014c0c886dba334d204598e3605c1..5f6e14584542be9dbaad1f038de5deaf234b5944 100644 (file)
@@ -119,16 +119,16 @@ LDFLAGS_vmlinux           += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
 endif
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
-ld-bfd                 := elf32-$(UTS_MACHINE)-linux
-LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
+ld_bfd                 := elf32-$(UTS_MACHINE)-linux
+LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64 --oformat $(ld_bfd)
 KBUILD_LDFLAGS         += -EL
 else
-ld-bfd                 := elf32-$(UTS_MACHINE)big-linux
-LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
+ld_bfd                 := elf32-$(UTS_MACHINE)big-linux
+LDFLAGS_vmlinux                += --defsym jiffies=jiffies_64+4 --oformat $(ld_bfd)
 KBUILD_LDFLAGS         += -EB
 endif
 
-export ld-bfd BITS
+export ld_bfd BITS
 
 head-y := arch/sh/kernel/head_$(BITS).o
 
index 58592dfa5cb602ed58eb34dcdead6f1cc66755c6..296b25474395f5a29e2e6fff49a8a04bdafc288c 100644 (file)
@@ -19,12 +19,12 @@ CONFIG_ZERO_PAGE_OFFSET     ?= 0x00001000
 CONFIG_ENTRY_OFFSET    ?= 0x00001000
 CONFIG_PHYSICAL_START  ?= $(CONFIG_MEMORY_START)
 
-suffix-y := bin
-suffix-$(CONFIG_KERNEL_GZIP)   := gz
-suffix-$(CONFIG_KERNEL_BZIP2)  := bz2
-suffix-$(CONFIG_KERNEL_LZMA)   := lzma
-suffix-$(CONFIG_KERNEL_XZ)     := xz
-suffix-$(CONFIG_KERNEL_LZO)    := lzo
+suffix_y := bin
+suffix_$(CONFIG_KERNEL_GZIP)   := gz
+suffix_$(CONFIG_KERNEL_BZIP2)  := bz2
+suffix_$(CONFIG_KERNEL_LZMA)   := lzma
+suffix_$(CONFIG_KERNEL_XZ)     := xz
+suffix_$(CONFIG_KERNEL_LZO)    := lzo
 
 targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
           uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
@@ -106,10 +106,10 @@ OBJCOPYFLAGS_uImage.srec := -I binary -O srec
 $(obj)/uImage.srec: $(obj)/uImage
        $(call if_changed,objcopy)
 
-$(obj)/uImage: $(obj)/uImage.$(suffix-y)
+$(obj)/uImage: $(obj)/uImage.$(suffix_y)
        @ln -sf $(notdir $<) $@
        @echo '  Image $@ is ready'
 
 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
        CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
-       KERNEL_MEMORY suffix-y
+       KERNEL_MEMORY suffix_y
index f5e1bd77978924d88fd098b3e223dd67da17f2fb..dd130d3d8586c899c336c6a97a3129d31cb73c99 100644 (file)
@@ -33,7 +33,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
 endif
 
-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
 
 #
@@ -75,7 +75,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
+$(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)