The /Gw flag does a better job at size optimization than use of the
GLOBAL_REMOVE_IF_UNREFERENCED macro that is currently used for VS20xx
tool chains to remove unreferenced global variables.
The recommendation is to add /Gw to CC_FLAGS for VS2013 and higher
tool chain tags and update Base.h in MdePkg to check the _MSC_VER
and define GLOBAL_REMOVE_IF_UNREFERENCED to nothing for VS2013 and
higher tool chain tags.
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=583
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Yonghong Zhu (2):
BaseTools: add /Gw to CC_FLAGS for VS2013 and higher tool chain tags
MdePkg: update Base.h in MdePkg to check the _MSC_VER
BaseTools/Conf/tools_def.template | 110 +++++++++++++++++++-------------------
MdePkg/Include/Base.h | 2 +-
2 files changed, 56 insertions(+), 56 deletions(-)
--
2.6.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel