From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web12.5737.1582818171710840458 for ; Thu, 27 Feb 2020 07:42:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=mt0vmrEA; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.27/8.16.0.27) with SMTP id 01RFX3G3013813; Thu, 27 Feb 2020 07:42:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=sender : content-type : content-transfer-encoding : from : mime-version : subject : date : message-id : references : cc : in-reply-to : to; s=20180706; bh=jsHUM2ZldYP5gc6Dvo5t5BHp/ZAVTgmd2rKlRJxQ9gQ=; b=mt0vmrEADPsBB/LBDw+9+AHj+z3cRUFQm+GdkUxESiNPtgkonHygHihzCIcLaybGeM0r /4EDpuYMyk2P81q9yd0eaCnc7c5yuKOZ82cQtxBW93KzKMCRlVwaxDaoOPLlqoYuVj5Q ze9uxPUaF/HMBwR48SbV7M+8mfixBIRbcBXUINHsNPTGJHJNnKxoB0YT4y929SWS64mn P2D8HxaqhZNPxC2E3d+G6nCLo4jShOuMQQKH7i5Ktg/N/OPKuHC1ZWYG4G8cUFDZbx0F kMn8RtnvFhsdfo8GCCt5qlduLB3XDkLb+5P49+hGUqmsW544m3VCmXAaPhd3vMO+rrPy UQ== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 2ydcgwca89-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 27 Feb 2020 07:42:49 -0800 Received: from nwk-mmpp-sz13.apple.com (nwk-mmpp-sz13.apple.com [17.128.115.216]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.1.20190704 64bit (built Jul 4 2019)) with ESMTPS id <0Q6D00AIQABDSCF0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Thu, 27 Feb 2020 07:42:49 -0800 (PST) Received: from process_milters-daemon.nwk-mmpp-sz13.apple.com by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) id <0Q6D00200A8PO400@nwk-mmpp-sz13.apple.com>; Thu, 27 Feb 2020 07:42:49 -0800 (PST) X-Va-A: X-Va-T-CD: e48e8dc3f6c377b8dc939b4126ad19f3 X-Va-E-CD: 4419952549f2d824860fb848b4955a59 X-Va-R-CD: 1809f0aec25bbd5206a319010f13edc6 X-Va-CD: 0 X-Va-ID: 00166548-0c42-44a9-bc4b-87ac70faad1c X-V-A: X-V-T-CD: e48e8dc3f6c377b8dc939b4126ad19f3 X-V-E-CD: 4419952549f2d824860fb848b4955a59 X-V-R-CD: 1809f0aec25bbd5206a319010f13edc6 X-V-CD: 0 X-V-ID: fd6944e7-9218-495e-a78c-3d9adf90cf2d X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2020-02-27_05:,, signatures=0 Received: from [17.235.111.122] (unknown [17.235.111.122]) by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPSA id <0Q6D00304ABBFA60@nwk-mmpp-sz13.apple.com>; Thu, 27 Feb 2020 07:42:49 -0800 (PST) Sender: afish@apple.com From: "Andrew Fish" MIME-version: 1.0 (1.0) Subject: Re: [edk2-devel] [Patch] IntelSiliconPkg/ShadowMicrocodePei: Fix GCC build error. Date: Thu, 27 Feb 2020 07:42:47 -0800 Message-id: <63C810E5-7643-4524-B4A5-14D78D912FD9@apple.com> References: Cc: "Gao, Liming" , "Fu, Siyuan" , "Ni, Ray" , "Chaganty, Rangasai V" In-reply-to: To: devel@edk2.groups.io, michael.d.kinney@intel.com X-Mailer: iPhone Mail (17D50) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2020-02-27_05:,, signatures=0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable Mike, Flexible array members must be the last element of a struct but they can = not be the only element. This is non standard behavior from the compilers that are not throwing the= error. Why not just use a pointer? > On Feb 26, 2020, at 10:03 PM, Michael D Kinney wrote: >=20 > =EF=BB=BFLiming, >=20 > This does not make sense. Those compilers > should support C99 flexible array members. >=20 > Structured PCDs also require use of flexible > array members. >=20 > We need to make sure the compiler flags for > those tool chain are correct to support flexible > array members. >=20 > Mike >=20 >> -----Original Message----- >> From: Gao, Liming >> Sent: Wednesday, February 26, 2020 9:58 PM >> To: devel@edk2.groups.io; Kinney, Michael D >> ; Fu, Siyuan >> >> Cc: Ni, Ray ; Chaganty, Rangasai V >> >> Subject: RE: [edk2-devel] [Patch] >> IntelSiliconPkg/ShadowMicrocodePei: Fix GCC build >> error. >>=20 >> Mike: >> I find this issue on GCC5 tool chain tag with GCC 5.5 >> and CLANGPDB tool chain tag with CLANG 9.0.0 >>=20 >> Thanks >> Liming >>> -----Original Message----- >>> From: devel@edk2.groups.io On >> Behalf Of Michael D Kinney >>> Sent: Thursday, February 27, 2020 1:54 PM >>> To: Gao, Liming ; >> devel@edk2.groups.io; Fu, Siyuan ; >> Kinney, Michael D >>> >>> Cc: Ni, Ray ; Chaganty, Rangasai V >> >>> Subject: Re: [edk2-devel] [Patch] >> IntelSiliconPkg/ShadowMicrocodePei: Fix GCC build >> error. >>>=20 >>> Which GCC and CLANG tool chain tags? >>>=20 >>> Flexible array member is a standard C feature >>> documented in C99. >>>=20 >>> Mike >>>=20 >>>> -----Original Message----- >>>> From: Gao, Liming >>>> Sent: Wednesday, February 26, 2020 9:38 PM >>>> To: Kinney, Michael D ; >>>> devel@edk2.groups.io; Fu, Siyuan >> >>>> Cc: Ni, Ray ; Chaganty, Rangasai >> V >>>> >>>> Subject: RE: [edk2-devel] [Patch] >>>> IntelSiliconPkg/ShadowMicrocodePei: Fix GCC build >>>> error. >>>>=20 >>>> Mike: >>>> I find GCC and CLANG will report the error for >> the >>>> empty struct. >>>>=20 >>>> d:\allpkg\edk2- >>>>=20 >> platforms\Silicon\Intel\IntelSiliconPkg\Include\Guid/Mi >>>> crocodeShadowInfoHob.h:61:11: error: flexible array >>>> member 'MicrocodeAddressInFlash' not allowed in >>>> otherwise empty struct >>>> UINT64 MicrocodeAddressInFlash[]; >>>> ^ >>>> 1 error generated. >>>>=20 >>>> Thanks >>>> Liming >>>>> -----Original Message----- >>>>> From: Kinney, Michael D >> >>>>> Sent: Thursday, February 27, 2020 1:25 PM >>>>> To: devel@edk2.groups.io; Fu, Siyuan >>>> ; Kinney, Michael D >>>> >>>>> Cc: Ni, Ray ; Chaganty, >> Rangasai V >>>> ; Gao, Liming >>>> >>>>> Subject: RE: [edk2-devel] [Patch] >>>> IntelSiliconPkg/ShadowMicrocodePei: Fix GCC build >>>> error. >>>>>=20 >>>>> What compiler does not like the flexible array >>>>> member syntax []. >>>>>=20 >>>>> Mike >>>>>=20 >>>>>> -----Original Message----- >>>>>> From: devel@edk2.groups.io >> >>>> On >>>>>> Behalf Of Siyuan, Fu >>>>>> Sent: Wednesday, February 26, 2020 5:58 PM >>>>>> To: devel@edk2.groups.io >>>>>> Cc: Ni, Ray ; Chaganty, >> Rangasai >>>> V >>>>>> ; Gao, Liming >>>>>> >>>>>> Subject: [edk2-devel] [Patch] >>>>>> IntelSiliconPkg/ShadowMicrocodePei: Fix GCC >> build >>>>>> error. >>>>>>=20 >>>>>> This patch fixes compiler error introduced by >>>> commit >>>>>> b0099a39bd. >>>>>>=20 >>>>>> BZ: >>>>>>=20 >>>>=20 >> https://tianocore.acgmultimedia.com/show_bug.cgi?id=3D244 >>>>>> 9 >>>>>> Cc: Ray Ni >>>>>> Cc: Rangasai V Chaganty >>>> >>>>>> Cc: Liming Gao >>>>>> Signed-off-by: Siyuan Fu >>>>>> --- >>>>>>=20 >> .../Feature/ShadowMicrocode/ShadowMicrocodePei.c >>>>>> | 2 +- >>>>>>=20 >>>>>>=20 >>>>=20 >> .../Intel/IntelSiliconPkg/Include/Guid/MicrocodeShadowI >>>>>> nfoHob.h | 2 +- >>>>>> 2 files changed, 2 insertions(+), 2 >> deletions(-) >>>>>>=20 >>>>>> diff --git >>>>>>=20 >>>>=20 >> a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode >>>>>> /ShadowMicrocodePei.c >>>>>>=20 >>>>=20 >> b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode >>>>>> /ShadowMicrocodePei.c >>>>>> index 7e4084247e..8d6574f667 100644 >>>>>> --- >>>>>>=20 >>>>=20 >> a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode >>>>>> /ShadowMicrocodePei.c >>>>>> +++ >>>>>>=20 >>>>=20 >> b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode >>>>>> /ShadowMicrocodePei.c >>>>>> @@ -247,7 +247,7 @@ ShadowMicrocodePatchWorker >> ( >>>>>> (VOID *) Patches[Index].Address, >>>>>> Patches[Index].Size >>>>>> ); >>>>>> - MicrocodeAddressInMemory[Index] =3D (UINT64) >>>> Walker; >>>>>> + MicrocodeAddressInMemory[Index] =3D (UINT64) >>>> (UINTN) >>>>>> Walker; >>>>>> Flashcontext- >>> MicrocodeAddressInFlash[Index] >>>> =3D >>>>>> (UINT64) Patches[Index].Address; >>>>>> Walker +=3D Patches[Index].Size; >>>>>> } >>>>>> diff --git >>>>>>=20 >>>>=20 >> a/Silicon/Intel/IntelSiliconPkg/Include/Guid/MicrocodeS >>>>>> hadowInfoHob.h >>>>>>=20 >>>>=20 >> b/Silicon/Intel/IntelSiliconPkg/Include/Guid/MicrocodeS >>>>>> hadowInfoHob.h >>>>>> index d887b39123..1daae1234a 100644 >>>>>> --- >>>>>>=20 >>>>=20 >> a/Silicon/Intel/IntelSiliconPkg/Include/Guid/MicrocodeS >>>>>> hadowInfoHob.h >>>>>> +++ >>>>>>=20 >>>>=20 >> b/Silicon/Intel/IntelSiliconPkg/Include/Guid/MicrocodeS >>>>>> hadowInfoHob.h >>>>>> @@ -58,7 +58,7 @@ typedef struct { >>>>>> // microcode patch address on flash. The >> address >>>> is >>>>>> placed in same >>>>>> // order as the microcode patches in >>>>>> MicrocodeAddrInMemory. >>>>>> // >>>>>> - UINT64 MicrocodeAddressInFlash[]; >>>>>> + UINT64 MicrocodeAddressInFlash[0]; >>>>>> } EFI_MICROCODE_STORAGE_TYPE_FLASH_CONTEXT; >>>>>>=20 >>>>>> #endif >>>>>> -- >>>>>> 2.19.1.windows.1 >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>=20 >>>=20 >>>=20 >=20 >=20 >=20 >=20