Commit 395e60cdc292dc0183c6867d34b43f14a373df55

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 519fdde9e6

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,...).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>

Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -1053,11 +1053,11 @@
1053 1053  
1054 1054 # ---------------------------------------------------------------------------
1055 1055 quiet_cmd_cpp_lds = LDS $@
1056   -cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
1057   - -x assembler-with-cpp -P -o $@ $<
  1056 +cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
  1057 + -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
1058 1058  
1059 1059 u-boot.lds: $(LDSCRIPT) prepare FORCE
1060   - $(call if_changed,cpp_lds)
  1060 + $(call if_changed_dep,cpp_lds)
1061 1061  
1062 1062 PHONY += nand_spl
1063 1063 nand_spl: prepare
... ... @@ -231,11 +231,11 @@
231 231 $(Q)$(MAKE) $(build)=$@
232 232  
233 233 quiet_cmd_cpp_lds = LDS $@
234   -cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
235   - -x assembler-with-cpp -P -o $@ $<
  234 +cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
  235 + -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
236 236  
237 237 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
238   - $(call if_changed,cpp_lds)
  238 + $(call if_changed_dep,cpp_lds)
239 239  
240 240 # read all saved command lines
241 241