Re: [GIT PULL 1/2] Kbuild updates for v4.15
From: Masahiro Yamada
Date: Sun Nov 19 2017 - 07:21:46 EST
Hi Linus,
2017-11-18 10:51 GMT+09:00 Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>:
> On Fri, Nov 17, 2017 at 9:22 AM, Masahiro Yamada
> <yamada.masahiro@xxxxxxxxxxxxx> wrote:
>>
>> Here are Kbuild updates for v4.15. Please pull!
>
> Mind checking that I got the CFLAGS_KCOV behavior right. The conflict
> looked pretty simple, but somebody should check the ordering of the
>
> export CFLAGS_KCOV
>
> vs the actual setting (that is now in scripts/Makefile.kcov.
>
> It probably doesn't matter, but our makefiles are black magic.
>
> Linus
Strictly speaking, there is a case where the placement of "export"
make a difference.
-----(example1)-----
BAR := bar
FOO += $(BAR)
export FOO
BAR := bar2
---------------------
-----(example2)-----
BAR := bar
export FOO
FOO += $(BAR)
BAR := bar2
---------------------
In example1, the exported value for FOO is "bar2"
whereas, in example2, "bar".
The difference probably comes "export" implies
":=" flavor initialization if not explicitly initialized yet.
To avoid confusion, we should explicitly use either ":=" or "=", though.
Talking about the kcov case, CFLAGS_KCOV is initialized by ":="
in scripts/Malefile.kcov, so it should work as we expect.
(In my personal preference, I'd like collect
the kcov stuff into scripts/Makefile.kcof, but
it is just a matter of slight taste.)
--
Best Regards
Masahiro Yamada