Skip to contentSkip to conversation

kbuild: fix a bug in regeneration of linker scripts

PATCH In review Masahiro Yamada 3 participants 3 messages Apr 9, 2014 – Apr 11, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: fix a bug in regeneration of linker scripts

In some use cases, SPL linker script was not updated even when it should be.

For instance,

  $ make tricoder_config all
    [ build complete ]
  ... modify include/configs/tricoder.h
  $ make

spl/u-boot-spl.lds should be updated in this case, but it wasn't.

To fix this problem, linker scripts generation should be handled by $(call if_changed_dep,...) rather than by $(call if_changed,...).

---

 Makefile     | 6 +++---
 spl/Makefile | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
Makefile +3 -3
index b807e5c..b2937e9 100644
@@ -1053,11 +1053,11 @@ depend dep:
 
 # ---------------------------------------------------------------------------
 quiet_cmd_cpp_lds = LDS     $@
-cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
-		-x assembler-with-cpp -P -o $@ $<
+cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+		-D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
 
 u-boot.lds: $(LDSCRIPT) prepare FORCE
-	$(call if_changed,cpp_lds)
+	$(call if_changed_dep,cpp_lds)
 
 PHONY += nand_spl
 nand_spl: prepare
spl/Makefile +3 -3
index 9f5dbf4..6fec252 100644
@@ -231,11 +231,11 @@ $(u-boot-spl-dirs):
 	$(Q)$(MAKE) $(build)=$@
 
 quiet_cmd_cpp_lds = LDS     $@
-cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
-		-x assembler-with-cpp -P -o $@ $<
+cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+		-D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
 
 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
-	$(call if_changed,cpp_lds)
+	$(call if_changed_dep,cpp_lds)
 
 # read all saved command lines
 
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 kbuild: fix a bug in regeneration of linker scripts

Quoted 10 lines · Masahiro Yamada

In some use cases, SPL linker script was not updated even when it should be.

For instance,

  $ make tricoder_config all
    [ build complete ]
  ... modify include/configs/tricoder.h
  $ make
Quoted 7 lines

spl/u-boot-spl.lds should be updated in this case, but it wasn't.

To fix this problem, linker scripts generation should be handled by $(call if_changed_dep,...) rather than by $(call if_changed,...).

#2 lore raw
In reply to Masahiro Yamada
Quoted 10 lines · Masahiro Yamada

In some use cases, SPL linker script was not updated even when it should be.

For instance,

  $ make tricoder_config all
    [ build complete ]
  ... modify include/configs/tricoder.h
  $ make
Quoted 8 lines

spl/u-boot-spl.lds should be updated in this case, but it wasn't.

To fix this problem, linker scripts generation should be handled by $(call if_changed_dep,...) rather than by $(call if_changed,...).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140411/1ec3363f/attachment.pgp>