From nobody Sat May 4 04:01:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53555+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53555+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1580351869512117.656317663761; Wed, 29 Jan 2020 18:37:49 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id iqebYY1788612xzOwFM1IOTK; Wed, 29 Jan 2020 18:37:48 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.2552.1580351867415391268 for ; Wed, 29 Jan 2020 18:37:47 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2020 18:37:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,380,1574150400"; d="scan'208";a="252865683" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.44.187]) by fmsmga004.fm.intel.com with ESMTP; 29 Jan 2020 18:37:46 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch] BaseTools/Build: Fix Structured PCD app host env issues Date: Wed, 29 Jan 2020 18:37:44 -0800 Message-Id: <20200130023744.5852-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: O8cPpMZQogJ6nWm6VHCewxNbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1580351868; bh=Go3bflRCx+0je793oHIUYddYgz83IRA4NhBVO7hXPuc=; h=Cc:Date:From:Reply-To:Subject:To; b=E4lehSoNN41eI4fYKIJdlQwlNzYB0nzC2dCijMxN/htTFxR+o53qlhNFKMnmjoI6vvg Kehul+qqiOVPHHIrqF8hYrV06VcunYcCKHoTzdd6Y7zViEPDemel5sec0Ag9CzYkpfZnx vQdtatuUUOjHZFmKm4suxS5tTcD9/dZ17OA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 https://bugzilla.tianocore.org/show_bug.cgi?id=3D2496 Structured PCD processing requires a host POSIX build environment. If the Structure PCD application can not be built using the default environment under Windows, then retry the build after setting up the host environment for the current tool chain tag. Also reduce the build dependencies for the Structured PCD application to increase compiler compatibility. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- .../Source/Python/Workspace/DscBuildData.py | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index c65a0dd346..bc3f32bb1d 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -91,9 +91,6 @@ WindowsCFLAGS =3D 'CFLAGS =3D $(CFLAGS) /wd4200 /wd4034 /= wd4101 ' LinuxCFLAGS =3D 'BUILD_CFLAGS +=3D -Wno-pointer-to-int-cast -Wno-unused-va= riable ' PcdMakefileEnd =3D ''' !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common - -LIBS =3D $(LIB_PATH)\Common.lib - !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app ''' =20 @@ -2637,10 +2634,10 @@ class DscBuildData(PlatformBuildClassObject): =20 MakeApp =3D PcdMakefileHeader if sys.platform =3D=3D "win32": - MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj\n' % (self.OutputPath, PcdValueInitName) + 'INC =3D ' + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.nor= mpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Commo= n/PcdValueCommon"))) + 'INC =3D ' else: MakeApp =3D MakeApp + PcdGccMakefile - MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= , PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \ + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= , PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(= mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdV= alueCommon"))) + \ 'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'IN= CLUDE +=3D' =20 IncSearchList =3D [] @@ -2723,8 +2720,8 @@ class DscBuildData(PlatformBuildClassObject): IncludeFileFullPaths.append(os.path.normpath(includefu= llpath)) break SearchPathList =3D [] - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Include"))) - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorksp= ace, "BaseTools/Source/C/Common"))) + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Include"))) + SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Common"))) SearchPathList.extend(str(item) for item in IncSearchList) IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchPath= List) for include_file in IncFileList: @@ -2743,9 +2740,33 @@ class DscBuildData(PlatformBuildClassObject): else: Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdValu= eInitName) +".exe" Messages =3D '' + + VsDevCmd =3D { + "VS2019" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"', + "VS2017" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"', + "VS2015" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 14.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2015x86": '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 14.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2013" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 12.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2013x86": '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 12.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2012" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 11.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2012x86": '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 11.0\\Common7\\Tools\\VsDevCmd.bat"', + "VS2010" : '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 10.0\\VC\\vcvarsall.bat" x86', + "VS2010x86": '"C:\\Program Files (x86)\\Microsoft Visual Studi= o 10.0\\VC\\vcvarsall.bat" x86' + } + if sys.platform =3D=3D "win32": MakeCommand =3D 'nmake -f %s' % (MakeFileName) returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand) + if returncode !=3D 0: + # + # If the nmake command failed, then lookup and run the VS + # Development Environment script for the current ToolChain= and + # try the nmake command again. + # + if self._Toolchain in VsDevCmd: + MakeCommand =3D VsDevCmd[self._Toolchain] + '&' + Make= Command + if os.path.exists (MakeCommand.split('"')[1]): + returncode, StdOut, StdErr =3D DscBuildData.Execut= eCommand (MakeCommand) Messages =3D StdOut else: MakeCommand =3D 'make -f %s' % (MakeFileName) --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53555): https://edk2.groups.io/g/devel/message/53555 Mute This Topic: https://groups.io/mt/70263619/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-