From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 04D7B21A143C3 for ; Tue, 13 Jun 2017 21:45:52 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2017 21:47:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,340,1493708400"; d="scan'208";a="1182206718" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2017 21:47:07 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao Date: Wed, 14 Jun 2017 12:47:04 +0800 Message-Id: <1497415626-23908-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch 0/2] Add /Gw to CC_FLAGS for VS 2013 and higher tool chains X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2017 04:45:53 -0000 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 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu 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