From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: devel@edk2.groups.io, derek.lin2@hpe.com
Cc: bob.c.feng@intel.com, liming.gao@intel.com, zhijux.fan@intel.com
Subject: Re: [edk2-devel] [PATCH] BaseTools: Fix an incremental build issue caused by macro in #include
Date: Wed, 16 Oct 2019 13:53:58 +0200 [thread overview]
Message-ID: <7bc1022a-d6c4-437d-e710-ba6ec0a72d65@redhat.com> (raw)
In-Reply-To: <20191016061726.122168-1-derek.lin2@hpe.com>
Hi Derek,
On 10/16/19 8:17 AM, Lin, Derek (HPS SW) wrote:
> When c/h file use macro after #include, for example,
Apparently you forgot to write your example.
> In this case, GenMake is not able to create a healthy dependency for the c
> file. GenMake used to add $(FORCE_REBUILD) dependency in the c file, this
> guarantee the c file is always compiled in incremental build. But, this
> function is broken since 05217d210e8da37b47d0be58ec363f7af2fa1c18 which
> enable /MP for MSVC compiler, in order to compile multiple c files in one
> command multi-processing. The fix here is adding '$(FORCE_REBUILD)' back to
> retain the original function.
>
> Line number 1728 and 978 are the code pieces which handle this logic.
>
> Signed-off-by: Derek Lin <derek.lin2@hpe.com>
> ---
> BaseTools/Source/Python/AutoGen/GenMake.py | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
> index 97ba158ff2..59a01a7f24 100755
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -1080,13 +1080,17 @@ cleanlib:
> else:
> CmdCppDict[item.Target.SubDir] = ['$(MAKE_FILE)', Path]
> if CppPath.Path in DependencyDict:
> - for Temp in DependencyDict[CppPath.Path]:
> - try:
> - Path = self.PlaceMacro(Temp.Path, self.Macros)
> - except:
> - continue
> - if Path not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
> - CmdCppDict[item.Target.SubDir].append(Path)
> + if '$(FORCE_REBUILD)' in DependencyDict[CppPath.Path]:
> + if '$(FORCE_REBUILD)' not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
> + CmdCppDict[item.Target.SubDir].append('$(FORCE_REBUILD)')
> + else:
> + for Temp in DependencyDict[CppPath.Path]:
> + try:
> + Path = self.PlaceMacro(Temp.Path, self.Macros)
> + except:
> + continue
> + if Path not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
> + CmdCppDict[item.Target.SubDir].append(Path)
> if T.Commands:
> CommandList = T.Commands[:]
> for Item in CommandList[:]:
>
next prev parent reply other threads:[~2019-10-16 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 6:17 [PATCH] BaseTools: Fix an incremental build issue caused by macro in #include Lin, Derek (HPS SW)
2019-10-16 11:53 ` Philippe Mathieu-Daudé [this message]
2019-10-17 0:38 ` [edk2-devel] " Bob Feng
2019-10-17 2:02 ` Lin, Derek (HPS SW)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7bc1022a-d6c4-437d-e710-ba6ec0a72d65@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox