From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2DC1720356240 for ; Tue, 5 Dec 2017 06:46:29 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id g53so587678wra.2 for ; Tue, 05 Dec 2017 06:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/Npkz+KTJfLe58zRKXAxJ6CViuvCxuY2JRmClWSOWB8=; b=d3yFRWvFK5aFPrlWBzN08l9PPKos+LNyTWm+wdiM1JVDjEycIu9zi4E7dIeJj/dwoP nuJ2CLXFXXuxoC4oCfbMAxiHdsv+l59D3kN+U9dvXHxa0ifSfTftYr9f9+m8GFhvXOdx d/U5O7MNIqOzoOSTkCoKtiS5u9NLvASL2tiOc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/Npkz+KTJfLe58zRKXAxJ6CViuvCxuY2JRmClWSOWB8=; b=LRHSnsrZ1jEhe+JpZnmBlJvO/3Npcw264dGgYAAgQM/F7Eu4jfSF1Nn8coQVz6HsfW OC0porT/QCEeDIxZN6ZCGhgyfi1rLR+FzQBeROn++hfyN93zVEhty2MFJB7CHborW/mx 0c5F4Xw3xnKgZSSMLmJaABEIRsaxUxRXv75OmAQrjdePnK5/OwPfRHWnxQyr83SJXuN9 W3VBPzpfpdyigrvG8Yl9GCwJTya+0Q+35jLIfJ6fXkcMie74qj12CVBYHhqXcbKQpAAs e22DqzTvUHW9xdJuKku1qVYn4e1iJvyV+2Rp9O1NLfq5a2FrP5+1uDjimCIRyV4FCjf2 r8jw== X-Gm-Message-State: AJaThX7XTRpbhonIUoijT6dIYxZ4wbsNb11tkUAZeKEV4NCLkjPS1clg jYIra7/WC/VXM6B0bND1LsjB6d6IQMU= X-Google-Smtp-Source: AGs4zMbuSFWW+D89J++a7x+sAjLI0k3JOp79YqeKuiouzWakyQ0xxh2KwRBFN2WNHRWUWLkY2+w4SQ== X-Received: by 10.223.143.50 with SMTP id p47mr16047532wrb.104.1512485459563; Tue, 05 Dec 2017 06:50:59 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 1sm739273wmu.8.2017.12.05.06.50.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2017 06:50:58 -0800 (PST) Date: Tue, 5 Dec 2017 14:50:56 +0000 From: Leif Lindholm To: Yonghong Zhu Cc: edk2-devel@lists.01.org, Liming Gao Message-ID: <20171205145056.nczd37vjjjvo3q3s@bivouac.eciton.net> References: <1512482099-2156-1-git-send-email-yonghong.zhu@intel.com> <20171205141426.jbvgo37c3jszupqy@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: <20171205141426.jbvgo37c3jszupqy@bivouac.eciton.net> User-Agent: NeoMutt/20170113 (1.7.2) 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:46:30 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 GenSec > > 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 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: 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 // -typedef INTN RETURN_STATUS; +typedef UINTN RETURN_STATUS; /// /// Set the upper bit to indicate EFI Error. /// -#define ENCODE_ERROR(a) (MAX_BIT | (a)) +#define ENCODE_ERROR(a) ((RETURN_STATUS)(MAX_BIT | (a))) #define ENCODE_WARNING(a) (a) #define RETURN_ERROR(a) ((a) < 0) Should I send this as a separate patch? / Leif > 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 = 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; > > -- > > 2.6.1.windows.1 > >