From: Pete Batard <pete@akeo.ie>
To: edk2-devel@lists.01.org
Cc: liming.gao@intel.com, ard.biesheuvel@linaro.org
Subject: [PATCH v4 6/6] BaseTools/Conf: Add VS2017/ARM support
Date: Wed, 10 Jan 2018 16:26:44 +0000 [thread overview]
Message-ID: <20180110162644.11208-7-pete@akeo.ie> (raw)
In-Reply-To: <20180110162644.11208-1-pete@akeo.ie>
We duplicate the Assembly-Code-File section from build_rule.template
because --convert-hex cannot be used with the MSFT ARM assembler.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
---
BaseTools/Conf/build_rule.template | 31 +++++++++++++++++++-
BaseTools/Conf/tools_def.template | 31 ++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index 3e6aa8ff0f34..6ea14fb7aa02 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -182,7 +182,6 @@
<Command>
-
[Assembly-Code-File.COMMON.COMMON]
<InputFile.MSFT, InputFile.INTEL, InputFile.RVCT>
?.asm, ?.Asm, ?.ASM
@@ -207,6 +206,36 @@
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
+[Assembly-Code-File.COMMON.ARM]
+ # Remove --convert-hex for ARM as it breaks MSFT assemblers
+ <InputFile.MSFT, InputFile.INTEL, InputFile.RVCT>
+ ?.asm, ?.Asm, ?.ASM
+
+ <InputFile.GCC, InputFile.GCCLD>
+ ?.S, ?.s
+
+ <ExtraDependency>
+ $(MAKE_FILE)
+
+ <OutputFile>
+ $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
+
+ <Command.INTEL>
+ "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
+ Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
+ "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
+
+ <Command.MSFT>
+ "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
+ Trim --source-code --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
+ "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
+
+ <Command.GCC, Command.GCCLD, Command.RVCT>
+ "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
+ Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
+ # For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
+ "$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
+
[Nasm-Assembly-Code-File.COMMON.COMMON]
<InputFile>
?.nasm
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 98ab6dd45e81..f76c4da05938 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -79,6 +79,7 @@ DEFINE VS2017_HOST = x86
DEFINE VS2017_BIN_HOST = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\DEF(VS2017_HOST)
DEFINE VS2017_BIN_IA32 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x86
DEFINE VS2017_BIN_X64 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
+DEFINE VS2017_BIN_ARM = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
DEFINE WINSDK_BIN = ENV(WINSDK_PREFIX)
DEFINE WINSDKx86_BIN = ENV(WINSDKx86_PREFIX)
@@ -335,6 +336,9 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
# Required to build platforms or ACPI tables:
# Intel(r) ACPI Compiler (iasl.exe) from
# https://acpica.org/downloads
+# Note:
+# Building of XIP firmware images for ARM is not currently supported (only applications).
+# /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
# DDK3790 -win32- Requires:
# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
# Optional:
@@ -4169,6 +4173,33 @@ NOOPT_VS2017_X64_NASM_FLAGS = -O0 -f win64 -g
RELEASE_VS2017_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
NOOPT_VS2017_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+#################
+# ARM definitions
+#################
+*_VS2017_ARM_CC_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_VFRPP_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_SLINK_PATH = DEF(VS2017_BIN_ARM)\lib.exe
+*_VS2017_ARM_DLINK_PATH = DEF(VS2017_BIN_ARM)\link.exe
+*_VS2017_ARM_APP_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_PP_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_ASM_PATH = DEF(VS2017_BIN_ARM)\armasm.exe
+*_VS2017_ARM_ASLCC_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_ASLPP_PATH = DEF(VS2017_BIN_ARM)\cl.exe
+*_VS2017_ARM_ASLDLINK_PATH = DEF(VS2017_BIN_ARM)\link.exe
+
+ *_VS2017_ARM_MAKE_FLAGS = /nologo
+ DEBUG_VS2017_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi-
+RELEASE_VS2017_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi-
+NOOPT_VS2017_ARM_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi-
+
+ DEBUG_VS2017_ARM_ASM_FLAGS = /nologo /g
+RELEASE_VS2017_ARM_ASM_FLAGS = /nologo
+NOOPT_VS2017_ARM_ASM_FLAGS = /nologo
+
+ DEBUG_VS2017_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+RELEASE_VS2017_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
+NOOPT_VS2017_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+
##################
# EBC definitions
##################
--
2.9.3.windows.2
prev parent reply other threads:[~2018-01-10 16:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 16:26 [PATCH v4 0/6] Add ARM support for VS2017 Pete Batard
2018-01-10 16:26 ` [PATCH v4 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM Pete Batard
2018-01-10 16:26 ` [PATCH v4 2/6] MdePkg/Library/BaseStackCheckLib: Add Null handler " Pete Batard
2018-01-10 16:26 ` [PATCH v4 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds Pete Batard
2018-01-10 16:26 ` [PATCH v4 4/6] ArmPkg/Library/CompilerIntrinsicsLib: " Pete Batard
2018-01-11 10:46 ` Ard Biesheuvel
2018-01-11 15:30 ` Cohen, Eugene
2018-01-11 16:31 ` Pete Batard
2018-01-11 16:56 ` Cohen, Eugene
2018-01-12 9:58 ` Ard Biesheuvel
2018-01-12 11:10 ` Pete Batard
2018-01-12 13:25 ` Ard Biesheuvel
2018-01-10 16:26 ` [PATCH v4 5/6] MdePkg/Include: Add VA list support for VS2017/ARM Pete Batard
2018-01-10 16:26 ` Pete Batard [this message]
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=20180110162644.11208-7-pete@akeo.ie \
--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