From: "Bob Feng" <bob.c.feng@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"pierre.gondois@arm.com" <pierre.gondois@arm.com>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Sami.Mujawar@arm.com" <Sami.Mujawar@arm.com>,
"nd@arm.com" <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 2/2] BaseTools: Remove caret in NASM_INC macro
Date: Fri, 7 Feb 2020 07:14:12 +0000 [thread overview]
Message-ID: <260e8e0b8214418ea47b139b8c137fca@intel.com> (raw)
In-Reply-To: <20200206155147.61112-3-pierre.gondois@arm.com>
Hi Pierre,
This patch cause UefiCpuPkg build fail.
build -p UefiCpuPkg\UefiCpuPkg.dsc -a IA32 -t VS2015x86
Thanks,
Bob
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of PierreGondois
Sent: Thursday, February 6, 2020 11:52 PM
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; Sami.Mujawar@arm.com; pierre.gondois@arm.com; nd@arm.com
Subject: [edk2-devel] [PATCH v3 2/2] BaseTools: Remove caret in NASM_INC macro
From: Pierre Gondois <pierre.gondois@arm.com>
NASM_INC contains the list of directory to include when using the nasm assembler.
In nmake makefiles, a trailing backslash escapes the newline char and replaces it with a space ' '. To have a literal trailing backslash, it must be escaped with a caret '^'. This is not necessary for GNU makefiles.
On windows platforms, for the NASM_INC macro, a caret escaping a trailing a backslash was appended to the last included folder regardless of the makefile type.
For instance, "/Include/" was replaced by "/Include/^\".
This is causing a build failure on windows platforms using GNU makefiles since the caret '^' doesn't escape any chars in GNU makefiles and is thus conserved.
"/Include^\" was replaced by "/Include\/" in nmake makefiles, but remained "/Include/^\" in GNU makefiles.
Escaping the trailing backslash in nmake makefiles on windows platforms is not needed because:
* folder names don't require to end with a slash '/' or
a backslash '\'.
* a trailing backslash replaces the newline char by a space ' ',
which is not difference from a newline char in macros.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
BaseTools/Source/Python/AutoGen/GenMake.py | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index b036f726db144c13e98b9e0fb021cb3855ec8e55..b2b27d43fe18e89ebdfdf8456f439c52759a4d9e 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -608,19 +608,10 @@ cleanlib:
IncludePathList = []
asmsource = [item for item in MyAgo.SourceFileList if item.File.upper().endswith((".NASM",".ASM",".NASMB","S"))]
if asmsource:
- for P in MyAgo.IncludePathList:
+ for P in MyAgo.IncludePathList:
IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P, self.Macros)
- if IncludePath.endswith(os.sep):
- IncludePath = IncludePath.rstrip(os.sep)
- # When compiling .nasm files, need to add a literal backslash at each path
- # To specify a literal backslash at the end of the line, precede it with a caret (^)
- if P == MyAgo.IncludePathList[-1] and os.sep == '\\':
- IncludePath = ''.join([IncludePath, '^', os.sep])
- else:
- IncludePath = os.path.join(IncludePath, '')
- IncludePathList.append(IncludePath)
+ IncludePathList.append(os.path.join(IncludePath, ''))
FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC", "source_file": IncludePathList}))
-
# Generate macros used to represent files containing list of input files
for ListFileMacro in self.ListFileMacros:
ListFileName = os.path.join(MyAgo.OutputDir, "%s.lst" % ListFileMacro.lower()[:len(ListFileMacro) - 5])
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
next prev parent reply other threads:[~2020-02-07 7:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 15:51 [PATCH v3 0/2] BaseTools: Rationalise makefile generation PierreGondois
2020-02-06 15:51 ` [PATCH v3 1/2] " PierreGondois
2020-02-06 15:51 ` [PATCH v3 2/2] BaseTools: Remove caret in NASM_INC macro PierreGondois
2020-02-07 7:14 ` Bob Feng [this message]
2020-02-10 13:29 ` [edk2-devel] " PierreGondois
2020-02-11 13:29 ` Bob Feng
2020-02-11 14:20 ` PierreGondois
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=260e8e0b8214418ea47b139b8c137fca@intel.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