From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 6EF902218E924 for ; Tue, 5 Dec 2017 10:15:04 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34B98635C1; Tue, 5 Dec 2017 18:19:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-123-60.rdu2.redhat.com [10.10.123.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DD8360605; Tue, 5 Dec 2017 18:19:33 +0000 (UTC) To: Yonghong Zhu , edk2-devel@lists.01.org Cc: Leif Lindholm , Liming Gao References: <1512482099-2156-1-git-send-email-yonghong.zhu@intel.com> From: Laszlo Ersek Message-ID: <61e8298a-b8ff-346b-be64-bee72335a6c9@redhat.com> Date: Tue, 5 Dec 2017 19:19:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1512482099-2156-1-git-send-email-yonghong.zhu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 05 Dec 2017 18:19:35 +0000 (UTC) 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 18:15:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/05/17 14:54, Yonghong Zhu wrote: > It is a regression bug introduced by the patch b37b108, it cause GenSec > make failure on GCC Env. > > Cc: Liming Gao > Cc: Leif Lindholm > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > 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 = fopen (LongFilePath (DummyFileName), "rb"); > if (DummyFile == NULL) { > Error (NULL, 0, 0001, "Error opening file", DummyFileName); > - return EFI_ABORTED; > + goto Finish; > } > > fseek (DummyFile, 0, SEEK_END); > DummyFileSize = 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 = fopen(LongFilePath(InputFileName[0]), "rb"); > if (InFile == NULL) { > Error (NULL, 0, 0001, "Error opening file", InputFileName[0]); > - return EFI_ABORTED; > + goto Finish; > } > > fseek (InFile, 0, SEEK_END); > InFileSize = ftell (InFile); > fseek (InFile, 0, SEEK_SET); > InFileBuffer = (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 - DummyFileSize)) == 0){ > + if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){ > SectGuidHeaderLength = InFileSize - DummyFileSize; > } > } > if (SectGuidHeaderLength == 0) { > SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED; > Tested-by: Laszlo Ersek Reviewed-by: Laszlo Ersek