From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A2FE820356266 for ; Tue, 5 Dec 2017 06:54:08 -0800 (PST) Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2017 06:58:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,364,1508828400"; d="scan'208";a="315493" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 05 Dec 2017 06:58:38 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 5 Dec 2017 06:58:38 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 5 Dec 2017 06:58:37 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 5 Dec 2017 22:58:36 +0800 From: "Gao, Liming" To: Leif Lindholm , "Zhu, Yonghong" CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix GenSec GCC make failure Thread-Index: AQHTbdNkVVz4ftkz6kCzjAtBtAoekKM0TyYAgACIHlA= Date: Tue, 5 Dec 2017 14:58:35 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E18A9FD@SHSMSX104.ccr.corp.intel.com> References: <1512482099-2156-1-git-send-email-yonghong.zhu@intel.com> <20171205141426.jbvgo37c3jszupqy@bivouac.eciton.net> <20171205145056.nczd37vjjjvo3q3s@bivouac.eciton.net> In-Reply-To: <20171205145056.nczd37vjjjvo3q3s@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fix GenSec GCC make failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 14:54:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Leif: I suggest to create another patch for it.=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Le= if Lindholm > Sent: Tuesday, December 5, 2017 10:51 PM > To: Zhu, Yonghong > Cc: edk2-devel@lists.01.org; Gao, Liming > Subject: Re: [edk2] [Patch] BaseTools: Fix GenSec GCC make failure >=20 > On Tue, Dec 05, 2017 at 02:14:26PM +0000, Leif Lindholm wrote: > > On Tue, Dec 05, 2017 at 09:54:59PM +0800, Yonghong Zhu wrote: > > > It is a regression bug introduced by the patch b37b108, it cause GenS= ec > > > make failure on GCC Env. > > > > > > Cc: Liming Gao > > > Cc: Leif Lindholm > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > Signed-off-by: Yonghong Zhu > > > > I can confirm this resolves my issue - pick either or both of: > > Tested-by: Leif Lindholm > > Reviewed-by: Leif Lindholm >=20 > Although thinking about it, it would still make sense for the > ENCODE_ERROR macro in BaseTools/Source/C/Include/Common/BaseTypes.h to > mimic the one in MdePkg/Include/Base.h: >=20 > diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h > b/BaseTools/Source/C/Include/Common/BaseTypes.h > index 198647ab95..5fa4e560d8 100644 > --- a/BaseTools/Source/C/Include/Common/BaseTypes.h > +++ b/BaseTools/Source/C/Include/Common/BaseTypes.h > @@ -170,12 +170,12 @@ > // EFI Error Codes common to all execution phases > // >=20 > -typedef INTN RETURN_STATUS; > +typedef UINTN RETURN_STATUS; >=20 > /// > /// Set the upper bit to indicate EFI Error. > /// > -#define ENCODE_ERROR(a) (MAX_BIT | (a)) > +#define ENCODE_ERROR(a) ((RETURN_STATUS)(MAX_BIT | (a))) >=20 > #define ENCODE_WARNING(a) (a) > #define RETURN_ERROR(a) ((a) < 0) >=20 >=20 > Should I send this as a separate patch? >=20 > / > Leif >=20 > > Thanks! > > > > > --- > > > BaseTools/Source/C/GenSec/GenSec.c | 6 +++--- > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/= GenSec/GenSec.c > > > index 2b2def1..5545f12 100644 > > > --- a/BaseTools/Source/C/GenSec/GenSec.c > > > +++ b/BaseTools/Source/C/GenSec/GenSec.c > > > @@ -1324,11 +1324,11 @@ Returns: > > > // Open file and read contents > > > // > > > DummyFile =3D fopen (LongFilePath (DummyFileName), "rb"); > > > if (DummyFile =3D=3D NULL) { > > > Error (NULL, 0, 0001, "Error opening file", DummyFileName); > > > - return EFI_ABORTED; > > > + goto Finish; > > > } > > > > > > fseek (DummyFile, 0, SEEK_END); > > > DummyFileSize =3D ftell (DummyFile); > > > fseek (DummyFile, 0, SEEK_SET); > > > @@ -1338,22 +1338,22 @@ Returns: > > > DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %= s and the size is %u bytes", DummyFileName, (unsigned) > DummyFileSize); > > > > > > InFile =3D fopen(LongFilePath(InputFileName[0]), "rb"); > > > if (InFile =3D=3D NULL) { > > > Error (NULL, 0, 0001, "Error opening file", InputFileName[0]= ); > > > - return EFI_ABORTED; > > > + goto Finish; > > > } > > > > > > fseek (InFile, 0, SEEK_END); > > > InFileSize =3D ftell (InFile); > > > fseek (InFile, 0, SEEK_SET); > > > InFileBuffer =3D (UINT8 *) malloc (InFileSize); > > > fread(InFileBuffer, 1, InFileSize, InFile); > > > fclose(InFile); > > > DebugMsg (NULL, 0, 9, "Input files", "the input file name is %= s and the size is %u bytes", InputFileName[0], (unsigned) > InFileSize); > > > if (InFileSize > DummyFileSize){ > > > - if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - Du= mmyFileSize)) =3D=3D 0){ > > > + if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer= + (InFileSize - DummyFileSize))) =3D=3D 0){ > > > SectGuidHeaderLength =3D InFileSize - DummyFileSize; > > > } > > > } > > > if (SectGuidHeaderLength =3D=3D 0) { > > > SectGuidAttribute |=3D EFI_GUIDED_SECTION_PROCESSING_REQUIRE= D; > > > -- > > > 2.6.1.windows.1 > > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel