From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.3050.1571810171048723895 for ; Tue, 22 Oct 2019 22:56:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2019 22:56:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,219,1569308400"; d="scan'208";a="349294078" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 22 Oct 2019 22:56:10 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 22 Oct 2019 22:56:09 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 22 Oct 2019 22:56:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX154.ccr.corp.intel.com ([10.239.6.54]) with mapi id 14.03.0439.000; Wed, 23 Oct 2019 13:56:08 +0800 From: "Ni, Ray" To: "Gao, Liming" , "devel@edk2.groups.io" CC: "Justen, Jordan L" , Andrew Fish Subject: Re: [Patch 10/11] EmulatorPkg: Enable CLANG9 tool chain Thread-Topic: [Patch 10/11] EmulatorPkg: Enable CLANG9 tool chain Thread-Index: AQHViOdRISQX51goLkSO0jUZ6XWWOqdnuy4g Date: Wed, 23 Oct 2019 05:56:08 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C32D994@SHSMSX104.ccr.corp.intel.com> References: <20191022144406.6996-1-liming.gao@intel.com> <20191022144406.6996-11-liming.gao@intel.com> In-Reply-To: <20191022144406.6996-11-liming.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTY0ODM5YTUtNWRkZi00ODUwLTlhODAtY2MxN2E3Y2UwMjY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQ3FlZDdrME9tK0IyWTFGWWR2NSs4VGpQSldBMzhvM2RYTVB6ZnBUeThHK0E3dTNhZjRMbWZSeVRvOFlnQjR1WiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Liming, Could you please modify your commit message changing WIN_SEC_BUILD to WIN_HOST_BUILD to reflect the real code changes. > -----Original Message----- > From: Gao, Liming > Sent: Tuesday, October 22, 2019 10:44 PM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Andrew Fish ; Ni, Ray > Subject: [Patch 10/11] EmulatorPkg: Enable CLANG9 tool chain >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1603 > 1. Add WIN_SEC_BUILD macro check for CLANG9 tool chain > build -p EmulatorPkg\EmulatorPkg.dsc -a IA32 -DWIN_SEC_BUILD=3DTRUE -t CL= ANG9 > build -p EmulatorPkg\EmulatorPkg.dsc -a X64 -DWIN_SEC_BUILD=3DTRUE -t CLA= NG9 > 2. Append CLANG CC and LINK flags to generate windows HOST. > 3. Fix WinHost issue to call GetProcessAffinityMask() API. > The input parameter should be UINTN pointer instead of UINT32 pointer. >=20 > Cc: Jordan Justen > Cc: Andrew Fish > Cc: Ray Ni > Signed-off-by: Liming Gao > Reviewed-by: Ray Ni > --- > EmulatorPkg/Win/Host/WinHost.c | 6 +++--- > EmulatorPkg/EmulatorPkg.dsc | 14 +++++++++++++- > EmulatorPkg/Win/Host/WinHost.inf | 6 ++++++ > 3 files changed, 22 insertions(+), 4 deletions(-) >=20 > diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHos= t.c > index 9aba3c8959..e40ce32548 100644 > --- a/EmulatorPkg/Win/Host/WinHost.c > +++ b/EmulatorPkg/Win/Host/WinHost.c > @@ -356,7 +356,7 @@ Returns: > INTN > EFIAPI > main ( > - IN INTN Argc, > + IN INT Argc, > IN CHAR8 **Argv, > IN CHAR8 **Envp > ) > @@ -391,8 +391,8 @@ Returns: > VOID *SecFile; > CHAR16 *MemorySizeStr; > CHAR16 *FirmwareVolumesStr; > - UINT32 ProcessAffinityMask; > - UINT32 SystemAffinityMask; > + UINTN ProcessAffinityMask; > + UINTN SystemAffinityMask; > INT32 LowBit; >=20 > // > diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc > index 20f1187713..109685b062 100644 > --- a/EmulatorPkg/EmulatorPkg.dsc > +++ b/EmulatorPkg/EmulatorPkg.dsc > @@ -237,9 +237,11 @@ >=20 > [Components] > !if "IA32" in $(ARCH) || "X64" in $(ARCH) > - !if "MSFT" in $(FAMILY) > + !if "MSFT" in $(FAMILY) || $(WIN_HOST_BUILD) =3D=3D TRUE > ## > # Emulator, OS WIN application > + # CLANG9 is cross OS tool chain. It depends on WIN_HOST_BUILD flag > + # to build WinHost application. > ## > EmulatorPkg/Win/Host/WinHost.inf > !else > @@ -419,7 +421,17 @@ >=20 > MSFT:DEBUG_*_*_CC_FLAGS =3D /Od /Oy- > MSFT:NOOPT_*_*_CC_FLAGS =3D /Od /Oy- > + GCC:DEBUG_CLANG9_*_CC_FLAGS =3D-O0 -Wno-unused-command-line-argument -= Wno-incompatible-pointer-types -Wno- > enum-conversion -Wno-incompatible-pointer-types -Wno-sometimes-uninitiali= zed -Wno-constant-conversion -Wno-main- > return-type >=20 > MSFT:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:= CONSOLE > MSFT:DEBUG_*_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_ENTR= Y_POINT) /BASE:0x10000 > MSFT:NOOPT_*_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_ENTR= Y_POINT) /BASE:0x10000 > + > +!if $(WIN_HOST_BUILD) =3D=3D TRUE > + # > + # CLANG9 tool chain depends on WIN_HOST_BUILD flag to generate the win= dows application. > + # > + GCC:*_CLANG9_*_DLINK_FLAGS =3D /ALIGN:4096 /FILEALIGN:4096 /SUBSYS= TEM:CONSOLE > + GCC:DEBUG_CLANG9_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_= ENTRY_POINT) /BASE:0x10000 > + GCC:NOOPT_CLANG9_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_= ENTRY_POINT) /BASE:0x10000 > +!endif > diff --git a/EmulatorPkg/Win/Host/WinHost.inf b/EmulatorPkg/Win/Host/WinH= ost.inf > index 631d5a6470..1adca10d79 100644 > --- a/EmulatorPkg/Win/Host/WinHost.inf > +++ b/EmulatorPkg/Win/Host/WinHost.inf > @@ -95,3 +95,9 @@ > MSFT:*_VS2017_X64_DLINK_FLAGS =3D /LIBPATH:"%VCToolsInstallDir%li= b\x64" > /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBS= YSTEM:CONSOLE /NODEFAULTLIB > /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCR= TD.lib vcruntimed.lib ucrtd.lib > Gdi32.lib User32.lib Winmm.lib Advapi32.lib > MSFT:*_*_X64_ASM_FLAGS =3D=3D /nologo /W3 /WX /c /Cx /Zd /W= 0 /Zi > MSFT:*_*_X64_ASMLINK_FLAGS =3D=3D /link /nologo > + > + GCC:*_CLANG9_X64_DLINK_FLAGS =3D=3D /out:"$(BIN_DIR)\$(BASE_NAME).exe"= /base:0x10000000 > /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /LIBPATH:"%UniversalCRTSdkDir%lib\%UC= RTVersion%\ucrt\x64" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /LIBPATH:"%VC= ToolsInstallDir%lib\x64" /NOLOGO > /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /OPT:REF /DEBUG /MACHINE:A= MD64 Kernel32.lib MSVCRTD.lib > vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib /lld= map /EXPORT:InitializeDriver=3D_ModuleEntryPoint > + GCC:*_CLANG9_X64_CC_FLAGS =3D=3D -m64 -g -fshort-wchar -fno-strict-ali= asing -Wall -c -include AutoGen.h -D > _CRT_SECURE_NO_WARNINGS -Wnonportable-include-path -D UNICODE -D _CRT_SE= CURE_NO_DEPRECATE > + > + GCC:*_CLANG9_IA32_DLINK_FLAGS =3D=3D /out:"$(BIN_DIR)\$(BASE_NAME).exe= " /base:0x10000000 > /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCR= TVersion%\ucrt\x86" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /LIBPATH:"%VC= ToolsInstallDir%ib\x86" /NOLOGO > /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /OPT:REF /DEBUG /MACHINE:I= 386 Kernel32.lib MSVCRTD.lib > vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib /lld= map /EXPORT:InitializeDriver=3D_ModuleEntryPoint > + GCC:*_CLANG9_IA32_CC_FLAGS =3D=3D -m32 -g -fshort-wchar -fno-strict-al= iasing -Wall -c -include AutoGen.h -D > _CRT_SECURE_NO_WARNINGS -Wnonportable-include-path -D UNICODE -D _CRT_SE= CURE_NO_DEPRECATE > -- > 2.13.0.windows.1