From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.3958.1571820481036868417 for ; Wed, 23 Oct 2019 01:48:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 01:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,220,1569308400"; d="scan'208";a="397973862" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 23 Oct 2019 01:48:00 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 23 Oct 2019 01:47:59 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX153.ccr.corp.intel.com ([10.239.6.53]) with mapi id 14.03.0439.000; Wed, 23 Oct 2019 16:47:57 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Gao, Liming" CC: "Justen, Jordan L" , Andrew Fish Subject: Re: [edk2-devel] [Patch v5 10/11] EmulatorPkg: Enable CLANG9 tool chain Thread-Topic: [edk2-devel] [Patch v5 10/11] EmulatorPkg: Enable CLANG9 tool chain Thread-Index: AQHViX5mqaDBJBmWgUGfsgEv4+RxZadn6gpw Date: Wed, 23 Oct 2019 08:47:58 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C32DFC6@SHSMSX104.ccr.corp.intel.com> References: <1571820364-21836-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1571820364-21836-1-git-send-email-liming.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTExZTg5OTItMjgxNi00YTdmLThlYWEtZDJkZTU0MmIxYWIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidDZcL3ErUlozSmdmWTVrNFVJZ3pJU2dodnp4Z1FRMzh5QldQZVZxbEs2cExUcW9nUUQ1cXpWUUordFhkVVBXamgifQ== 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, The patch is good. You've already got the Reviewed-by. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Liming Ga= o > Sent: Wednesday, October 23, 2019 4:46 PM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Andrew Fish ; Ni, Ray > Subject: [edk2-devel] [Patch v5 10/11] EmulatorPkg: Enable CLANG9 tool c= hain >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1603 > 1. Add WIN_HOST_BUILD macro check for CLANG9 tool chain > build -p EmulatorPkg\EmulatorPkg.dsc -a IA32 -DWIN_HOST_BUILD=3DTRUE -t = CLANG9 > build -p EmulatorPkg\EmulatorPkg.dsc -a X64 -DWIN_HOST_BUILD=3DTRUE -t C= LANG9 > 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 > --- > In v5, update commit message and fix VS2015 X64 build failure. >=20 > EmulatorPkg/Win/Host/WinHost.c | 8 ++++---- > EmulatorPkg/EmulatorPkg.dsc | 14 +++++++++++++- > EmulatorPkg/Win/Host/WinHost.inf | 6 ++++++ > 3 files changed, 23 insertions(+), 5 deletions(-) >=20 > diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHo= st.c > index 9aba3c8959..62a89f7617 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 > // > @@ -414,7 +414,7 @@ Returns: > // Determine the first thread available to this process. > // > if (GetProcessAffinityMask (GetCurrentProcess (), &ProcessAffinityMas= k, &SystemAffinityMask)) { > - LowBit =3D (INT32)LowBitSet32 (ProcessAffinityMask); > + LowBit =3D (INT32)LowBitSet32 ((UINT32)ProcessAffinityMask); > if (LowBit !=3D -1) { > // > // Force the system to bind the process to a single thread to wor= k > 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-uninitial= ized -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_ENT= RY_POINT) /BASE:0x10000 > MSFT:NOOPT_*_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_ENT= RY_POINT) /BASE:0x10000 > + > +!if $(WIN_HOST_BUILD) =3D=3D TRUE > + # > + # CLANG9 tool chain depends on WIN_HOST_BUILD flag to generate the wi= ndows application. > + # > + GCC:*_CLANG9_*_DLINK_FLAGS =3D /ALIGN:4096 /FILEALIGN:4096 /SUBSY= STEM: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/Win= Host.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%l= ib\x64" > /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUB= SYSTEM:CONSOLE /NODEFAULTLIB > /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVC= RTD.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 /= W0 /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\%U= CRTVersion%\ucrt\x64" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /LIBPATH:"%V= CToolsInstallDir%lib\x64" /NOLOGO > /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /OPT:REF /DEBUG /MACHINE:= AMD64 Kernel32.lib MSVCRTD.lib > vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib /ll= dmap /EXPORT:InitializeDriver=3D_ModuleEntryPoint > + GCC:*_CLANG9_X64_CC_FLAGS =3D=3D -m64 -g -fshort-wchar -fno-strict-al= iasing -Wall -c -include AutoGen.h -D > _CRT_SECURE_NO_WARNINGS -Wnonportable-include-path -D UNICODE -D _CRT_S= ECURE_NO_DEPRECATE > + > + GCC:*_CLANG9_IA32_DLINK_FLAGS =3D=3D /out:"$(BIN_DIR)\$(BASE_NAME).ex= e" /base:0x10000000 > /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /LIBPATH:"%UniversalCRTSdkDir%lib\%UC= RTVersion%\ucrt\x86" > /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /LIBPATH:"%V= CToolsInstallDir%ib\x86" /NOLOGO > /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /OPT:REF /DEBUG /MACHINE:= I386 Kernel32.lib MSVCRTD.lib > vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib /ll= dmap /EXPORT:InitializeDriver=3D_ModuleEntryPoint > + GCC:*_CLANG9_IA32_CC_FLAGS =3D=3D -m32 -g -fshort-wchar -fno-strict-a= liasing -Wall -c -include AutoGen.h -D > _CRT_SECURE_NO_WARNINGS -Wnonportable-include-path -D UNICODE -D _CRT_S= ECURE_NO_DEPRECATE > -- > 2.13.0.windows.1 >=20 >=20 >=20