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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 07, 2016 at 03:48:26PM +0900, Masahiro Yamada wrote:
> 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 when the order
> of objects is changed.
> 
> This commit fixes arg-check to compare the old/current commands
> including the argument order.
> 
> Of course, this change has a side effect; Kbuild will react to the
> change of compile option order.  For example, "-DFOO -DBAR" and
> "-DBAR -DFOO" should give no difference to the build result, but
> false positive should be better than false negative.

Agreed. Applied to kbuild.git#kbuild now.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux