public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Add VS2017 tool chain for evaluation
@ 2017-11-22 16:26 Pete Batard
  2017-11-22 16:26 ` [PATCH v3 1/4] MdePkg: Disable VS warning 4701 & 4703 for VS2017 Pete Batard
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Pete Batard @ 2017-11-22 16:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

This is a re-send of v2, with a small comment update to indicate that
VS2017 v15.2 or later is required, due to the vswhere.exe requirement.

This patch serial adds VS2017 tool chain in BaseTools tools_def.template.
It enables /WHOLEARCHIVE option to detect the potential code issue.
It can be used to build source code with Visual Studio 2017 on 32bit or
64bit Windows OS. After this tool chain is evaluated, ASL, ARM and ARM64
support can be provided.
And, to avoid more duplicated informations be introduced, the proposal to
simplify tools_def.template will be provided.


Liming Gao (4):
  MdePkg: Disable VS warning 4701 & 4703 for VS2017
  BaseTools: Add VS2017 tool chain in BaseTools tools_def.template
  BaseTools: Update VS batch file to auto detect VS2017
  Nt32Pkg: Add VS2017 support in SecMain

 BaseTools/Conf/tools_def.template   | 126 ++++++++++++++++++++
 BaseTools/get_vsvars.bat            |   8 ++
 BaseTools/set_vsprefix_envs.bat     |  33 ++++-
 MdePkg/Include/Ia32/ProcessorBind.h |   4 +-
 MdePkg/Include/X64/ProcessorBind.h  |   4 +-
 Nt32Pkg/Sec/SecMain.inf             |   2 +
 6 files changed, 172 insertions(+), 5 deletions(-)

-- 
2.9.3.windows.2



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/4] MdePkg: Disable VS warning 4701 & 4703 for VS2017
  2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
@ 2017-11-22 16:26 ` Pete Batard
  2017-11-22 16:26 ` [PATCH v3 2/4] BaseTools: Add VS2017 tool chain in BaseTools tools_def.template Pete Batard
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Pete Batard @ 2017-11-22 16:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

From: Liming Gao <liming.gao@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 MdePkg/Include/Ia32/ProcessorBind.h | 4 ++--
 MdePkg/Include/X64/ProcessorBind.h  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Ia32/ProcessorBind.h b/MdePkg/Include/Ia32/ProcessorBind.h
index 8ba2348261a2..aeecf3fa9feb 100644
--- a/MdePkg/Include/Ia32/ProcessorBind.h
+++ b/MdePkg/Include/Ia32/ProcessorBind.h
@@ -1,7 +1,7 @@
 /** @file
   Processor or Compiler specific defines and types for IA-32 architecture.
 
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available under 
 the terms and conditions of the BSD License that accompanies this distribution.  
 The full text of the license may be found at
@@ -93,7 +93,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //
 #pragma warning ( disable : 4206 )
 
-#if _MSC_VER == 1800 || _MSC_VER == 1900
+#if _MSC_VER == 1800 || _MSC_VER == 1900 || _MSC_VER >= 1910
 
 //
 // Disable these warnings for VS2013.
diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h
index 72cc85151cba..e637d8649f57 100644
--- a/MdePkg/Include/X64/ProcessorBind.h
+++ b/MdePkg/Include/X64/ProcessorBind.h
@@ -1,7 +1,7 @@
 /** @file
   Processor or Compiler specific defines and types x64 (Intel 64, AMD64).
 
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials                          
   are licensed and made available under the terms and conditions of the BSD License         
   which accompanies this distribution.  The full text of the license may be found at        
@@ -107,7 +107,7 @@
 //
 #pragma warning ( disable : 4206 )
 
-#if _MSC_VER == 1800 || _MSC_VER == 1900
+#if _MSC_VER == 1800 || _MSC_VER == 1900 || _MSC_VER >= 1910
 
 //
 // Disable these warnings for VS2013.
-- 
2.9.3.windows.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/4] BaseTools: Add VS2017 tool chain in BaseTools tools_def.template
  2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
  2017-11-22 16:26 ` [PATCH v3 1/4] MdePkg: Disable VS warning 4701 & 4703 for VS2017 Pete Batard
@ 2017-11-22 16:26 ` Pete Batard
  2017-11-22 16:26 ` [PATCH v3 3/4] BaseTools: Update VS batch file to auto detect VS2017 Pete Batard
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Pete Batard @ 2017-11-22 16:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

From: Liming Gao <liming.gao@intel.com>

VS2017 tool chain enables /WHOLEARCHIVE linker option
Split host-related and arch-related elements

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 BaseTools/Conf/tools_def.template | 126 ++++++++++++++++++++
 1 file changed, 126 insertions(+)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index aebd7d558633..5526c5bda761 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -74,6 +74,12 @@ DEFINE VS2015x86_BIN    = ENV(VS2015_PREFIX)Vc\bin
 DEFINE VS2015x86_DLL    = ENV(VS2015_PREFIX)Common7\IDE;DEF(VS2015x86_BIN)
 DEFINE VS2015x86_BINX64 = DEF(VS2015x86_BIN)\x86_amd64
 
+DEFINE VS2017_BIN         = ENV(VS2017_PREFIX)bin
+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 WINSDK_BIN       = ENV(WINSDK_PREFIX)
 DEFINE WINSDKx86_BIN    = ENV(WINSDKx86_PREFIX)
 
@@ -93,6 +99,9 @@ DEFINE WINSDK8x86_BIN    = ENV(WINSDK8x86_PREFIX)x64
 DEFINE WINSDK81_BIN       = ENV(WINSDK81_PREFIX)x86\
 DEFINE WINSDK81x86_BIN    = ENV(WINSDK81x86_PREFIX)x64
 
+# Microsoft Visual Studio 2017 Professional Edition
+DEFINE WINSDK10_BIN       = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
+
 # These defines are needed for certain Microsoft Visual Studio tools that
 # are used by other toolchains.  An example is that ICC on Windows normally
 # uses Microsoft's nmake.exe.
@@ -318,6 +327,14 @@ 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
+#   VS2017      -win32-  Requires:
+#                             Microsoft Visual Studio 2017 version 15.2 or later
+#                        Optional:
+#                             Required to build EBC drivers:
+#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
+#                             Required to build platforms or ACPI tables:
+#                               Intel(r) ACPI Compiler (iasl.exe) from
+#                               https://acpica.org/downloads
 #   DDK3790     -win32-  Requires:
 #                             Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
 #                        Optional:
@@ -4062,6 +4079,115 @@ NOOPT_VS2015x86xASL_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT
 
 
 ####################################################################################
+#   VS2017       - Microsoft Visual Studio 2017 with Intel ASL
+#   ASL          - Intel ACPI Source Language Compiler (iasl.exe)
+####################################################################################
+#   VS2017           - Microsoft Visual Studio 2017 professional Edition with Intel ASL
+*_VS2017_*_*_FAMILY        = MSFT
+*_VS2017_*_*_DLL           = DEF(VS2017_BIN_HOST)
+
+*_VS2017_*_MAKE_PATH       = DEF(VS2017_BIN_HOST)\nmake.exe
+*_VS2017_*_MAKE_FLAG       = /nologo
+*_VS2017_*_RC_PATH         = DEF(WINSDK10_BIN)\rc.exe
+
+*_VS2017_*_MAKE_FLAGS      = /nologo
+*_VS2017_*_SLINK_FLAGS     = /NOLOGO /LTCG
+*_VS2017_*_APP_FLAGS       = /nologo /E /TC
+*_VS2017_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h
+*_VS2017_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
+*_VS2017_*_DLINK2_FLAGS    = /WHOLEARCHIVE
+*_VS2017_*_ASM16_PATH      = DEF(VS2017_BIN_IA32)\ml.exe
+
+##################
+# ASL definitions
+##################
+*_VS2017_*_ASL_PATH        = DEF(WIN_IASL_BIN)
+*_VS2017_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)
+*_VS2017_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
+*_VS2017_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)
+*_VS2017_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)
+*_VS2017_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)
+
+##################
+# IA32 definitions
+##################
+*_VS2017_IA32_CC_PATH      = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_VFRPP_PATH   = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_ASLCC_PATH   = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_ASLPP_PATH   = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_SLINK_PATH   = DEF(VS2017_BIN_IA32)\lib.exe
+*_VS2017_IA32_DLINK_PATH   = DEF(VS2017_BIN_IA32)\link.exe
+*_VS2017_IA32_ASLDLINK_PATH= DEF(VS2017_BIN_IA32)\link.exe
+*_VS2017_IA32_APP_PATH     = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_PP_PATH      = DEF(VS2017_BIN_IA32)\cl.exe
+*_VS2017_IA32_ASM_PATH     = DEF(VS2017_BIN_IA32)\ml.exe
+
+      *_VS2017_IA32_MAKE_FLAGS  = /nologo
+  DEBUG_VS2017_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
+RELEASE_VS2017_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
+NOOPT_VS2017_IA32_CC_FLAGS      = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
+
+  DEBUG_VS2017_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
+RELEASE_VS2017_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
+NOOPT_VS2017_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
+
+  DEBUG_VS2017_IA32_NASM_FLAGS  = -Ox -f win32 -g
+RELEASE_VS2017_IA32_NASM_FLAGS  = -Ox -f win32
+NOOPT_VS2017_IA32_NASM_FLAGS    = -O0 -f win32 -g
+
+  DEBUG_VS2017_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+RELEASE_VS2017_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
+NOOPT_VS2017_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+
+##################
+# X64 definitions
+##################
+*_VS2017_X64_CC_PATH       = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_PP_PATH       = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_APP_PATH      = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_VFRPP_PATH    = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_ASLCC_PATH    = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_ASLPP_PATH    = DEF(VS2017_BIN_X64)\cl.exe
+*_VS2017_X64_ASM_PATH      = DEF(VS2017_BIN_X64)\ml64.exe
+*_VS2017_X64_SLINK_PATH    = DEF(VS2017_BIN_X64)\lib.exe
+*_VS2017_X64_DLINK_PATH    = DEF(VS2017_BIN_X64)\link.exe
+*_VS2017_X64_ASLDLINK_PATH = DEF(VS2017_BIN_X64)\link.exe
+
+  DEBUG_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
+RELEASE_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
+NOOPT_VS2017_X64_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
+
+  DEBUG_VS2017_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi
+RELEASE_VS2017_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd
+NOOPT_VS2017_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
+
+  DEBUG_VS2017_X64_NASM_FLAGS   = -Ox -f win64 -g
+RELEASE_VS2017_X64_NASM_FLAGS   = -Ox -f win64
+NOOPT_VS2017_X64_NASM_FLAGS     = -O0 -f win64 -g
+
+  DEBUG_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
+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
+
+##################
+# EBC definitions
+##################
+*_VS2017_EBC_*_FAMILY            = INTEL
+
+*_VS2017_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe
+*_VS2017_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe
+*_VS2017_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe
+*_VS2017_EBC_SLINK_PATH          = DEF(VS2017_BIN_IA32)\link.exe
+*_VS2017_EBC_DLINK_PATH          = DEF(VS2017_BIN_IA32)\link.exe
+
+*_VS2017_EBC_MAKE_FLAGS          = /nologo
+*_VS2017_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h
+*_VS2017_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
+*_VS2017_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
+*_VS2017_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
+*_VS2017_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
+
+####################################################################################
 #
 # Microsoft Device Driver Kit 3790.1830 (IA-32, X64, Itanium, with Link Time Code Generation)
 # And Intel ACPI Compiler
-- 
2.9.3.windows.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/4] BaseTools: Update VS batch file to auto detect VS2017
  2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
  2017-11-22 16:26 ` [PATCH v3 1/4] MdePkg: Disable VS warning 4701 & 4703 for VS2017 Pete Batard
  2017-11-22 16:26 ` [PATCH v3 2/4] BaseTools: Add VS2017 tool chain in BaseTools tools_def.template Pete Batard
@ 2017-11-22 16:26 ` Pete Batard
  2017-11-22 16:26 ` [PATCH v3 4/4] Nt32Pkg: Add VS2017 support in SecMain Pete Batard
  2017-11-28  1:56 ` [PATCH v3 0/4] Add VS2017 tool chain for evaluation Zhu, Yonghong
  4 siblings, 0 replies; 7+ messages in thread
From: Pete Batard @ 2017-11-22 16:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

From: Liming Gao <liming.gao@intel.com>

This way depends on VS vswhere.exe to find VS2017 installed directory.
vswhere.exe starts in Visual Studio 2017 version 15.2.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 BaseTools/get_vsvars.bat        |  8 +++++
 BaseTools/set_vsprefix_envs.bat | 33 +++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat
index 7649e1dccf47..ba3e54d588cf 100644
--- a/BaseTools/get_vsvars.bat
+++ b/BaseTools/get_vsvars.bat
@@ -16,6 +16,12 @@
 @echo off
 goto  :main
 
+:set_vsvars
+for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
+  if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+)
+goto :EOF
+
 :read_vsvars
 @rem Do nothing if already found, otherwise call vsvars32.bat if there
 if defined VCINSTALLDIR goto :EOF
@@ -33,6 +39,8 @@ REM       (Or invoke the relevant vsvars32 file beforehand).
 
 :main
 if defined VCINSTALLDIR goto :done
+  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"  call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+  if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"       call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
   if defined VS140COMNTOOLS  call :read_vsvars  "%VS140COMNTOOLS%"
   if defined VS120COMNTOOLS  call :read_vsvars  "%VS120COMNTOOLS%"
   if defined VS110COMNTOOLS  call :read_vsvars  "%VS110COMNTOOLS%"
diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat
index b05b1d222083..ed83222a24c8 100644
--- a/BaseTools/set_vsprefix_envs.bat
+++ b/BaseTools/set_vsprefix_envs.bat
@@ -3,7 +3,7 @@
 @REM   however it may be executed directly from the BaseTools project folder
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.
 @REM
-@REM Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+@REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.<BR>
 @REM
 @REM This program and the accompanying materials are licensed and made available
 @REM under the terms and conditions of the BSD License which accompanies this
@@ -90,6 +90,37 @@ if defined VS140COMNTOOLS (
   )
 )
 
+@REM set VS2017
+if not defined VS150COMNTOOLS (
+  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+      if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+    )
+  ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+      if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+    )
+  ) else (
+    goto SetWinDDK
+  )
+)
+
+if defined VCToolsInstallDir (
+  if not defined VS2017_PREFIX (
+    set "VS2017_PREFIX=%VCToolsInstallDir%"
+  )
+)
+if not defined WINSDK10_PREFIX (
+  if defined WindowsSdkVerBinPath (
+    set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
+  ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
+    set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
+  ) else if exist "%ProgramFiles%\Windows Kits\10\bin" (
+    set "WINSDK10_PREFIX=%ProgramFiles%\Windows Kits\10\bin\"
+  )
+)
+
+:SetWinDDK
 if not defined WINDDK3790_PREFIX (
   set WINDDK3790_PREFIX=C:\WINDDK\3790.1830\bin\
 )
-- 
2.9.3.windows.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 4/4] Nt32Pkg: Add VS2017 support in SecMain
  2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
                   ` (2 preceding siblings ...)
  2017-11-22 16:26 ` [PATCH v3 3/4] BaseTools: Update VS batch file to auto detect VS2017 Pete Batard
@ 2017-11-22 16:26 ` Pete Batard
  2017-11-28  1:56 ` [PATCH v3 0/4] Add VS2017 tool chain for evaluation Zhu, Yonghong
  4 siblings, 0 replies; 7+ messages in thread
From: Pete Batard @ 2017-11-22 16:26 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

From: Liming Gao <liming.gao@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 Nt32Pkg/Sec/SecMain.inf | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf
index f2e1520b6dac..51f844c8526b 100644
--- a/Nt32Pkg/Sec/SecMain.inf
+++ b/Nt32Pkg/Sec/SecMain.inf
@@ -71,6 +71,7 @@ [BuildOptions]
   MSFT:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_VS2015_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_VS2015x86_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
+  MSFT:*_VS2017_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
   MSFT:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h
   MSFT:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
@@ -79,6 +80,7 @@ [BuildOptions]
   MSFT:*_*_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_VS2015_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_VS2015x86_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
+  MSFT:*_VS2017_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
   MSFT:*_*_X64_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
   MSFT:*_*_X64_PP_FLAGS == /nologo /E /TC /FIAutoGen.h
   MSFT:*_*_X64_ASM_FLAGS == /nologo /W3 /WX /c /Cx /Zd /W0 /Zi
-- 
2.9.3.windows.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/4] Add VS2017 tool chain for evaluation
  2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
                   ` (3 preceding siblings ...)
  2017-11-22 16:26 ` [PATCH v3 4/4] Nt32Pkg: Add VS2017 support in SecMain Pete Batard
@ 2017-11-28  1:56 ` Zhu, Yonghong
  2017-11-29  8:04   ` Gao, Liming
  4 siblings, 1 reply; 7+ messages in thread
From: Zhu, Yonghong @ 2017-11-28  1:56 UTC (permalink / raw)
  To: Pete Batard, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zhu, Yonghong

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

Best Regards,
Zhu Yonghong

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Pete Batard
Sent: Thursday, November 23, 2017 12:26 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [PATCH v3 0/4] Add VS2017 tool chain for evaluation

This is a re-send of v2, with a small comment update to indicate that
VS2017 v15.2 or later is required, due to the vswhere.exe requirement.

This patch serial adds VS2017 tool chain in BaseTools tools_def.template.
It enables /WHOLEARCHIVE option to detect the potential code issue.
It can be used to build source code with Visual Studio 2017 on 32bit or 64bit Windows OS. After this tool chain is evaluated, ASL, ARM and ARM64 support can be provided.
And, to avoid more duplicated informations be introduced, the proposal to simplify tools_def.template will be provided.


Liming Gao (4):
  MdePkg: Disable VS warning 4701 & 4703 for VS2017
  BaseTools: Add VS2017 tool chain in BaseTools tools_def.template
  BaseTools: Update VS batch file to auto detect VS2017
  Nt32Pkg: Add VS2017 support in SecMain

 BaseTools/Conf/tools_def.template   | 126 ++++++++++++++++++++
 BaseTools/get_vsvars.bat            |   8 ++
 BaseTools/set_vsprefix_envs.bat     |  33 ++++-
 MdePkg/Include/Ia32/ProcessorBind.h |   4 +-
 MdePkg/Include/X64/ProcessorBind.h  |   4 +-
 Nt32Pkg/Sec/SecMain.inf             |   2 +
 6 files changed, 172 insertions(+), 5 deletions(-)

--
2.9.3.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/4] Add VS2017 tool chain for evaluation
  2017-11-28  1:56 ` [PATCH v3 0/4] Add VS2017 tool chain for evaluation Zhu, Yonghong
@ 2017-11-29  8:04   ` Gao, Liming
  0 siblings, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2017-11-29  8:04 UTC (permalink / raw)
  To: Zhu, Yonghong, Pete Batard, edk2-devel@lists.01.org

Push them in edk2 trunk. 

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Tuesday, November 28, 2017 9:56 AM
>To: Pete Batard <pete@akeo.ie>; edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>; Zhu, Yonghong
><yonghong.zhu@intel.com>
>Subject: RE: [edk2] [PATCH v3 0/4] Add VS2017 tool chain for evaluation
>
>Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
>
>Best Regards,
>Zhu Yonghong
>
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Pete Batard
>Sent: Thursday, November 23, 2017 12:26 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [edk2] [PATCH v3 0/4] Add VS2017 tool chain for evaluation
>
>This is a re-send of v2, with a small comment update to indicate that
>VS2017 v15.2 or later is required, due to the vswhere.exe requirement.
>
>This patch serial adds VS2017 tool chain in BaseTools tools_def.template.
>It enables /WHOLEARCHIVE option to detect the potential code issue.
>It can be used to build source code with Visual Studio 2017 on 32bit or 64bit
>Windows OS. After this tool chain is evaluated, ASL, ARM and ARM64 support
>can be provided.
>And, to avoid more duplicated informations be introduced, the proposal to
>simplify tools_def.template will be provided.
>
>
>Liming Gao (4):
>  MdePkg: Disable VS warning 4701 & 4703 for VS2017
>  BaseTools: Add VS2017 tool chain in BaseTools tools_def.template
>  BaseTools: Update VS batch file to auto detect VS2017
>  Nt32Pkg: Add VS2017 support in SecMain
>
> BaseTools/Conf/tools_def.template   | 126 ++++++++++++++++++++
> BaseTools/get_vsvars.bat            |   8 ++
> BaseTools/set_vsprefix_envs.bat     |  33 ++++-
> MdePkg/Include/Ia32/ProcessorBind.h |   4 +-
> MdePkg/Include/X64/ProcessorBind.h  |   4 +-
> Nt32Pkg/Sec/SecMain.inf             |   2 +
> 6 files changed, 172 insertions(+), 5 deletions(-)
>
>--
>2.9.3.windows.2
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-29  7:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-22 16:26 [PATCH v3 0/4] Add VS2017 tool chain for evaluation Pete Batard
2017-11-22 16:26 ` [PATCH v3 1/4] MdePkg: Disable VS warning 4701 & 4703 for VS2017 Pete Batard
2017-11-22 16:26 ` [PATCH v3 2/4] BaseTools: Add VS2017 tool chain in BaseTools tools_def.template Pete Batard
2017-11-22 16:26 ` [PATCH v3 3/4] BaseTools: Update VS batch file to auto detect VS2017 Pete Batard
2017-11-22 16:26 ` [PATCH v3 4/4] Nt32Pkg: Add VS2017 support in SecMain Pete Batard
2017-11-28  1:56 ` [PATCH v3 0/4] Add VS2017 tool chain for evaluation Zhu, Yonghong
2017-11-29  8:04   ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox