From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.1730.1580752346497219254 for ; Mon, 03 Feb 2020 09:52:26 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: michael.d.kinney@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 09:52:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="219460785" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 03 Feb 2020 09:52:25 -0800 Received: from orsmsx163.amr.corp.intel.com (10.22.240.88) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Feb 2020 09:52:25 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.57]) by ORSMSX163.amr.corp.intel.com ([169.254.9.66]) with mapi id 14.03.0439.000; Mon, 3 Feb 2020 09:52:25 -0800 From: "Michael D Kinney" To: "Gao, Liming" , "devel@edk2.groups.io" , "Kinney, Michael D" 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: AQHV2i0tYLRP52InN0CaHvlorxmf/qgJBJ4ggACVeYCAACWSoA== Date: Mon, 3 Feb 2020 17:52:24 +0000 Message-ID: References: <20200130004609.14820-1-michael.d.kinney@intel.com> <8e6d09483c9443bda47f08bada85af1f@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Liming, Yes. I think that is a reasonable assumption. We can document that restriction in the EDK II Build Specification that standard POSIX include files (e.g. ) must never be=20 placed in the same directory with other include files that are=20 required for Structured PCD data types or defines/enums that may be used to set Structured PCD field values. We can enter a Tianocore BZ to update the specifications. Thanks, Mike > -----Original Message----- > From: Gao, Liming > Sent: Sunday, February 2, 2020 11:33 PM > To: Kinney, Michael D ; > devel@edk2.groups.io > Cc: Feng, Bob C > Subject: RE: [Patch] BaseTools/DscBuildData: Fix PCD > autogen include file conflict >=20 > Mike: > Yes. Build tool needs to know host OS behavior and > get the full include path. For this patch, it skips > some include paths. If this include path also includes > other required header file, it will cause the build > break. Can we have the assumption that all sys header > files and other non-sys header files are not in the > same include directory? >=20 > Thanks > Liming > > -----Original Message----- > > From: Kinney, Michael D > > Sent: Monday, February 3, 2020 2:40 PM > > To: Gao, Liming ; > devel@edk2.groups.io; Kinney, Michael D > > > Cc: Feng, Bob C > > Subject: RE: [Patch] BaseTools/DscBuildData: Fix PCD > autogen include file conflict > > > > Liming, > > > > The build tools would need to know which env var to > query for > > all OS/host tool chain combinations and how to parse > that > > information for full paths in an OS specific manner. > We should > > not build that type of information into the build > tools. > > > > The fix I have provided does not need this > information. > > > > Mike > > > > > -----Original Message----- > > > From: Gao, Liming > > > Sent: Sunday, February 2, 2020 4:59 PM > > > To: Kinney, Michael D ; > > > devel@edk2.groups.io > > > Cc: Feng, Bob C > > > Subject: RE: [Patch] BaseTools/DscBuildData: Fix > PCD > > > autogen include file conflict > > > > > > Mike: > > > Can we consider to parse INCLUDE env value and > add > > > those path to -I options as the first priority? > > > > > > 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 conflict > > > > > > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2494 > > > > > > > > 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. > > > > > > > > -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. > > > > > > > > Update GenerateByteArrayValue() to skip a package > DEC > > > include > > > > paths that contain , , or > > > . > > > > > > > > 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. > > > > > > > > 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. > > > > > > > > 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(-) > > > > > > > > diff --git > > > a/BaseTools/Source/Python/Workspace/DscBuildData.py > > > b/BaseTools/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 files required > > > > + # by PcdValueInit.c are > > > present in the include paths from > > > > + # the DEC file. > > > PcdValueInit.c must use the standard 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