diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-03-10 20:28:14 +0900 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-11 16:11:39 +0100 |
commit | 739a49a9738280736698f0e15169e0be14cac77a (patch) | |
tree | 819444a18d098343a18d356682588185c494f9ff | |
parent | 9e4fc459e1429ffa73122ef8ecce6f1739806540 (diff) | |
download | barebox-739a49a9738280736698f0e15169e0be14cac77a.tar.gz barebox-739a49a9738280736698f0e15169e0be14cac77a.tar.xz |
kbuild: rename barebox-pbl-common to BAREBOX_PBL_OBJS
'export barebox-pbl-common' does not work reliably because hyphens
are disallowed in shell variables.
This caused a problem in Linux in the past. See Linux commit 2bfbe7881ee0
("kbuild: Do not use hyphen in exported variable name").
The same problem occurs when you build barebox with O= and the directory
path to the source tree contains a shell special character like '~'.
The maintainer of GNU Make stated that there is no consistent way to
export variables that do not meet the shell's naming criteria.
(https://savannah.gnu.org/bugs/?55719)
Consequently, you cannot use hyphens in exported variables.
Rename barebox-pbl-common to BAREBOX_PBL_OBJS.
I named it after KBUILD_VMLINUX_OBJS in the Linux top Makefile.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | arch/mips/pbl/Makefile | 2 | ||||
-rw-r--r-- | images/Makefile | 4 |
3 files changed, 5 insertions, 6 deletions
@@ -584,8 +584,7 @@ export DEFAULT_COMPRESSION_SUFFIX # System.map is generated to document addresses of all kernel symbols barebox-common := $(common-y) -barebox-pbl-common := $(pbl-common-y) -export barebox-pbl-common +export BAREBOX_PBL_OBJS := $(pbl-common-y) barebox-all := $(barebox-common) barebox-lds := $(lds-y) @@ -777,7 +776,7 @@ barebox.srec: barebox # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(barebox-common) ) $(barebox-lds) $(barebox-pbl-common): $(barebox-dirs) ; +$(sort $(barebox-common) ) $(barebox-lds) $(BAREBOX_PBL_OBJS): $(barebox-dirs) ; # Handle descending into subdirectories listed in $(barebox-dirs) # Preset locale variables to speed up the build process. Limit locale diff --git a/arch/mips/pbl/Makefile b/arch/mips/pbl/Makefile index 44ce3d1c92..8f9e9fe593 100644 --- a/arch/mips/pbl/Makefile +++ b/arch/mips/pbl/Makefile @@ -25,7 +25,7 @@ $(obj)/zbarebox.S: $(obj)/zbarebox FORCE PBL_CPPFLAGS += -fdata-sections -ffunction-sections LDFLAGS_zbarebox := -Map $(obj)/zbarebox.map LDFLAGS_zbarebox += -static --gc-sections -zbarebox-common := $(barebox-pbl-common) $(obj)/$(piggy_o) +zbarebox-common := $(BAREBOX_PBL_OBJS) $(obj)/$(piggy_o) zbarebox-lds := $(obj)/zbarebox.lds quiet_cmd_zbarebox__ ?= LD $@ diff --git a/images/Makefile b/images/Makefile index 650baf170f..fe29c75e27 100644 --- a/images/Makefile +++ b/images/Makefile @@ -57,12 +57,12 @@ quiet_cmd_elf__ ?= LD $@ cmd_elf__ ?= $(LD) $(LDFLAGS_pbl) --gc-sections \ -e $(2) -Map $@.map $(LDFLAGS_$(@F)) -o $@ \ -T $(pbl-lds) \ - --start-group $(barebox-pbl-common) $(obj)/piggy.o \ + --start-group $(BAREBOX_PBL_OBJS) $(obj)/piggy.o \ $(obj)/sha_sum.o --end-group PBL_CPPFLAGS += -fdata-sections -ffunction-sections -$(obj)/%.pbl: $(pbl-lds) $(barebox-pbl-common) $(obj)/piggy.o $(obj)/sha_sum.o FORCE +$(obj)/%.pbl: $(pbl-lds) $(BAREBOX_PBL_OBJS) $(obj)/piggy.o $(obj)/sha_sum.o FORCE $(call if_changed,elf__,$(*F)) $(obj)/%.pblb: $(obj)/%.pbl FORCE |