Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394914

[PATCH] kbuild: fix if_change and friends to consider argument order

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject [PATCH] kbuild: fix if_change and friends to consider argument order
Date 2016-05-05 09:50 +0200
Message-ID <rvmcO-3Ju-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Currently, arg-check is implemented as follows:

  arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
                      $(filter-out $(cmd_$@),   $(cmd_$(1))) )

This does not care about the order of arguments that appear in
$(cmd_$(1)) and $(cmd_$@).  So, if_changed and friends never rebuild
the target if only the argument order is changed.  This is a problem
when the link order is changed.

Apparently,

  obj-y += foo.o
  obj-y += bar.o

and

  obj-y += bar.o
  obj-y += foo.o

should be distinguished because the link order determines the probe
order of drivers.  So, built-in.o should be rebuilt if the order of
objects is changed.

This commit fixes arg-check to compare two strings as a whole.
$(strip ...) is important because we want to ignore the difference
that comes from white-spaces.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Kbuild.include | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index b2ab2a9..2d03480 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -228,8 +228,8 @@ objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
 ifneq ($(KBUILD_NOCMDDEP),1)
 # Check if both arguments has same arguments. Result is empty string if equal.
 # User may override this check using make KBUILD_NOCMDDEP=1
-arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
-                    $(filter-out $(cmd_$@),   $(cmd_$(1))) )
+arg-check = $(filter-out $(quote)$(strip $(cmd_$1))$(quote), \
+                         $(quote)$(strip $(cmd_$@))$(quote))
 else
 arg-check = $(if $(strip $(cmd_$@)),,1)
 endif
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] kbuild: fix if_change and friends to consider argument order Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-05 09:50 +0200
  Re: [PATCH] kbuild: fix if_change and friends to consider argument  order "Woodhouse, David" <david.woodhouse@intel.com> - 2016-05-05 10:10 +0200
    Re: [PATCH] kbuild: fix if_change and friends to consider argument order Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-05 17:00 +0200
      Re: [PATCH] kbuild: fix if_change and friends to consider argument order Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-05 20:10 +0200
    Re: [PATCH] kbuild: fix if_change and friends to consider argument order Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-06 04:20 +0200

csiph-web