From nobody Sat Apr 27 15:38:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1512482213136835.3249385778639; Tue, 5 Dec 2017 05:56:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9501920356276; Tue, 5 Dec 2017 05:52:20 -0800 (PST) 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 9C26D2035625A for ; Tue, 5 Dec 2017 05:52:19 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2017 05:56:50 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga004.jf.intel.com with ESMTP; 05 Dec 2017 05:56:49 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,364,1508828400"; d="scan'208";a="156251666" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Tue, 5 Dec 2017 21:54:59 +0800 Message-Id: <1512482099-2156-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , Cc: Leif Lindholm , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Laszlo Ersek Reviewed-by: Leif Lindholm Reviewed-by: Liming Gao Tested-by: Laszlo Ersek Tested-by: Leif Lindholm --- 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; } =20 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); =20 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; } =20 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 - DummyFil= eSize)) =3D=3D 0){ + if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (In= FileSize - DummyFileSize))) =3D=3D 0){ SectGuidHeaderLength =3D InFileSize - DummyFileSize; } } if (SectGuidHeaderLength =3D=3D 0) { SectGuidAttribute |=3D EFI_GUIDED_SECTION_PROCESSING_REQUIRED; --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel