I build edk2 OVMF with VS2015 and VS2017. Their image size are almost same. Have you the additional options to disable the optimization? In fact, /GL option will remove the unused function and logic.
> -----Original Message----- > From: Roman Agafonov [mailto:[email protected]] > Sent: Wednesday, June 5, 2019 1:21 AM > To: Gao, Liming <[email protected]>; [email protected] > Cc: Feng, Bob C <[email protected]>; Zhu, Yonghong <[email protected]> > Subject: Re: [PATCH v1 1/1] BaseTools: don't use WHOLEARCHIVE linker flag for > VS2017 toolchain > > Hi Liming, > > Sure. Here is what I get after building our NIC driver binary with VS2015x86 > and VS2017 toolchains: > > pcfist@pcfist-pc:/mnt/c/src/uefi/udk2018$ du -h > Build/xgbe_atl/RELEASE_VS2015x86/X64/xgbe_atl.efi > Build/xgbe_atl/RELEASE_VS2017/X64/xgbe_atl.efi > 36K Build/xgbe_atl/RELEASE_VS2015x86/X64/xgbe_atl.efi > 68K Build/xgbe_atl/RELEASE_VS2017/X64/xgbe_atl.efi > > Best regards, > Roman > > From: Gao, Liming <[email protected]> > Sent: Tuesday, June 4, 2019 6:54 PM > To: Roman Agafonov; [email protected] > Cc: Feng, Bob C; Zhu, Yonghong > Subject: RE: [PATCH v1 1/1] BaseTools: don't use WHOLEARCHIVE linker flag for > VS2017 toolchain > > Can you show the size data with VS2017 and VS2015 for the same code? > > Thanks > Liming > > -----Original Message----- > > From: Roman Agafonov [mailto:[email protected]] > > Sent: Tuesday, June 4, 2019 11:41 PM > > To: [email protected] > > Cc: Feng, Bob C <[email protected]>; Gao, Liming <[email protected]>; > > Zhu, Yonghong <[email protected]> > > Subject: [PATCH v1 1/1] BaseTools: don't use WHOLEARCHIVE linker flag for > > VS2017 toolchain > > > > I have noticed the resulting binaries are about twice as large when > > using VS2017 toolchain compared to the ones built with VS2015. It appears > > this is caused by /WHOLEARCHIVE linker flag used by this toolchain. This > > flag was previously removed from VS2015 toolchain due to compatibility > > issues. I believe it should not be used with VS2017 as well. > > > > Cc: Bob Feng <[email protected]> > > Cc: Liming Gao <[email protected]> > > Cc: Yonghong Zhu <[email protected]> > > Signed-off-by: Roman Agafonov <[email protected]> > > --- > > BaseTools/Conf/tools_def.template | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/BaseTools/Conf/tools_def.template > > b/BaseTools/Conf/tools_def.template > > index 26a2cf604f74..482a526f3052 100755 > > --- a/BaseTools/Conf/tools_def.template > > +++ b/BaseTools/Conf/tools_def.template > > @@ -1545,7 +1545,7 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS = /NOLOGO > > /NODEFAULTLIB /IGNORE:4001 /OPT:REF > > *_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_*_DLINK2_FLAGS = > > *_VS2017_*_ASM16_PATH = DEF(VS2017_BIN_IA32)\ml.exe > > > > ################## > > -- > > 2.9.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41955): https://edk2.groups.io/g/devel/message/41955 Mute This Topic: https://groups.io/mt/31927868/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
