From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web11.6529.1675307530648070248 for ; Wed, 01 Feb 2023 19:12:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=NvOmeV+U; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 6396ACD1F69C for ; Thu, 2 Feb 2023 11:12:07 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1675307527; bh=08rUthrMAbGKtdWyKDXhFkyV69JtAQtef/Q6iNm8AgY=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=NvOmeV+U0UHnVrEmUK6LeJNHe5VFpibedBjzoOsrk5Fe/616nvWrh0m0kljRSfCrj 2I2RP6MlDRKxbYcDF2+XViZBdGRoOU7p042zLuVTX1JD20ilm80lO5gnYLhAahN4+k zKYpWk400IjH6aGfiKumkGUVioUPwIpVMvnlrvFA= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 5F067CD1F6B3 for ; Thu, 2 Feb 2023 11:12:07 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 0FB28CD1F64A for ; Thu, 2 Feb 2023 11:12:07 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 8C2D6CD1F657 for ; Thu, 2 Feb 2023 11:12:03 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 02 Feb 2023 11:11:57 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , "'He, Jiangang'" , "'Chang, Abner'" , "'Kinney, Michael D'" Cc: "'Bi, Dandan'" , "'Kirkendall, Garrett'" References: <20230112050822.1940-1-abner.chang@amd.com> <001c01d933b4$3db80420$b9280c60$@byosoft.com.cn> <01ab01d93533$14a78f30$3df6ad90$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIFYyXSBNZGVNb2R1bGVQa2cvRGVjb21wcmVzczogQWRkIG1pc3Npbmcgc291cmNlIGZpbGUgdG8gQnJvdGxpIGxpYnJhcnk=?= Date: Thu, 2 Feb 2023 11:11:58 +0800 Message-ID: <018d01d936b4$1cf60a40$56e21ec0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKSDL1LjaDaouG629qjNe5QTMui1wLQvW42ARI+4h4BqPNZAgGuEsxWAcxk45cCAXiIFAJOcsY5AeRnepSsz3jV4A== Sender: "gaoliming" Content-Type: multipart/alternative; boundary="----=_NextPart_000_018E_01D936F7.2B1EEF90" Content-Language: zh-cn ------=_NextPart_000_018E_01D936F7.2B1EEF90 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Can you update the patch to support GCC5 and VS2019 both? =20 Thanks Liming =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Lin, Kuei-Hung (Timothy) via groups.io =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B41=E6=9C=8831=E6=97=A5 13= :21 =E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming ; devel@ed= k2.groups.io; He, Jiangang ; Chang, Abner ; 'Kinney, Michael D' =E6=8A=84=E9=80=81: 'Bi, Dandan' ; Kirkendall, Garrett= =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Ad= d missing source file to Brotli library =20 [AMD Official Use Only - General] =20 Let me clarify this: Abner's original code change covers the fix for both GCC5 and VS2019. More over, VS2019 needs these two additional headers file under MdeModulePk= g/Library/BrotliCustomDecompressLib to fix the missing intrinsic functions:= memset() and free(). =20 -- Timothy _____ =20 From: gaoliming = > Sent: Monday, January 30, 2023 9:15 PM To: devel@edk2.groups.io >; Lin, Kuei-Hung (Timothy) >; He, Jiangang >; Chang, Abner >; 'Kinney, Michael D' > Cc: 'Bi, Dandan' >; Kirke= ndall, Garrett > Subject: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH V2] MdeModulePkg/Decompres= s: Add missing source file to Brotli library=20 =20 =09 Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding.=20 =20 Dose this patch fix GCC5 or VS2019 build failure? =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > =E4=BB=A3=E8=A1= =A8 Lin, Kuei-Hung (Timothy) via groups.io =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B41=E6=9C=8831=E6=97=A5 8:= 50 =E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming >; devel@edk2.groups.io ; He, Jiangang >; Chan= g, Abner >; 'Kinney, Mich= ael D' > =E6=8A=84=E9=80=81: 'Bi, Dandan' >; Kirkendall, Garrett > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Ad= d missing source file to Brotli library =20 [AMD Official Use Only - General] =20 =20 The failure can be replicated with VS2019 and GCC5. * GCC5: * /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: warning: relocation against = `_kBrotliPrefixCodeRanges' in read-only section `.text.BrotliUefiDecompress= '=20 /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `DecodeLiteralBloc= kSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:879: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomD= ecompressLib/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliCo= ntextLookupTable' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `DecodeCommandBloc= kSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:879: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `DecodeDistanceBlo= ckSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:879: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `SafeDecodeLiteral= BlockSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomD= ecompressLib/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliCo= ntextLookupTable' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `SafeDecodeCommand= BlockSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `SafeDecodeDistanc= eBlockSwitch': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `BrotliDecoderDest= royInstance': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/state.c:136: undefined reference to `BrotliSharedDictionaryDes= troyInstance' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `BrotliUefiDecompr= ess': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/state.c:87: undefined reference to `BrotliSharedDictionaryCrea= teInstance' /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `BrotliUefiDecompr= ess': /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/= brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRanges= ' /usr/bin/ld: /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomD= ecompressLib/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliCo= ntextLookupTable' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status ... =20 build.py... : error F002: Failed to build module =E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82/home/XXX/edk2-stable= 202211/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf [X64, GCC5, RELEASE] * VS2019: * BBrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external = symbol BrotliDefaultFreeFunc=20 BrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external sym= bol BrotliDefaultAllocFunc BrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external sym= bol BrotliSharedDictionaryCreateInstance BrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external sym= bol BrotliSharedDictionaryDestroyInstance BrotliDecompressLib.lib(decode.obj) : error LNK2001: unresolved external sy= mbol _kBrotliPrefixCodeRanges BrotliDecompressLib.lib(decode.obj) : error LNK2001: unresolved external sy= mbol BrotliSharedDictionaryAttach BrotliDecompressLib.lib(decode.obj) : error LNK2001: unresolved external sy= mbol _kBrotliContextLookupTable d:\XXX\Build\OvmfX64\RELEASE_VS2019\X64\MdeModulePkg\Core\DxeIplPeim\DxeIpl= \DEBUG\DxeIpl.dll : fatal error LNK1120: 7 unresolved externals ... build.py... : error 7000: Failed to execute command C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC= \Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe /nologo tbuild [d:\XXX\Bu= ild\OvmfX64\RELEASE_VS2019\X64\MdeModulePkg\Core\DxeIplPeim\DxeIpl] =20 =20 -- Timothy _____ =20 From: gaoliming = > Sent: Saturday, January 28, 2023 11:35 PM To: devel@edk2.groups.io >; Lin, Kuei-Hung (Timothy) >; He, Jiangang >; Chang, Abner >; 'Kinney, Michael D' > Cc: 'Bi, Dandan' >; Kirke= ndall, Garrett > Subject: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH V2] MdeModulePkg/Decompres= s: Add missing source file to Brotli library=20 =20 =09 Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding.=20 =20 Timothy: Thanks for your report. This is a real issue in Brotli decompress library.= Which tool chain has been verified? GCC5 or VS2019 or Both? =20 Thanks Liming =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > =E4=BB=A3=E8=A1= =A8 Lin, Kuei-Hung (Timothy) via groups.io =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B41=E6=9C=8813=E6=97=A5 6:= 18 =E6=94=B6=E4=BB=B6=E4=BA=BA: He, Jiangang >; Chang, Abner >; Kinney, Michael D >; devel@edk2.groups.io =20 =E6=8A=84=E9=80=81: Bi, Dandan >; Gao, Liming >; Kirkendall, Garrett > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Ad= d missing source file to Brotli library =20 [AMD Official Use Only - General] =20 This patch tried to fix following build failure when linking the Brotli dec= ompress lib. =20 Steps to replicate the issue: 1 - Attach a NULL lib to DxeIpl.inf in any project's .DSC, say OvmfPkgX64.d= sc MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {=20 NULL|MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecom= pressLib.inf } 2 - Follow the EDKII'2 package build steps to build that project. Build.py = would compliains with following errors. ... /home/edk2/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib= /brotli/c/dec/decode.c:879: undefined reference to `_kBrotliPrefixCodeRange= s' /usr/bin/ld: /home/edk2/edk2-stable202211/MdeModulePkg/Library/BrotliCustom= DecompressLib/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliC= ontextLookupTable' /usr/bin/ld: /tmp/ccKzzHN0.ltrans0.ltrans.o: in function `DecodeCommandBloc= kSwitch': ...=20 /usr/bin/ld: /tmp/ccKzzHN0.ltrans0.ltrans.o: in function `BrotliUefiDecompr= ess': /home/edk2/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib= /brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRange= s' /usr/bin/ld: /home/edk2/edk2-stable202211/MdeModulePkg/Library/BrotliCustom= DecompressLib/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliC= ontextLookupTable' =20 -- Timothy =20 =20 =20 =20 _____ =20 From: He, Jiangang > Sent: Thursday, January 12, 2023 8:08 AM To: Chang, Abner >; Kinne= y, Michael D >; devel@edk2.groups.io >; Lin, Kuei-Hung (Timothy) > Cc: Bi, Dandan >; Gao, Li= ming >; Kirkend= all, Garrett >; Kinney, Michael D > Subject: RE: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing s= ource file to Brotli library=20 =20 [AMD Official Use Only - General] =20 Timothy will answer the question. =20 From: Chang, Abner >=20 Sent: Thursday, January 12, 2023 10:05 AM To: Kinney, Michael D >; devel@edk2.groups.io =20 Cc: Bi, Dandan >; Gao, Li= ming >; Kirkend= all, Garrett >; Kinney, Michael D >; He, Jiangang > Subject: Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing s= ource file to Brotli library =20 [AMD Official Use Only - General] =20 Hi Mike,=20 CC Jiangang, he can give the clear answer. =20 Thanks Abner=20 =20 =20 Get Outlook for Android =20 _____ =20 From: Kinney, Michael D > Sent: Thursday, January 12, 2023 11:23:48 PM To: devel@edk2.groups.io >; Chang, Abner > Cc: Bi, Dandan >; Gao, Li= ming >; Kirkend= all, Garrett >; Kinney, Michael D > Subject: RE: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing s= ource file to Brotli library=20 =20 Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Hi Abner, What was the failure before this change? This looks like something that would always break the build of source files= were missing. Mike > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Chang, Abner via groups= .io > Sent: Wednesday, January 11, 2023 9:08 PM > To: devel@edk2.groups.io =20 > Cc: Bi, Dandan >; Gao, = Liming ; Garrett Kirkendall >; > Abner Chang > > Subject: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing sou= rce file to Brotli library > > From: Abner Chang > > > Add missing source files to Brotli library INF. > > Signed-off-by: Jiangang He > > Cc: Dandan Bi > > Cc: Liming Gao > > Cc: Garrett Kirkendall > > Cc: Abner Chang > > --- > .../BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomD= ecompressLib.inf > b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLi= b.inf > index 525e92408d6..244c2e35023 100644 > --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompre= ssLib.inf > +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompre= ssLib.inf > @@ -5,6 +5,7 @@ > # Brotli was released on the website https://github.com/google/brotli. > # > # Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved. > +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<= BR> > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -41,6 +42,10 @@ > # Wrapper header files end # > brotli/c/common/dictionary.c > brotli/c/common/transform.c > + brotli/c/common/context.c > + brotli/c/common/platform.c > + brotli/c/common/constants.c > + brotli/c/common/shared_dictionary.c > brotli/c/dec/bit_reader.c > brotli/c/dec/decode.c > brotli/c/dec/huffman.c > -- > 2.37.1.windows.1 > > > >=20 > ------=_NextPart_000_018E_01D936F7.2B1EEF90 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Can you update the patch to support GCC5 and VS2019 both?<= o:p>

 

Thanks

Limi= ng

=E5=8F=91=E4=BB=B6=E4= =BA=BA: devel@edk2.groups.io <dev= el@edk2.groups.io> =E4=BB=A3=E8=A1=A8 Lin, Kuei-Hung (Timoth= y) via groups.io
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4= : 2023=E5=B9=B41=E6=9C=8831=E6=97=A5 13:21
=E6=94= =B6=E4=BB=B6=E4=BA=BA: gao= liming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io; He, Jiangang= <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; 'Ki= nney, Michael D' <michael.d.kinney@intel.com>
=E6=8A=84= =E9=80=81: 'Bi, Dandan' &l= t;dandan.bi@intel.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.c= om>
=E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add miss= ing source file to Brotli library

<= p class=3DMsoNormal> 

[AMD Official Use Only - General]=

 =

Let me clarify= this:
Abner's original code change covers the fix for both GCC5 and VS2= 019.

More over, VS2019 needs these two additional headers file under Md= eModulePkg/Library/BrotliCustomDecompressLib to fix the missing intrinsic f= unctions: memset() and free().

 

<= p class=3DMsoNormal style=3D'background:white'>--

Timothy


From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Monday, January 30= , 2023 9:15 PM
To: devel@= edk2.groups.io <devel@edk2.g= roups.io>; Lin, Kuei-Hung (Timothy) <Kuei-Hung.Lin@amd.com>; He, Jiangang <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; 'Kinney, Mi= chael D' <michael.d.kinney= @intel.com>
Cc: 'Bi, Dandan' <dandan.bi@intel.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>Subject:
=E5= =9B=9E=E5=A4=8D: [edk2-devel] [PATCH V2] MdeModulePk= g/Decompress: Add missing source file to Brotli library

&= nbsp;

Caution:<= /span> This message originat= ed from an External Source. Use proper caution when opening attachments, cl= icking links, or responding.

=

 

Dose this patch fix GCC5 or VS2019 build failure= ?

&n= bsp;

=E5=8F=91=E4=BB=B6=E4=BA=BA:= devel@edk2.groups.io <devel@edk2.groups.io> <= span style=3D'font-size:11.0pt;font-family:=E7=AD=89=E7=BA=BF'>=E4=BB=A3=E8= =A1=A8 Lin, Kuei-Hung (Timothy) via groups.io
=E5=8F=91=E9= =80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B4<= span lang=3DEN-US>1=E6=9C=8831=E6=97=A5 8:50
=E6=94=B6=E4=BB=B6=E4=BA=BA: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io; He, Jiangang <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; 'Kinney, = Michael D' <michael.d.kinn= ey@intel.com>
=E6=8A=84=E9=80=81:
'Bi, Dandan' <dandan.bi@intel.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>
=E4=B8=BB=E9=A2=98: = Re: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing source fil= e to Brotli library

<= /div>

 

[AMD Official Use Only - Genera= l]

 

 

The failure can be replicated with VS2019 and GCC5.=

  • GCC5:
    • /usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: warning: relocation again= st `_kBrotliPrefixCodeRanges' in read-only section `.text.BrotliUefiDecompr= ess'

/usr/bi= n/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `DecodeLiteralBlockSwitch= ':

/home/XXX/edk2-stable2= 02211/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c:= 879: undefined reference to `_kBrotliPrefixCodeRanges'

/usr/bin/ld: /home/XXX/edk2-stable202211/MdeM= odulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c:1193: unde= fined reference to `_kBrotliContextLookupTable'

/usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in func= tion `DecodeCommandBlockSwitch':

/home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecomp= ressLib/brotli/c/dec/decode.c:879: undefined reference to `_kBrotliPrefixCo= deRanges'

/usr/bin/ld: /t= mp/cc7sinRE.ltrans0.ltrans.o: in function `DecodeDistanceBlockSwitch':

/home/XXX/edk2-stable202211/M= deModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c:879: un= defined reference to `_kBrotliPrefixCodeRanges'

/usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in func= tion `SafeDecodeLiteralBlockSwitch':

/home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDe= compressLib/brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPref= ixCodeRanges'

/usr/bin/ld= : /home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLi= b/brotli/c/dec/decode.c:1193: undefined reference to `_kBrotliContextLookup= Table'

/usr/bin/ld: /tm= p/cc7sinRE.ltrans0.ltrans.o: in function `SafeDecodeCommandBlockSwitch':

/home/XXX/edk2-stable2022= 11/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c:898= : undefined reference to `_kBrotliPrefixCodeRanges'

/usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in = function `SafeDecodeDistanceBlockSwitch':

/home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCus= tomDecompressLib/brotli/c/dec/decode.c:898: undefined reference to `_kBrotl= iPrefixCodeRanges'

/usr/b= in/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function `BrotliDecoderDestroyIns= tance':

/home/XXX/edk2-s= table202211/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/sta= te.c:136: undefined reference to `BrotliSharedDictionaryDestroyInstance'

/usr/bin/ld: /tmp/cc7sinR= E.ltrans0.ltrans.o: in function `BrotliUefiDecompress':

/home/XXX/edk2-stable202211/MdeModulePkg/Lib= rary/BrotliCustomDecompressLib/brotli/c/dec/state.c:87: undefined reference= to `BrotliSharedDictionaryCreateInstance'

/usr/bin/ld: /tmp/cc7sinRE.ltrans0.ltrans.o: in function = `BrotliUefiDecompress':

= /= home/XXX/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/b= rotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixCodeRanges'=

/usr/bin/ld: /home/XXX/e= dk2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/de= c/decode.c:1193: undefined reference to `_kBrotliContextLookupTable'=

/usr/bin/ld: warning: creating = DT_TEXTREL in a PIE

colle= ct2: error: ld returned 1 exit status<= /span>

...

=

 

build.py...

 : error F002: Failed to build mo= dule

=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82/home/XXX/edk2-s= table202211/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf [X64, GCC5, RELEASE]

  • VS2019:
    • BBrotliDecompressLib.lib(state.obj) : error LNK2001: unresolve= d external symbol BrotliDefaultFreeFunc

BrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved ext= ernal symbol BrotliDefaultAllocFunc

= B= rotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external symb= ol BrotliSharedDictionaryCreateInstance

BrotliDecompressLib.lib(state.obj) : error LNK2001: unresolved external = symbol BrotliSharedDictionaryDestroyInstance=

BrotliDecompressLib.lib(decode.obj) : error LNK2001: unresolved ext= ernal symbol _kBrotliPrefixCodeRanges<= /span>

BrotliDecompressLib.lib(decode.obj) : error LNK2001: unresolved external s= ymbol BrotliSharedDictionaryAttach

<= span lang=3DEN-US style=3D'font-family:"Calibri",sans-serif;color:black'>Br= otliDecompressLib.lib(decode.obj) : error LNK2001: unresolved external symb= ol _kBrotliContextLookupTable

d:\XXX\= Build\OvmfX64\RELEASE_VS2019\X64\MdeModulePkg\Core\DxeIplPeim\DxeIpl\DEBUG\= DxeIpl.dll : fatal error LNK1120: 7 unresolved externals

...

<= /div>

build.py..= .

 : error 7000: Failed to execu= te command

      &nbs= p; C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tool= s\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe /nologo tbuild [d:\XXX\Build\O= vmfX64\RELEASE_VS2019\X64\MdeModulePkg\Core\DxeIplPeim\DxeIpl]

 

 = ;

--

Timothy

=

From:= gaoliming <= gaoliming@byosoft.com.cn>
Sent: Saturday, January 28, 2023= 11:35 PM
To: devel@edk2.= groups.io <devel@edk2.groups= .io>; Lin, Kuei-Hung (Timothy) <Kuei-Hung.Lin@amd.com>; He, Jiangang <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; 'Kinney, Micha= el D' <michael.d.kinney@in= tel.com>
Cc: 'Bi, Dandan' <dandan.bi@intel.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>
Subject:
=E5=9B=9E= =E5=A4=8D: [edk2-devel] [PATCH V2] MdeModulePkg/Deco= mpress: Add missing source file to Brotli library=

 =

Caution: This message originated f= rom an External Source. Use proper caution when opening attachments, clicki= ng links, or responding.

 <= /o:p>

Timothy:=

&n= bsp;Thanks for your report. This is a real issue in Brotli decompress libra= ry. Which tool chain has been verified? GCC5 or VS2019 or Both?

 <= span lang=3DEN-US>

Thanks

Limi= ng

=E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io <devel@edk2.groups.io> =E4=BB=A3=E8= =A1=A8 Lin, Kuei-Hung (Timothy) via groups.io
=E5=8F=91=E9= =80=81=E6=97=B6=E9=97=B4: 2023
=E5=B9=B4<= span lang=3DEN-US>1=E6=9C=8813=E6=97=A5 6:18
=E6=94=B6=E4=BB=B6=E4=BA=BA: He, Jiangang <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; Kinney, Michael D= <michael.d.kinney@intel.c= om>; devel@edk2.groups.io
=E6=8A=84=E9=80=81: Bi, Dandan <dandan.bi@i= ntel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>
=E4=B8=BB=E9=A2=98: R= e: [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing source file= to Brotli library

 <= /o:p>

[AMD Official Use On= ly - General]

 

This patch tried to fix following build failure whe= n linking the Brotli decompress lib.<= /o:p>

 

Steps to replicate the issue:

1 - Attach a NULL l= ib to DxeIpl.inf in any project's .DSC, say OvmfPkgX64.dsc

  MdeM= odulePkg/Core/DxeIplPeim/DxeIpl.inf { =

  =   <LibraryClasses>

&= nbsp;     NULL|MdeModulePkg/Library/BrotliCustomDecompressLib/Bro= tliCustomDecompressLib.inf

<= /div>

 = }

2 - Follow the EDKII'2 = package build steps to build that project. Build.py would compliains with f= ollowing errors.

=

...

/home/edk2/edk2-stable202211/Mde= ModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/decode.c:879: unde= fined reference to `_kBrotliPrefixCodeRanges'

/usr/bin/ld: /home/edk2/edk2-stable202211/MdeModulePkg/Library= /BrotliCustomDecompressLib/brotli/c/dec/decode.c:1193: undefined reference = to `_kBrotliContextLookupTable'=

/= usr/bin/ld: /tmp/ccKzzHN0.ltrans0.ltrans.o: in function `DecodeCommandBlock= Switch':

...

/usr/bin/ld: /tmp/ccKzzHN0.ltrans0.ltran= s.o: in function `BrotliUefiDecompress':

<= span lang=3DEN-US style=3D'font-family:"Courier New";color:black;background= :white'>/home/edk2/edk2-stable202211/MdeModulePkg/Library/BrotliCustomDecom= pressLib/brotli/c/dec/decode.c:898: undefined reference to `_kBrotliPrefixC= odeRanges'

/usr/bin/ld: /home/edk2/edk= 2-stable202211/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/c/dec/= decode.c:1193: undefined reference to `_kBrotliContextLookupTable'

 

--

T= imothy

 

<= span lang=3DEN-US style=3D'font-family:"Calibri",sans-serif;color:black'>&n= bsp;

 <= /o:p>

 


<= /span>

From: He, Jiangang <Jiangang.He@amd.com>
Sent: Thursday= , January 12, 2023 8:08 AM
To: Chang, Abner <Abner.Chang@amd.com>; Kinney, Michael D <michael.d.kinney@intel.com&= gt;; devel@edk2.groups.io <<= a href=3D"mailto:devel@edk2.groups.io">devel@edk2.groups.io>; Lin, K= uei-Hung (Timothy) <Kuei-Hung.L= in@amd.com>
Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Kirkendall, Gar= rett <Garrett.Kirkendall@a= md.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [edk2-de= vel] [PATCH V2] MdeModulePkg/Decompress: Add missing source file to Brotli = library

 <= /p>

[AMD Official Us= e Only - General]

 

Timothy will answer the q= uestion.

 

From: Chang= , Abner <Abner.Chang@amd.com&= gt;
Sent: Thursday, January 12, 2023 10:05 AM
To: Kinn= ey, Michael D <michael.d.k= inney@intel.com>; devel@edk2= .groups.io
Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Kirkendall, Garrett= <Garrett.Kirkendall@amd.c= om>; Kinney, Michael D <michael.d.kinney@intel.com>; He, Jiangang <Jiangang.He@amd.com>
Subject: Re: [e= dk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing source file to B= rotli library

 

[AMD Official Use Only - Genera= l]

<= span lang=3DEN-US style=3D'font-size:11.0pt;font-family:"Calibri",sans-seri= f'> 

Hi Mike, =

CC Jiangang, he can gi= ve the clear answer.

<= div>

&n= bsp;

Thanks

Abner 

 

 

<= /div>

Get Out= look for Android

<= div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'>

From: Kinney, Michael D <= michael.d.kinney@intel.com>
Sent: Thursday, January 12, 20= 23 11:23:48 PM
To: devel@= edk2.groups.io <devel@edk2.g= roups.io>; Chang, Abner <A= bner.Chang@amd.com>
Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Kirkend= all, Garrett <Garrett.Kirk= endall@amd.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: = [edk2-devel] [PATCH V2] MdeModulePkg/Decompress: Add missing source file to= Brotli library

=

 

Caution: This message originated from an External Source.= Use proper caution when opening attachments, clicking links, or responding= .


Hi Abner,

What was the failure before this change?
<= br>This looks like something that would always break the build of source fi= les were missing.

Mike

> -----Original Message-----
>= ; From: devel@edk2.groups.io &l= t;devel@edk2.groups.io> On B= ehalf Of Chang, Abner via groups.io
> Sent: Wednesday, January 11, 20= 23 9:08 PM
> To: devel@edk2.g= roups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Garrett Kirkendall <= garrett.kirkendall@amd.com>;
> Abner Chang <
abner= .chang@amd.com>
> Subject: [edk2-devel] [PATCH V2] MdeModulePk= g/Decompress: Add missing source file to Brotli library
>
> Fro= m: Abner Chang <abner.chang@amd.c= om>
>
> Add missing source files to Brotli library INF.<= br>>
> Signed-off-by: Jiangang He <jiangang.he@amd.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming= Gao <gaoliming@byosoft.com.= cn>
> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
> Cc: Abner Chang= <abner.chang@amd.com>
= > ---
>  .../BrotliCustomDecompressLib/BrotliCustomDecompress= Lib.inf  | 5 +++++
>  1 file changed, 5 insertions(+)
&g= t;
> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/Brot= liCustomDecompressLib.inf
> b/MdeModulePkg/Library/BrotliCustomDecomp= ressLib/BrotliCustomDecompressLib.inf
> index 525e92408d6..244c2e3502= 3 100644
> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/Brotl= iCustomDecompressLib.inf
> +++ b/MdeModulePkg/Library/BrotliCustomDec= ompressLib/BrotliCustomDecompressLib.inf
> @@ -5,6 +5,7 @@
>&nb= sp; #  Brotli was released on the website https://github.com/google/brotli.
>  #
&= gt;  #  Copyright (c) 2017 - 2020, Intel Corporation. All rights = reserved.<BR>
> +#  Copyright (C) 2023 Advanced Micro Devi= ces, Inc. All rights reserved.<BR>
>  #
>  #&nb= sp; SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@= -41,6 +42,10 @@
>    # Wrapper header files end #
= >    brotli/c/common/dictionary.c
>  &nbs= p; brotli/c/common/transform.c
> +  brotli/c/common/context.c> +  brotli/c/common/platform.c
> +  brotli/c/common/co= nstants.c
> +  brotli/c/common/shared_dictionary.c
> =    brotli/c/dec/bit_reader.c
>    brotli/c/d= ec/decode.c
>    brotli/c/dec/huffman.c
> --
= > 2.37.1.windows.1
>
>
>
>
>

------=_NextPart_000_018E_01D936F7.2B1EEF90--