From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.7711.1580697911410021162 for ; Sun, 02 Feb 2020 18:45:11 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2020 18:45:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,396,1574150400"; d="scan'208";a="263266920" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 02 Feb 2020 18:45:11 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Feb 2020 18:45:10 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 3 Feb 2020 10:45:09 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Mon, 3 Feb 2020 10:45:09 +0800 From: "Liming Gao" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [Patch] BaseTools/DscBuildData: Fix PCD autogen include file conflict Thread-Topic: [Patch] BaseTools/DscBuildData: Fix PCD autogen include file conflict Thread-Index: AQHV1watZTwYVd7W0UiTcQIzkZJkwKgIySuw Date: Mon, 3 Feb 2020 02:45:08 +0000 Message-ID: <4df4bbde917e452d9eeab7f618f3c2ec@intel.com> References: <20200130004609.14820-1-michael.d.kinney@intel.com> In-Reply-To: <20200130004609.14820-1-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Mike: Another way is to parse INCLUDE env value and add the system PATH into -I= options as the first priority.=20 Thanks Liming > -----Original Message----- > From: Kinney, Michael D > Sent: Thursday, January 30, 2020 8:46 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: [Patch] BaseTools/DscBuildData: Fix PCD autogen include file con= flict >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2494 >=20 > When using structured PCDs, a C application is auto generated > to fill in the structured PCD value. The C application uses > the standard include files , , and . > This C application also supports include paths from package DEC > files when a structured PCD declaration provides a > list. The complete list of include paths are -I options for > include paths from package DEC files and the compiler's standard > include paths. >=20 > -I include paths are higher priority than the standard include > paths. If the -I included paths from package DEC files contain > , , or the wrong include files are > used to compile the C application for the structured PCD value. >=20 > Update GenerateByteArrayValue() to skip a package DEC include > paths that contain , , or . >=20 > Build failures were observed when adding a structured PCD to > CryptoPkg. CryptoPkg contains , , and > in the path CryptoPkg/Library/Include to support > building Open SSL. The Library/Include path is listed as a > private include path in CryptoPkg.dec. Without this change, the > standard include files designed to support build OpenSLL are > used to build the structured PCD C application, and that build > fails. >=20 > Other packages that provide a standard C lib or a gasket for > a subset of the standard C lib will run into this same issue > if they also define and use a Structured PCD. So this issue > is not limited to the CryptoPkg. >=20 > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Michael D Kinney > --- > .../Source/Python/Workspace/DscBuildData.py | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index c65a0dd346..be6688dc75 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -1,7 +1,7 @@ > ## @file > # This file is used to create a database used by build tool > # > -# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
> # (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -2667,6 +2667,22 @@ class DscBuildData(PlatformBuildClassObject): > for pkg in PcdDependDEC: > if pkg in PlatformInc: > for inc in PlatformInc[pkg]: > + # > + # Get list of files in potential -I include path > + # > + FileList =3D os.listdir (str(inc)) > + # > + # Skip -I include path if one of the include fil= es required > + # by PcdValueInit.c are present in the include p= aths from > + # the DEC file. PcdValueInit.c must use the sta= ndard include > + # files from the host compiler. > + # > + if 'stdio.h' in FileList: > + continue > + if 'stdlib.h' in FileList: > + continue > + if 'string.h' in FileList: > + continue > MakeApp +=3D '-I' + str(inc) + ' ' > IncSearchList.append(inc) > MakeApp =3D MakeApp + '\n' > -- > 2.21.0.windows.1