public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/1] BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64
@ 2018-04-24 16:10 Pete Batard
  2018-04-24 16:10 ` [PATCH 1/1] " Pete Batard
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Batard @ 2018-04-24 16:10 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

It looks like we forgot to carry over the /Gw optimisation option when adding
VS2017 support for IA32 and X64, whereas it is present in VS2015 and earlier.

Binaries without /Gw can be almost twice as large as when the option is used:
https://docs.microsoft.com/en-gb/cpp/build/reference/gw-optimize-global-data

Note that ARM and ARM64 are unaffected, as they already have the flag.

Pete Batard (1):
  BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64

 BaseTools/Conf/tools_def.template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.17.0.windows.1



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

* [PATCH 1/1] BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64
  2018-04-24 16:10 [PATCH 0/1] BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64 Pete Batard
@ 2018-04-24 16:10 ` Pete Batard
  2018-04-25  2:16   ` Gao, Liming
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Batard @ 2018-04-24 16:10 UTC (permalink / raw)
  To: edk2-devel; +Cc: liming.gao

This option, which is used in VS2015 and earlier toolchains, was missing
for VS2017. Applying it greatly reduces the size of generated binaries.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 BaseTools/Conf/tools_def.template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 5da229a715fa..03d700018550 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4129,8 +4129,8 @@ NOOPT_VS2015x86xASL_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT
 *_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
+  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 /Gw
+RELEASE_VS2017_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
 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
@@ -4159,8 +4159,8 @@ NOOPT_VS2017_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /O
 *_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
+  DEBUG_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Gw
+RELEASE_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
 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
-- 
2.17.0.windows.1



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

* Re: [PATCH 1/1] BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64
  2018-04-24 16:10 ` [PATCH 1/1] " Pete Batard
@ 2018-04-25  2:16   ` Gao, Liming
  0 siblings, 0 replies; 3+ messages in thread
From: Gao, Liming @ 2018-04-25  2:16 UTC (permalink / raw)
  To: Pete Batard, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Pete Batard
>Sent: Wednesday, April 25, 2018 12:10 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [edk2] [PATCH 1/1] BaseTools/Conf: Add /Gw optimisation option for
>VS2017 IA32 and X64
>
>This option, which is used in VS2015 and earlier toolchains, was missing
>for VS2017. Applying it greatly reduces the size of generated binaries.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Pete Batard <pete@akeo.ie>
>---
> BaseTools/Conf/tools_def.template | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/BaseTools/Conf/tools_def.template
>b/BaseTools/Conf/tools_def.template
>index 5da229a715fa..03d700018550 100755
>--- a/BaseTools/Conf/tools_def.template
>+++ b/BaseTools/Conf/tools_def.template
>@@ -4129,8 +4129,8 @@ NOOPT_VS2015x86xASL_X64_DLINK_FLAGS    =
>/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT
> *_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
>+  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
>/Gw
>+RELEASE_VS2017_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4
>/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
> 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
>@@ -4159,8 +4159,8 @@ NOOPT_VS2017_IA32_DLINK_FLAGS   = /NOLOGO
>/NODEFAULTLIB /IGNORE:4001 /OPT:REF /O
> *_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
>+  DEBUG_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D
>UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Gw
>+RELEASE_VS2017_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D
>UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
> 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
>--
>2.17.0.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2018-04-25  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-24 16:10 [PATCH 0/1] BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64 Pete Batard
2018-04-24 16:10 ` [PATCH 1/1] " Pete Batard
2018-04-25  2:16   ` Gao, Liming

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